Skip to content
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

Merged
merged 5 commits into from
Sep 11, 2020

Conversation

IsakNaslundBh
Copy link
Contributor

@IsakNaslundBh IsakNaslundBh commented Sep 8, 2020

@IsakNaslundBh IsakNaslundBh added the type:feature New capability or enhancement label Sep 8, 2020
@IsakNaslundBh IsakNaslundBh added this to the BHoM 3.3 β MVP milestone Sep 8, 2020
@IsakNaslundBh IsakNaslundBh self-assigned this Sep 8, 2020
Copy link
Member

@pawelbaran pawelbaran left a 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.

Analytical_Engine/Modify/SetOutlineElements1D.cs Outdated Show resolved Hide resolved
@@ -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.")]
Copy link
Member

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

Copy link
Contributor Author

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!

Copy link
Member

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.

Analytical_Engine/Query/OutlineElements1D.cs Outdated Show resolved Hide resolved
Copy link
Member

@pawelbaran pawelbaran left a 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];
Copy link
Member

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.

Copy link
Member

@pawelbaran pawelbaran left a 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.

Copy link
Contributor

@FraserGreenroyd FraserGreenroyd left a 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 😄

@IsakNaslundBh
Copy link
Contributor Author

Code LGTM now, last question: are we happy to merge without a test file? Looks safe, but double checking.

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!

@IsakNaslundBh
Copy link
Contributor Author

/azp run BHoM_Engine.CheckInstaller

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@LMarkowski LMarkowski left a 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

@IsakNaslundBh IsakNaslundBh merged commit 332ca69 into master Sep 11, 2020
@IsakNaslundBh IsakNaslundBh deleted the Analytical_oM-#970-AddIRegion branch September 11, 2020 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New capability or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants