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

Function triangulate_beta

python/pymesh/triangulate.py:6–30  ·  view source on GitHub ↗
(points, segments, engine="auto", with_timing=False)

Source from the content-addressed store, hash-verified

4from time import time
5
6def 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
33def refine_triangulation(mesh, metrics=None, engine="auto", with_timing=False):

Callers

nothing calls this directly

Calls 7

form_meshFunction · 0.85
createMethod · 0.45
set_pointsMethod · 0.45
set_segmentsMethod · 0.45
runMethod · 0.45
get_verticesMethod · 0.45
get_facesMethod · 0.45

Tested by

no test coverage detected