MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / constrained_triangulate

Function constrained_triangulate

scripts/repousse.py:145–168  ·  view source on GitHub ↗
(wires, logger, auto_hole_detection)

Source from the content-addressed store, hash-verified

143 return mesh;
144
145def constrained_triangulate(wires, logger, auto_hole_detection):
146 bbox_min, bbox_max = wires.bbox;
147 tol = norm(bbox_max - bbox_min) / 20;
148
149 engine = pymesh.triangle();
150 engine.points = wires.vertices;
151 engine.segments = wires.edges;
152 engine.conforming_delaunay = False;
153 engine.max_num_steiner_points = 0;
154 engine.split_boundary = False;
155 engine.verbosity = 0;
156 engine.auto_hole_detection = auto_hole_detection;
157
158 start_time = time();
159 engine.run();
160 finish_time = time();
161
162 t = finish_time - start_time;
163 logger.info("Triangle running time: {}".format(t));
164
165 mesh = engine.mesh;
166 mesh.add_attribute("cell");
167 mesh.set_attribute("cell", engine.regions);
168 return mesh;
169
170def resolve_self_intersection(wires, logger):
171 if wires.num_vertices == 0:

Callers 3

bevelFunction · 0.85
mainFunction · 0.85

Calls 3

runMethod · 0.45
add_attributeMethod · 0.45
set_attributeMethod · 0.45

Tested by

no test coverage detected