1313import math
1414import sys
1515from git import Repo
16+ import faulthandler
17+ faulthandler .enable ()
1618
1719
1820
@@ -705,7 +707,7 @@ def test_cylinder(self):
705707 self .assertTrue (f .flags .c_contiguous )
706708
707709 def test_decimate (self ):
708- success , u , g , j , i = igl .decimate (self .v1 , self .f1 , 100 )
710+ success , u , g , j , i = igl .decimate (self .v1 , self .f1 , 100 , False )
709711 self .assertEqual (u .shape [1 ], self .v1 .shape [1 ])
710712 self .assertEqual (g .shape [1 ], 3 )
711713 self .assertEqual (j .shape [0 ], g .shape [0 ])
@@ -823,7 +825,7 @@ def test_procrustes(self):
823825 self .assertTrue (r .dtype == t .dtype == self .v1 .dtype )
824826
825827 def test_qslim (self ):
826- success , u , g , j , i = igl .qslim (self .v1 , self .f1 , 100 )
828+ success , u , g , j , i = igl .qslim (self .v1 , self .f1 , 100 , False )
827829 self .assertEqual (u .dtype , self .v1 .dtype )
828830 self .assertTrue (g .dtype == j .dtype == i .dtype == self .f1 .dtype )
829831 self .assertEqual (u .shape [1 ], self .v1 .shape [1 ])
@@ -2430,7 +2432,7 @@ def test_fast_winding_number_for_meshes(self):
24302432
24312433 def test_flip_avoiding_line_search (self ):
24322434 def fun (v ):
2433- return np .random .rand (1 )
2435+ return np .random .rand (1 )[ 0 ]
24342436
24352437 energy , vr = igl .flip_avoiding_line_search (
24362438 self .f1 , self .v1 [:, :2 ], self .v1 [:, :2 ], fun , 10.0 )
@@ -2484,20 +2486,22 @@ def test_flip_edge(self):
24842486
24852487 def test_AABB (self ):
24862488 tree = igl .AABB_f64_3 ()
2487- tree .init (self .v1 ,self .f1 )
2488- bc = igl .barycenter (self .v1 ,self .f1 )
2489- 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 )
24902494 self .assertTrue (sqrD .shape [0 ] == bc .shape [0 ])
24912495 self .assertTrue (np .max (sqrD ) <= 1e-16 )
2492- 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 )
24932497 self .assertTrue (sqrD .shape [0 ] == bc .shape [0 ])
24942498 self .assertTrue (I .shape [0 ] == bc .shape [0 ])
24952499 self .assertTrue (C .shape == bc .shape )
24962500
24972501 def test_in_element_3 (self ):
2498- V = np .array ([ [0. ,0 ,0 ], [1 ,0 ,0 ], [0 ,1 ,0 ], [0 ,0 ,1 ], [1 ,1 ,1 ]],dtype = 'float64' )
2499- T = np .array ([[0 ,1 ,2 ,3 ],[4 ,3 ,2 ,1 ]],dtype = 'int32' )
2500- 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' )
25012505 tree = igl .AABB_f64_3 ()
25022506 tree .init (V ,T )
25032507 I = igl .in_element_3 (V ,T ,Q ,tree )
@@ -2506,17 +2510,16 @@ def test_in_element_3(self):
25062510 self .assertTrue (I [1 ] == 1 )
25072511
25082512 def test_in_element_2 (self ):
2509- V = np .array ([ [0. ,0 ], [1 ,0 ], [0 ,1 ], [1 ,1 ]],dtype = 'float64' )
2510- F = np .array ([[0 ,1 ,2 ],[2 ,1 ,3 ]],'int32' )
2511- 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' )
25122516 tree = igl .AABB_f64_2 ()
25132517 tree .init (V ,F )
25142518 I = igl .in_element_2 (V ,F ,Q ,tree )
25152519 self .assertTrue (I .shape [0 ] == Q .shape [0 ])
25162520 self .assertTrue (I [0 ] == 0 )
25172521 self .assertTrue (I [1 ] == 1 )
25182522
2519-
25202523 def test_triangulate (self ):
25212524 V = np .array ([[0 ,0 ],[1 ,0 ],[1 ,1 ],[0 ,1 ]],dtype = 'float64' )
25222525 E = np .array ([[0 ,1 ],[1 ,2 ],[2 ,3 ],[3 ,0 ]])
0 commit comments