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

Function conforming_triangulate

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

Source from the content-addressed store, hash-verified

119 return wires;
120
121def conforming_triangulate(wires, logger, auto_hole_detection):
122 bbox_min, bbox_max = wires.bbox;
123 tol = norm(bbox_max - bbox_min) / 20;
124
125 engine = pymesh.triangle();
126 engine.points = wires.vertices;
127 engine.segments = wires.edges;
128 engine.conforming_delaunay = True;
129 engine.max_area = tol**2;
130 engine.verbosity = 0;
131 engine.auto_hole_detection = auto_hole_detection;
132
133 start_time = time();
134 engine.run();
135 finish_time = time();
136
137 t = finish_time - start_time;
138 logger.info("Triangle running time: {}".format(t));
139
140 mesh = engine.mesh;
141 mesh.add_attribute("cell");
142 mesh.set_attribute("cell", engine.regions);
143 return mesh;
144
145def constrained_triangulate(wires, logger, auto_hole_detection):
146 bbox_min, bbox_max = wires.bbox;

Callers 1

mainFunction · 0.85

Calls 3

runMethod · 0.45
add_attributeMethod · 0.45
set_attributeMethod · 0.45

Tested by

no test coverage detected