@@ -10,11 +10,11 @@ def test_version():
1010 version = igl .__version__
1111 pass
1212
13+ import igl .triangle
1314import igl .copyleft
1415import igl .copyleft .tetgen
1516#import igl.copyleft.cgal
1617#import igl.embree
17- import igl .triangle
1818#
1919#
2020##def rand_sparse(n,density):
@@ -513,30 +513,30 @@ def test_version():
513513# hits = ei.intersectRay(origin,direction)
514514# hits = ei.intersectRay(origin,direction,tnear=0,tfar=1)
515515# I,C = igl.embree.reorient_facets_raycast(V,F)
516- #
517- # def test_tetgen():
518- # # octahedron
519- # V = np.array([[1,0,0],[0,1,0],[0,0,1],[-1,0,0],[0,-1,0],[0,0,-1]],dtype=np.float64)
520- # F = np.array([[0,1,2], [0,2,4], [0,4,5], [0,5,1], [1,3,2], [1,5,3], [2,3,4], [3,5,4]],dtype=np.int64)
521- # V,T,F,_,_,_,_,_,_ = igl.copyleft.tetgen.tetrahedralize(V,F,flags="Q")
522- #
523- # def test_triangle():
524- # V = np.array([[0,0],[1,0],[1,1],[0,1]],dtype=np.float64)
525- # E = np.array([[0,1],[1,2],[2,3],[3,0]],dtype=np.int64)
526- # V,F,_,_,_ = igl.triangle.triangulate(V,E,flags="Qc")
527- # V,F,_,_,_ = igl.triangle.triangulate(V,E,flags="Q")
528- # V,F,_,_,_ = igl.triangle.triangulate(V,E,flags="Qqa0.1")
529- # V = np.array([[0,0,0],[1,0,0],[0,1,0],[0,0,1]],dtype=np.float64)
530- # F = np.array([[1,3,0],[3,2,0],[2,3,1]],dtype=np.int64)
531- # scaf_data = igl.triangle.SCAFData()
532- # b = np.array([0,1,2],dtype=np.int64)
533- # bc = np.array([[0,0],[1,0],[0,1]],dtype=np.float64)
534- # V_init = np.array([[0,0],[1,0],[0,1],[0.1,0.1]],dtype=np.float64)
535- # soft_p = 0;
536- # igl.triangle.scaf_precompute(V,F,V_init,igl.ARAP,b,bc,soft_p,scaf_data)
537- # L,rhs = igl.triangle.scaf_system(scaf_data)
538- # U = igl.triangle.scaf_solve(1,scaf_data)
539- #
516+
517+ def test_tetgen ():
518+ # octahedron
519+ V = np .array ([[1 ,0 ,0 ],[0 ,1 ,0 ],[0 ,0 ,1 ],[- 1 ,0 ,0 ],[0 ,- 1 ,0 ],[0 ,0 ,- 1 ]],dtype = np .float64 )
520+ F = np .array ([[0 ,1 ,2 ], [0 ,2 ,4 ], [0 ,4 ,5 ], [0 ,5 ,1 ], [1 ,3 ,2 ], [1 ,5 ,3 ], [2 ,3 ,4 ], [3 ,5 ,4 ]],dtype = np .int64 )
521+ V ,T ,F ,_ ,_ ,_ ,_ ,_ ,_ = igl .copyleft .tetgen .tetrahedralize (V ,F ,flags = "Q" )
522+
523+ def test_triangle ():
524+ V = np .array ([[0 ,0 ],[1 ,0 ],[1 ,1 ],[0 ,1 ]],dtype = np .float64 )
525+ E = np .array ([[0 ,1 ],[1 ,2 ],[2 ,3 ],[3 ,0 ]],dtype = np .int64 )
526+ V ,F ,_ ,_ ,_ = igl .triangle .triangulate (V ,E ,flags = "Qc" )
527+ V ,F ,_ ,_ ,_ = igl .triangle .triangulate (V ,E ,flags = "Q" )
528+ V ,F ,_ ,_ ,_ = igl .triangle .triangulate (V ,E ,flags = "Qqa0.1" )
529+ V = np .array ([[0 ,0 ,0 ],[1 ,0 ,0 ],[0 ,1 ,0 ],[0 ,0 ,1 ]],dtype = np .float64 )
530+ F = np .array ([[1 ,3 ,0 ],[3 ,2 ,0 ],[2 ,3 ,1 ]],dtype = np .int64 )
531+ scaf_data = igl .triangle .SCAFData ()
532+ b = np .array ([0 ,1 ,2 ],dtype = np .int64 )
533+ bc = np .array ([[0 ,0 ],[1 ,0 ],[0 ,1 ]],dtype = np .float64 )
534+ V_init = np .array ([[0 ,0 ],[1 ,0 ],[0 ,1 ],[0.1 ,0.1 ]],dtype = np .float64 )
535+ soft_p = 0 ;
536+ igl .triangle .scaf_precompute (V ,F ,V_init ,igl .ARAP ,b ,bc ,soft_p ,scaf_data )
537+ L ,rhs = igl .triangle .scaf_system (scaf_data )
538+ U = igl .triangle .scaf_solve (1 ,scaf_data )
539+
540540#def test_misc():
541541# V,F = igl.icosahedron()
542542# BV,BF = igl.bounding_box(V,pad=1.0)
0 commit comments