-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Analytical_Engine: Adding support for IRegion #1970
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Descriptions need improvement - please see the code comments.
@@ -171,5 +171,17 @@ public static Face Geometry(this IFace face) | |||
return geomFace; | |||
} | |||
|
|||
/***************************************************/ | |||
|
|||
[Description("Gets the geometry of a IRegion as its Perimiter curve. Method required for automatic display in UI packages.")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not only for that, but also for RunExtensionMethod
pattern - may be worth mentioning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, true. Not sure if that adds info to the user or not though? Saying that, not sure the current comment does either!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the user, but could be good to capture that in the API? I am not sure how many people will reach the RunExtensionMethod
Wiki page.
The above may be a more general question to all get/set geometry methods, therefore happy to approve the PR as is.
Co-authored-by: Pawel Baran <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for blocking again, but looks like one of my previous comments did not get recorded for some mysterious reason 👻 Please see the code comment below.
public static IRegion SetOutlineElements1D(this IRegion region, IEnumerable<IElement1D> outlineElements) | ||
{ | ||
IRegion r = region.GetShallowClone(true) as IRegion; | ||
r.Perimeter = BH.Engine.Geometry.Compute.IJoin(outlineElements.Cast<ICurve>().ToList())[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would consider adding a check if the output of IJoin
contains only 1 item and if that item is closed - if not, raise a warning that the output may be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM now, last question: are we happy to merge without a test file? Looks safe, but double checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved in line with the oM 😄
Good point pawel. Missed that I never uploaded the testfile. Have put it on sharepoint, link in description, if you want to have a quick test! |
/azp run BHoM_Engine.CheckInstaller |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked the test file. Works fine and record proper warnings. lgtm
NOTE: Depends on
BHoM/BHoM#985
Issues addressed by this PR
BHoM/BHoM#970
Adding IElement2D methods required for IRegion.
https://github.com/BHoM/documentation/wiki/IElement-required-extension-methods
Test files
https://burohappold.sharepoint.com/:f:/s/BHoM/ElcGHiplcxxJuRsZYz9ewx8BkczFetyKcjcxAhclljhVSw?e=Pdksu3
Changelog
Additional comments