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

Function refine_triangulation

python/pymesh/triangulate.py:33–60  ·  view source on GitHub ↗
(mesh, metrics=None, engine="auto", with_timing=False)

Source from the content-addressed store, hash-verified

31
32
33def 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

Callers

nothing calls this directly

Calls 7

form_meshFunction · 0.85
createMethod · 0.45
set_verticesMethod · 0.45
set_facesMethod · 0.45
refineMethod · 0.45
get_verticesMethod · 0.45
get_facesMethod · 0.45

Tested by

no test coverage detected