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

Method test_refine

python/pymesh/tests/test_triangulate.py:47–64  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

45 [0.0, 0.0, 0.0], np.amin(vertices, axis=0))
46
47 def test_refine(self):
48 vertices = np.array([
49 [0, 0, 0],
50 [1, 0, 1],
51 [1, 1, 1],
52 [0, 1, 0] ], dtype=float)
53 faces = np.array([
54 [0, 1, 2],
55 [0, 2, 3] ])
56 in_mesh = pymesh.form_mesh(vertices, faces)
57 out_mesh = retriangulate(in_mesh, 0.1)
58 self.assertLess(in_mesh.num_vertices, out_mesh.num_vertices)
59 self.assertLess(in_mesh.num_faces, out_mesh.num_faces)
60 in_mesh.add_attribute("face_area")
61 in_areas = in_mesh.get_attribute("face_area")
62 out_mesh.add_attribute("face_area")
63 out_areas = out_mesh.get_attribute("face_area")
64 self.assertAlmostEqual(np.sum(in_areas), np.sum(out_areas))
65

Callers

nothing calls this directly

Calls 3

form_meshMethod · 0.45
add_attributeMethod · 0.45
get_attributeMethod · 0.45

Tested by

no test coverage detected