-
Notifications
You must be signed in to change notification settings - Fork 525
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
Polygon composite surface #2266
Conversation
5fea9bd
to
81d9d46
Compare
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.
Really cool new feature @eepeterson! Just a few small comments:
@eepeterson There's just a few more comments to address and then this should be good to merge. Thanks for the updates! |
Co-authored-by: Paul Romano <[email protected]>
4c59ac9
to
2adbe97
Compare
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.
Thanks for the updates!
This PR is the addition of a
CompositeSurface
class for a generalized 2D polygon defined by a series of points, assumed to be connected by linear segments and closed. Essentially this class acts like any other surface and obeys theCompositeSurface
protocol. It decomposes any polygon into a set of convex shapes, the union of which is the negative halfspace of the polygon and the complement of the union is the positive half space. You can also easily offset the polygon to form nested regions using theopenmc.model.subdivide
function. The following couple plots show the output of code similar to the followingNested vacuum vessel defined by a series of RZ points
![full_figure](https://user-images.githubusercontent.com/18011007/196010054-0c844d66-792d-4a41-a5bd-a327103809ba.png)
Zoomed in version of the above
![zoomed_figure](https://user-images.githubusercontent.com/18011007/196010058-031c1bd3-4e61-449d-9ef3-0c55b9aff08d.png)
Decomposition of polygon into convex subsets
![regions](https://user-images.githubusercontent.com/18011007/196010061-93fd4760-bf07-4c3a-b20b-7e4c3f314875.png)
There's still a little clean up that needs to happen and tests to write before this is really ready.