(points, segments, engine="auto", with_timing=False)
| 4 | from time import time |
| 5 | |
| 6 | def triangulate_beta(points, segments, engine="auto", with_timing=False): |
| 7 | if engine == "auto": |
| 8 | engine = "shewchuk_triangle" |
| 9 | |
| 10 | engine = PyMesh.Triangulation.create(engine) |
| 11 | engine.set_points(points) |
| 12 | engine.set_segments(segments) |
| 13 | |
| 14 | if with_timing: |
| 15 | start_time = time() |
| 16 | |
| 17 | engine.run() |
| 18 | |
| 19 | if with_timing: |
| 20 | finish_time = time() |
| 21 | running_time = finish_time - start_time |
| 22 | |
| 23 | vertices = engine.get_vertices() |
| 24 | faces = engine.get_faces() |
| 25 | |
| 26 | mesh = form_mesh(vertices, faces) |
| 27 | if with_timing: |
| 28 | return mesh, running_time |
| 29 | else: |
| 30 | return mesh |
| 31 | |
| 32 | |
| 33 | def refine_triangulation(mesh, metrics=None, engine="auto", with_timing=False): |
nothing calls this directly
no test coverage detected