How to extract mesh exterior and interior boundaries? #379
Unanswered
ryan-kipawa
asked this question in
Q&A
Replies: 1 comment
-
Hi Ryan - great that you found a workaround - Unfortunately, I do not have time to look into this as I am on my way to summer vacation. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have a big mesh where I would like to extract the outer and inner boundaries to shapely polygons. The "to_shapely" function seems to take a long time for the mesh size (well over 10 million elements). I also don't need each element as a polygon, just the boundaries. Is there a more efficient way to do this?
Edit:
I tried merging together polygons from mesh.boundary_polylines.exteriors. It's not working as I expected though. I also tried with interiors, however, some of the polylines have only 2 nodes and can't be converted to a polygon.
polygons = [Polygon(p.xy) for p in msh.boundary_polylines.exteriors]
boundary = MultiPolygon(polygons)
Edit 2:
It looks like some of the exterior polylines are misread as interiors (see image). Could it be a bug or a corrupt mesh file?
Edit 3:
I found this that seems to be a workaround. A similar solution works for the interiors.
Thanks
Ryan
Beta Was this translation helpful? Give feedback.
All reactions