File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ def extrude_triangulation(vertices,
255255
256256
257257def triangulate_polygon (polygon ,
258- triangle_args = 'pq0D ' ,
258+ triangle_args = 'pq30 ' ,
259259 engine = 'auto' ,
260260 ** kwargs ):
261261 """
@@ -307,7 +307,7 @@ def triangulate_polygon(polygon,
307307
308308 # do the import here, as sometimes this import can segfault
309309 # which is not catchable with a try/except block
310- import meshpy . triangle as triangle
310+ from meshpy import triangle
311311 # call meshpy.triangle on our cleaned representation of
312312 # the Shapely polygon
313313 info = triangle .MeshInfo ()
@@ -403,6 +403,11 @@ def add_boundary(boundary, start):
403403 vertices = np .vstack (vertices )
404404 facets = np .vstack (facets ).tolist ()
405405
406+ # shapely polygons can include a Z component
407+ # strip it out for the triangulation
408+ if vertices .shape [1 ] == 3 :
409+ vertices = vertices [:, :2 ]
410+
406411 result = {'vertices' : vertices ,
407412 'segments' : facets }
408413 # holes in meshpy lingo are a (h, 2) list of (x,y) points
Original file line number Diff line number Diff line change 1- __version__ = '2.35.12 '
1+ __version__ = '2.35.13 '
You can’t perform that action at this time.
0 commit comments