Skip to content

Commit 820d242

Browse files
committed
Add unproject_x tests
1 parent 536973b commit 820d242

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

tests/test_basic.py

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2260,13 +2260,36 @@ def test_topological_hole_fill(self):
22602260
self.assertTrue(ff.shape[0] != f.shape[0])
22612261

22622262
def test_triangulated_grid(self):
2263-
pass
2263+
v, f = igl.triangulated_grid(10, 10)
2264+
self.assertTrue(v.shape == (100, 2))
2265+
self.assertTrue(f.shape == (162, 3))
2266+
self.assertTrue(f.flags.c_contiguous)
2267+
self.assertTrue(v.flags.c_contiguous)
2268+
self.assertTrue(v.dtype == np.float)
2269+
self.assertTrue(f.dtype == np.int)
22642270

22652271
def test_unproject_on_line(self):
2266-
pass
2272+
pos = np.array([10., 10.])
2273+
eye = np.eye(4)
2274+
viewport = np.array([0., 0., 100., 100.])
2275+
p = np.array([15.0, 20.0, 13.0])
2276+
d = np.array([0.1, 0.2, 1.0])
2277+
t, z = igl.unproject_on_line(pos, eye, viewport, p, d)
2278+
2279+
self.assertTrue(z.flags.c_contiguous)
2280+
self.assertTrue(z.shape == (3, ))
2281+
self.assertTrue(z.dtype == np.float)
22672282

22682283
def test_unproject_on_plane(self):
2269-
pass
2284+
pos = np.array([10., 10.])
2285+
eye = np.eye(4)
2286+
viewport = np.array([0., 0., 100., 100.])
2287+
p = np.array([1.0, 2.0, 3.0, 2.0])
2288+
z = igl.unproject_on_plane(pos, eye, viewport, p)
2289+
2290+
self.assertTrue(z.flags.c_contiguous)
2291+
self.assertTrue(z.shape == (3, ))
2292+
self.assertTrue(z.dtype == np.float)
22702293

22712294
def test_fast_winding_number_for_points(self):
22722295
pass

0 commit comments

Comments
 (0)