@@ -494,6 +494,9 @@ def test_read_dmat(self):
494494 self .assertEqual (mat .dtype , "float64" )
495495 self .assertTrue (mat .flags .c_contiguous )
496496
497+ def test_write_dmat (self ):
498+ igl .write_dmat (self .test_data_path + "decimated-knight-selection.dmat" ,self .v )
499+
497500 # sparse matrix, no flag attribute
498501 def test_vector_area_matrix (self ):
499502 a = igl .vector_area_matrix (self .f )
@@ -2528,5 +2531,61 @@ def test_convex_hull(self):
25282531 F_gt = np .array ([[0 , 1 , 2 ], [0 , 1 , 3 ], [0 , 2 , 3 ], [1 , 2 , 3 ]],dtype = "int64" )
25292532 self .assertTrue ((F == F_gt ).all ())
25302533
2534+ def test__version (self ):
2535+ self .assertTrue (isinstance (igl .__version__ , str ))
2536+
2537+ def test_blue_noise (self ):
2538+ r = igl .avg_edge_length (self .v , self .f )
2539+ b ,fi ,p = igl .blue_noise (self .v , self .f , r * 0.1 )
2540+ self .assertTrue (b .shape [0 ] == fi .shape [0 ])
2541+ self .assertTrue (b .shape [0 ] == p .shape [0 ])
2542+ self .assertTrue (self .v .shape [1 ] == p .shape [1 ])
2543+ self .assertTrue (self .f .shape [1 ] == b .shape [1 ])
2544+
2545+ def test_fit_cubic_bezier (self ):
2546+ r = igl .avg_edge_length (self .v , self .f )
2547+ cubics = igl .fit_cubic_bezier (self .v , r )
2548+ [self .assertTrue (cubic .shape [1 ] == self .v .shape [1 ]) for cubic in cubics ]
2549+
2550+ def test_is_delaunay (self ):
2551+ D = igl .is_delaunay (self .v , self .f )
2552+ self .assertTrue (D .shape [0 ] == self .f .shape [0 ])
2553+ self .assertTrue (D .shape [1 ] == self .f .shape [1 ])
2554+
2555+ def test_random_points_on_mesh (self ):
2556+ b ,fi ,x = igl .random_points_on_mesh (100 , self .v , self .f )
2557+ self .assertTrue (b .shape [0 ] == 100 )
2558+ self .assertTrue (b .shape [0 ] == fi .shape [0 ])
2559+ self .assertTrue (b .shape [0 ] == x .shape [0 ])
2560+ self .assertTrue (self .v .shape [1 ] == x .shape [1 ])
2561+ self .assertTrue (self .f .shape [1 ] == b .shape [1 ])
2562+
2563+ def test_random_points_on_mesh_intrinsic (self ):
2564+ dblA = igl .doublearea (self .v , self .f )
2565+ b ,fi = igl .random_points_on_mesh_intrinsic (100 , dblA )
2566+ self .assertTrue (b .shape [0 ] == 100 )
2567+ self .assertTrue (b .shape [0 ] == fi .shape [0 ])
2568+ self .assertTrue (self .f .shape [1 ] == b .shape [1 ])
2569+
2570+ def test_moments (self ):
2571+ m0 ,m1 ,m2 = igl .moments (self .v1 , self .f1 )
2572+
2573+ def test_path_to_edges (self ):
2574+ I = self .f1 [:,0 ]
2575+ e = igl .path_to_edges (I )
2576+ self .assertTrue (e .shape [1 ] == 2 )
2577+ self .assertTrue (e .shape [0 ] == I .shape [0 ]- 1 )
2578+
2579+
2580+ def test_copyleft (self ):
2581+ # check that type is <class 'module'>
2582+ self .assertTrue (type (igl .copyleft ) == type (igl ))
2583+
2584+ def test_triangle (self ):
2585+ # check that type is <class 'module'>
2586+ self .assertTrue (type (igl .copyleft ) == type (igl ))
2587+
2588+
2589+
25312590if __name__ == '__main__' :
25322591 unittest .main ()
0 commit comments