(mesh, metrics=None, engine="auto", with_timing=False)
| 31 | |
| 32 | |
| 33 | def refine_triangulation(mesh, metrics=None, engine="auto", with_timing=False): |
| 34 | if engine == "auto": |
| 35 | engine = "mmg_delaunay" |
| 36 | |
| 37 | engine = PyMesh.Triangulation.create(engine) |
| 38 | engine.set_vertices(mesh.vertices) |
| 39 | engine.set_faces(mesh.faces) |
| 40 | |
| 41 | if with_timing: |
| 42 | start_time = time() |
| 43 | |
| 44 | if metrics is None: |
| 45 | engine.refine(np.zeros((0,1))) |
| 46 | else: |
| 47 | engine.refine(metrics) |
| 48 | |
| 49 | if with_timing: |
| 50 | finish_time = time() |
| 51 | running_time = finish_time - start_time |
| 52 | |
| 53 | vertices = engine.get_vertices() |
| 54 | faces = engine.get_faces() |
| 55 | |
| 56 | mesh = form_mesh(vertices, faces) |
| 57 | if with_timing: |
| 58 | return mesh, running_time |
| 59 | else: |
| 60 | return mesh |
nothing calls this directly
no test coverage detected