@@ -2486,20 +2486,22 @@ def test_flip_edge(self):
24862486
24872487 def test_AABB (self ):
24882488 tree = igl .AABB_f64_3 ()
2489- tree .init (self .v1 ,self .f1 )
2490- bc = igl .barycenter (self .v1 ,self .f1 )
2491- sqrD = tree .squared_distance (self .v1 ,self .f1 ,bc )
2489+ v1_f = np .asarray (self .v1 , order = 'F' )
2490+ f1_f = np .asarray (self .f1 , order = 'F' )
2491+ tree .init (v1_f ,f1_f )
2492+ bc = igl .barycenter (v1_f ,f1_f )
2493+ sqrD = tree .squared_distance (v1_f ,f1_f ,bc )
24922494 self .assertTrue (sqrD .shape [0 ] == bc .shape [0 ])
24932495 self .assertTrue (np .max (sqrD ) <= 1e-16 )
2494- sqrD ,I ,C = tree .squared_distance (self . v1 , self . f1 ,bc ,return_index = True ,return_closest_point = True )
2496+ sqrD ,I ,C = tree .squared_distance (v1_f , f1_f ,bc ,return_index = True ,return_closest_point = True )
24952497 self .assertTrue (sqrD .shape [0 ] == bc .shape [0 ])
24962498 self .assertTrue (I .shape [0 ] == bc .shape [0 ])
24972499 self .assertTrue (C .shape == bc .shape )
24982500
24992501 def test_in_element_3 (self ):
2500- V = np .array ([ [0. ,0 ,0 ], [1 ,0 ,0 ], [0 ,1 ,0 ], [0 ,0 ,1 ], [1 ,1 ,1 ]],dtype = 'float64' )
2501- T = np .array ([[0 ,1 ,2 ,3 ],[4 ,3 ,2 ,1 ]],dtype = 'int32' )
2502- Q = np .array ([[0.1 ,0.1 ,0.1 ],[0.9 ,0.9 ,0.9 ]],dtype = 'float64' )
2502+ V = np .array ([ [0. ,0 ,0 ], [1 ,0 ,0 ], [0 ,1 ,0 ], [0 ,0 ,1 ], [1 ,1 ,1 ]],dtype = 'float64' , order = 'f' )
2503+ T = np .array ([[0 ,1 ,2 ,3 ],[4 ,3 ,2 ,1 ]],dtype = 'int32' , order = 'f' )
2504+ Q = np .array ([[0.1 ,0.1 ,0.1 ],[0.9 ,0.9 ,0.9 ]],dtype = 'float64' , order = 'f' )
25032505 tree = igl .AABB_f64_3 ()
25042506 tree .init (V ,T )
25052507 I = igl .in_element_3 (V ,T ,Q ,tree )
@@ -2508,17 +2510,16 @@ def test_in_element_3(self):
25082510 self .assertTrue (I [1 ] == 1 )
25092511
25102512 def test_in_element_2 (self ):
2511- V = np .array ([ [0. ,0 ], [1 ,0 ], [0 ,1 ], [1 ,1 ]],dtype = 'float64' )
2512- F = np .array ([[0 ,1 ,2 ],[2 ,1 ,3 ]],'int32' )
2513- Q = np .array ([[0.1 ,0.1 ],[0.9 ,0.9 ]],dtype = 'float64' )
2513+ V = np .array ([ [0. ,0 ], [1 ,0 ], [0 ,1 ], [1 ,1 ]],dtype = 'float64' , order = 'f' )
2514+ F = np .array ([[0 ,1 ,2 ],[2 ,1 ,3 ]],'int32' , order = 'f' )
2515+ Q = np .array ([[0.1 ,0.1 ],[0.9 ,0.9 ]],dtype = 'float64' , order = 'f' )
25142516 tree = igl .AABB_f64_2 ()
25152517 tree .init (V ,F )
25162518 I = igl .in_element_2 (V ,F ,Q ,tree )
25172519 self .assertTrue (I .shape [0 ] == Q .shape [0 ])
25182520 self .assertTrue (I [0 ] == 0 )
25192521 self .assertTrue (I [1 ] == 1 )
25202522
2521-
25222523 def test_triangulate (self ):
25232524 V = np .array ([[0 ,0 ],[1 ,0 ],[1 ,1 ],[0 ,1 ]],dtype = 'float64' )
25242525 E = np .array ([[0 ,1 ],[1 ,2 ],[2 ,3 ],[3 ,0 ]])
0 commit comments