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

Method test_edge_edge_touch

python/pymesh/tests/test_boolean.py:96–135  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

94 self.assertEqual(1, mesh.num_components)
95
96 def test_edge_edge_touch(self):
97 mesh_1 = generate_box_mesh(
98 np.array([0, 0, 0]), np.array([1, 1, 1]))
99 mesh_2 = generate_box_mesh(
100 np.array([0, 1, 1]), np.array([1, 2, 2]))
101
102 mesh = boolean(
103 mesh_1, mesh_2,
104 "intersection", "igl")
105 self.assertEqual(0, mesh.num_vertices)
106 self.assertEqual(0, mesh.num_faces)
107 self.assertTrue(mesh.is_manifold())
108 self.assertTrue(mesh.is_closed())
109 self.assertEqual(0, mesh.num_components)
110
111 mesh = boolean(
112 mesh_1, mesh_2,
113 "union", "igl")
114 self.assertEqual(14, mesh.num_vertices)
115 self.assertEqual(24, mesh.num_faces)
116 self.assertFalse(mesh.is_manifold())
117 self.assertTrue(mesh.is_closed())
118 self.assertEqual(1, mesh.num_components)
119
120 mesh = boolean(
121 mesh_1, mesh_2,
122 "difference", "igl")
123 self.assert_array_equal(mesh_1.bbox, mesh.bbox)
124 self.assertTrue(mesh.is_manifold())
125 self.assertTrue(mesh.is_closed())
126 self.assertEqual(1, mesh.num_components)
127
128 mesh = boolean(
129 mesh_1, mesh_2,
130 "symmetric_difference", "igl")
131 self.assertEqual(14, mesh.num_vertices)
132 self.assertEqual(24, mesh.num_faces)
133 self.assertFalse(mesh.is_manifold())
134 self.assertTrue(mesh.is_closed())
135 self.assertEqual(1, mesh.num_components)
136
137 #@unittest.skip("Coplanar faces are not handled correctly yet.")
138 def test_face_face_touch(self):

Callers

nothing calls this directly

Calls 5

generate_box_meshFunction · 0.90
booleanFunction · 0.90
assert_array_equalMethod · 0.80
is_manifoldMethod · 0.45
is_closedMethod · 0.45

Tested by

no test coverage detected