@@ -76,7 +76,7 @@ def test_cotmatrix(self):
7676 self .assertTrue (l .shape == (self .v .shape [0 ], self .v .shape [0 ]))
7777 self .assertTrue (l .dtype == self .v .dtype )
7878 self .assertTrue (type (l ) == csc .csc_matrix )
79-
79+
8080 def test_cotmatrix_intrinsic (self ):
8181 el = igl .edge_lengths (self .v , self .f )
8282 l = igl .cotmatrix_intrinsic (el , self .f )
@@ -1578,22 +1578,22 @@ def test_delaunay_triangulation(self):
15781578 self .assertTrue (f .flags .c_contiguous )
15791579 self .assertTrue (f .dtype == self .f .dtype )
15801580 self .assertTrue (f .shape [1 ] == 3 )
1581-
1581+
15821582 def test_is_delaunay (self ):
15831583 v = np .array ([[0.0 , 0.0 ], [1.0 , 0.0 ], [1.0 , 1.0 ], [0 , 0 ], [0 , - 1 ]])
15841584 f = igl .delaunay_triangulation (v )
15851585 d = igl .is_delaunay (v , f )
15861586 self .assertTrue (d .flags .c_contiguous )
15871587 self .assertTrue (d .dtype == np .bool )
15881588 self .assertTrue (d .shape == f .shape )
1589- self .assertTrue (np .all (d ))
1590-
1589+ self .assertTrue (np .all (d ))
1590+
15911591 d1 = igl .is_delaunay (self .v1 , self .f1 )
15921592 self .assertTrue (d1 .flags .c_contiguous )
15931593 self .assertTrue (d1 .dtype == np .bool )
15941594 self .assertTrue (d1 .shape == self .f1 .shape )
1595- self .assertFalse (np .all (d1 ))
1596-
1595+ self .assertFalse (np .all (d1 ))
1596+
15971597
15981598 v = np .hstack ([v , np .zeros ((v .shape [0 ], 1 ))])
15991599 el = igl .edge_lengths (v , f )
@@ -1605,14 +1605,14 @@ def test_is_delaunay(self):
16051605
16061606 def test_is_intrinsic_delaunay (self ):
16071607 # Tested above
1608- pass
1608+ pass
16091609
16101610 def test_intrinsic_delaunay_triangulation (self ):
1611- el = igl .edge_lengths (self .v , self .f )
1612- l , f = igl .intrinsic_delaunay_triangulation (el , self .f )
1613- print (l , f )
1611+ el = igl .edge_lengths (self .v1 , self .f1 )
1612+ l , f = igl .intrinsic_delaunay_triangulation (el , self .f1 )
1613+ # print(l, f)
16141614 self .assertTrue (f .flags .c_contiguous )
1615- self .assertTrue (f .dtype == self .f .dtype )
1615+ self .assertTrue (f .dtype == self .f1 .dtype )
16161616 self .assertTrue (f .shape [1 ] == 3 )
16171617
16181618 def test_intrinsic_delaunay_triangulation_edges (self ):
@@ -1634,7 +1634,7 @@ def test_edges_to_path(self):
16341634 self .assertTrue (i .dtype == e .dtype )
16351635 self .assertTrue (j .dtype == e .dtype )
16361636 self .assertTrue (k .dtype == e .dtype )
1637-
1637+
16381638 def test_path_to_edges (self ):
16391639 e1 = igl .path_to_edges (np .array (range (20 )), False )
16401640 e2 = igl .path_to_edges (np .array (range (20 )), True )
@@ -1801,17 +1801,17 @@ def test_volume(self):
18011801
18021802
18031803 vol = igl .volume_single (a [0 , :], b [0 , :], c [0 , :], d [0 , :])
1804-
1804+
18051805 l = igl .edge_lengths (v , t )
18061806 vol = igl .volume_from_edges (l )
18071807 self .assertTrue (vol .flags .c_contiguous )
18081808 self .assertTrue (vol .dtype == v .dtype )
18091809 self .assertTrue (len (vol .shape ) == 1 )
18101810 self .assertTrue (vol .shape [0 ] == t .shape [0 ])
1811-
1811+
18121812 def test_volume_from_edges (self ):
18131813 #tested in volume
1814- pass
1814+ pass
18151815
18161816 def test_volume_from_vertices (self ):
18171817 #tested in volume
@@ -2114,7 +2114,7 @@ def test_connected_components(self):
21142114 self .assertTrue (k .dtype == self .f1 .dtype )
21152115
21162116 self .assertTrue (c .shape [0 ] == a .shape [0 ])
2117-
2117+
21182118 def test_pso (self ):
21192119 def banana (x ):
21202120 x1 = x [0 ]
@@ -2125,7 +2125,7 @@ def banana(x):
21252125 ub = np .array ([2.0 , 6.0 ])
21262126
21272127 fopt , xopt = igl .pso (banana , lb , ub , max_iters = 10 , population = 10 )
2128-
2128+
21292129 self .assertTrue (xopt .flags .c_contiguous )
21302130 self .assertTrue (xopt .dtype == lb .dtype )
21312131 self .assertTrue (xopt .shape == (2 , ))
@@ -2140,11 +2140,11 @@ def banana(x):
21402140 ub = np .array ([2.0 , 6.0 ])
21412141
21422142 fopt , xopt = igl .random_search (banana , lb , ub , iters = 10 )
2143-
2143+
21442144 self .assertTrue (xopt .flags .c_contiguous )
21452145 self .assertTrue (xopt .dtype == lb .dtype )
2146- self .assertTrue (xopt .shape == (2 , ))
2147-
2146+ self .assertTrue (xopt .shape == (2 , ))
2147+
21482148 def test_bijective_composite_harmonic_mapping (self ):
21492149 v , f , _ = igl .read_off (os .path .join (self .test_path , "camelhead.off" ))
21502150 b = igl .boundary_loop (f )
@@ -2155,43 +2155,43 @@ def test_bijective_composite_harmonic_mapping(self):
21552155 self .assertTrue (ret0 )
21562156 self .assertTrue (mapping0 .flags .c_contiguous )
21572157 self .assertTrue (mapping0 .dtype == v2d .dtype )
2158- self .assertTrue (mapping0 .shape == v2d .shape )
2159-
2158+ self .assertTrue (mapping0 .shape == v2d .shape )
2159+
21602160 ret1 , mapping1 = igl .bijective_composite_harmonic_mapping_with_steps (v2d , f , b , bc , min_steps = 1 , max_steps = 5 , num_inner_iters = 2 , test_for_flips = True )
21612161 self .assertTrue (ret1 )
21622162 self .assertTrue (mapping1 .flags .c_contiguous )
21632163 self .assertTrue (mapping1 .dtype == v2d .dtype )
2164- self .assertTrue (mapping1 .shape == v2d .shape )
2165-
2164+ self .assertTrue (mapping1 .shape == v2d .shape )
2165+
21662166 ret2 , mapping2 = igl .bijective_composite_harmonic_mapping_with_steps (v2d , f , b , bc , min_steps = 1 , max_steps = 5 , num_inner_iters = 2 , test_for_flips = False )
21672167 self .assertTrue (ret2 )
21682168 self .assertTrue (mapping2 .flags .c_contiguous )
21692169 self .assertTrue (mapping2 .dtype == v2d .dtype )
21702170 self .assertTrue (mapping2 .shape == v2d .shape )
2171-
2171+
21722172 self .assertTrue (np .allclose (mapping0 , mapping1 ))
21732173
21742174 def test_bijective_composite_harmonic_mapping_with_steps (self ):
21752175 # Tested above
21762176 pass
2177-
2177+
21782178 def test_extract_non_manifold_edge_curves (self ):
21792179 _ = igl .extract_non_manifold_edge_curves (self .f1 , [])
21802180 curves = igl .extract_non_manifold_edge_curves (self .f1 , [range (10 )])
21812181 self .assertTrue (len (curves ) == 1 )
21822182 self .assertTrue (curves [0 ][0 ] == 0 )
2183-
2183+
21842184 def test_intrinsic_delaunay_cotmatrix (self ):
2185- l , l_int , f_int = igl .intrinsic_delaunay_cotmatrix (self .v , self .f )
2186- print (l .shape , l_lint .shape , f_int .shape )
2187- self .assertTrue (l .shape == (self .v .shape [0 ], self .v .shape [0 ]))
2188- self .assertTrue (l .dtype == self .v .dtype )
2185+ l , l_int , f_int = igl .intrinsic_delaunay_cotmatrix (self .v1 , self .f1 )
2186+ # print(l.shape, l_int .shape, f_int.shape)
2187+ self .assertTrue (l .shape == (self .v1 .shape [0 ], self .v1 .shape [0 ]))
2188+ self .assertTrue (l .dtype == self .v1 .dtype )
21892189 self .assertTrue (type (l ) == csc .csc_matrix )
2190-
2190+
21912191 def test_cut_to_disk (self ):
21922192 cuts = igl .cut_to_disk (self .f )
21932193 self .assertTrue (len (cuts ) == 9 )
2194-
2194+
21952195 def test_iterative_closest_point (self ):
21962196 # This crashes in libigl
21972197 #r, t = igl.iterative_closest_point(self.v, self.f, self.v1, self.f1, 10, 20)
@@ -2223,22 +2223,22 @@ def test_quad_grid(self):
22232223 self .assertTrue (v .dtype == np .float )
22242224 self .assertTrue (q .dtype == np .int )
22252225 self .assertTrue (e .dtype == np .int )
2226-
2226+
22272227 def test_flip_avoiding_line_search (self ):
22282228 #def fun(v):
22292229 # return 0.5
22302230 #energy, vr = igl.flip_avoiding_line_search(self.f1, self.v1, -self.v1, fun, 10.0)
22312231 # TODO: fix function assertion fail
22322232 pass
2233-
2233+
22342234 def test_circulation (self ):
22352235 pass
22362236 # difficult data
22372237 # _, e, emap = igl.crouzeix_raviart_cotmatrix(self.v1, self.f1)
22382238 # ret = igl.circulation(0, False, emap, e, e)
22392239 # self.assertTrue(type(ret) == list)
22402240 # self.assertTrue(type(ret[0]) == int)
2241-
2241+
22422242 def test_edge_collapse_is_valid (self ):
22432243 # Dummy test
22442244 pass
0 commit comments