@@ -2296,11 +2296,27 @@ def test_unproject_on_plane(self):
22962296 self .assertTrue (z .shape == (3 , ))
22972297 self .assertTrue (z .dtype == np .float )
22982298
2299- def test_fast_winding_number_for_points (self ):
2300- pass
2299+ def test_fast_winding_number_for_points (self ):
2300+ xs = np .linspace (- 5.0 , 5.0 , 10 )
2301+ grid = np .meshgrid (xs , xs , xs , indexing = 'ij' )
2302+ grid = np .stack (grid ).reshape (3 , - 1 , order = 'F' ).T
2303+ n = igl .per_vertex_normals (self .v1 , self .f1 )
2304+ a = np .ones ((n .shape [0 ], )) / n .shape [0 ]
2305+
2306+ wn = igl .fast_winding_number_for_points (self .v1 , n , a , grid )
2307+ self .assertTrue (wn .flags .c_contiguous )
2308+ self .assertTrue (wn .shape == (grid .shape [0 ], ))
2309+ self .assertTrue (wn .dtype == np .float )
23012310
23022311 def test_fast_winding_number_for_meshes (self ):
2303- pass
2312+ xs = np .linspace (- 5.0 , 5.0 , 10 )
2313+ grid = np .meshgrid (xs , xs , xs , indexing = 'ij' )
2314+ grid = np .stack (grid ).reshape (3 , - 1 , order = 'F' ).T
2315+
2316+ wn = igl .fast_winding_number_for_meshes (self .v1 , self .f1 , grid )
2317+ self .assertTrue (wn .flags .c_contiguous )
2318+ self .assertTrue (wn .shape == (grid .shape [0 ], ))
2319+ self .assertTrue (wn .dtype == np .float )
23042320
23052321 def test_flip_avoiding_line_search (self ):
23062322 def fun (v ):
0 commit comments