(wires, logger, auto_hole_detection)
| 119 | return wires; |
| 120 | |
| 121 | def 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 | |
| 145 | def constrained_triangulate(wires, logger, auto_hole_detection): |
| 146 | bbox_min, bbox_max = wires.bbox; |
no test coverage detected