Skip to content

Commit 536973b

Browse files
committed
Fix topological_hole_fill binding, add tests
1 parent b9242f7 commit 536973b

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/topological_hole_fill.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ npe_function(topological_hole_fill)
4040
npe_doc(ds_topological_hole_fill)
4141

4242
npe_arg(f, dense_int, dense_long, dense_longlong)
43-
npe_arg(b, dense_float, dense_double)
43+
npe_arg(b, dense_int, dense_long, dense_longlong)
4444
npe_arg(holes, std::vector<std::vector<int>>)
4545

4646

@@ -51,5 +51,3 @@ npe_begin_code()
5151
return npe::move(f_filled);
5252

5353
npe_end_code()
54-
55-

tests/test_basic.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2243,10 +2243,21 @@ def test_quad_grid(self):
22432243
self.assertTrue(e.dtype == np.int)
22442244

22452245
def test_sparse_voxel_grid(self):
2246-
pass
2246+
def sphere1(point):
2247+
return np.sqrt(point[0]**2 + point[1]**2 + point[2]**2) - 1.0
2248+
point = np.array([1.0, 0.0, 0.0])
2249+
cs, cv, ci = igl.sparse_voxel_grid(point, sphere1, 1.0, 100)
2250+
#print(cs, cv, ci)
22472251

22482252
def test_topological_hole_fill(self):
2249-
pass
2253+
f = self.f1
2254+
b = np.array(range(10))
2255+
h = [range(10, 20)]
2256+
ff = igl.topological_hole_fill(f, b, h)
2257+
self.assertTrue(ff.flags.c_contiguous)
2258+
self.assertTrue(ff.shape[1] == 3)
2259+
self.assertTrue(ff.dtype == np.int)
2260+
self.assertTrue(ff.shape[0] != f.shape[0])
22502261

22512262
def test_triangulated_grid(self):
22522263
pass

0 commit comments

Comments
 (0)