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

Method test_cube

python/pymesh/tests/test_winding_number.py:11–26  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

9
10class WindingNumberTest(TestCase):
11 def test_cube(self):
12 mesh = generate_box_mesh(
13 np.array([0, 0, 0]), np.array([1, 1, 1]))
14 queries = np.array([
15 [-1, 0, 0],
16 [0.0, 0.0, 0.0],
17 [0.5, 0.0, 0.0],
18 [0.5, 0.5, 0.0],
19 [0.5, 0.5, 0.5],
20 ])
21
22 winding_numbers = compute_winding_number(mesh, queries)
23
24 self.assertEqual(len(queries), len(winding_numbers))
25 self.assert_array_almost_equal(
26 [0, 0.125, 0.25, 0.5, 1], winding_numbers)
27
28 @unittest.skip("Faster winding number is temporarily unavailable")
29 def test_fast_winding_number(self):

Callers

nothing calls this directly

Calls 3

generate_box_meshFunction · 0.90
compute_winding_numberFunction · 0.90

Tested by

no test coverage detected