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

Function integrate

scripts/mean_curvature_flow.py:28–44  ·  view source on GitHub ↗
(mesh, time_step, use_graph_laplacian)

Source from the content-addressed store, hash-verified

26 return pymesh.form_mesh(vertices, faces);
27
28def integrate(mesh, time_step, use_graph_laplacian):
29 assembler = pymesh.Assembler(mesh);
30 if use_graph_laplacian:
31 L = -assembler.assemble("graph_laplacian");
32 else:
33 L = assembler.assemble("laplacian");
34 M = assembler.assemble("mass");
35
36 bbox_min, bbox_max = mesh.bbox;
37 s = np.amax(bbox_max - bbox_min);
38
39 S = M + (time_step * s) * L;
40 solver = pymesh.SparseSolver.create("SparseLU");
41 solver.compute(S);
42 vertices = solver.solve(M * mesh.vertices);
43
44 return normalize_mesh(vertices, mesh.faces);
45
46def mean_curvature_flow(mesh, num_itrs=1, time_step=1e-3,
47 use_graph_laplacian=False):

Callers 1

mean_curvature_flowFunction · 0.85

Calls 5

assembleMethod · 0.95
normalize_meshFunction · 0.85
createMethod · 0.45
computeMethod · 0.45
solveMethod · 0.45

Tested by

no test coverage detected