(wires, logger, auto_hole_detection)
| 143 | return mesh; |
| 144 | |
| 145 | def 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 | |
| 170 | def resolve_self_intersection(wires, logger): |
| 171 | if wires.num_vertices == 0: |
no test coverage detected