@@ -606,6 +606,67 @@ def udf_sphere(Q):
606606 unique_S = sdf_sphere (unique_corners )
607607 V ,F = igl .marching_cubes (unique_S ,unique_corners ,J ,0.0 )
608608
609+ def test_is_intrinsic_delaunay () -> None :
610+ # vs and fs come from a simple plane from pyvista
611+ # mesh = pv.Plane(i_resolution=3, j_resolution=2, i_size=2).triangulate()
612+ # fs = mesh._connectivity_array.reshape(-1, 3).astype(np.int32)
613+ # vs = mesh.points.astype(np.float64)
614+
615+ fs = np .array (
616+ [
617+ [0 , 1 , 4 ],
618+ [1 , 5 , 4 ],
619+ [1 , 2 , 5 ],
620+ [2 , 6 , 5 ],
621+ [2 , 3 , 6 ],
622+ [3 , 7 , 6 ],
623+ [4 , 5 , 8 ],
624+ [5 , 9 , 8 ],
625+ [5 , 6 , 9 ],
626+ [6 , 10 , 9 ],
627+ [6 , 7 , 10 ],
628+ [7 , 11 , 10 ],
629+ ]
630+ )
631+
632+ vs = np .array (
633+ [
634+ [- 1.0 , - 0.5 , 0.0 ],
635+ [- 0.33333334 , - 0.5 , 0.0 ],
636+ [0.33333334 , - 0.5 , 0.0 ],
637+ [1.0 , - 0.5 , 0.0 ],
638+ [- 1.0 , 0.0 , 0.0 ],
639+ [- 0.33333334 , 0.0 , 0.0 ],
640+ [0.33333334 , 0.0 , 0.0 ],
641+ [1.0 , 0.0 , 0.0 ],
642+ [- 1.0 , 0.5 , 0.0 ],
643+ [- 0.33333334 , 0.5 , 0.0 ],
644+ [0.33333334 , 0.5 , 0.0 ],
645+ [1.0 , 0.5 , 0.0 ],
646+ ]
647+ )
648+
649+ lin = igl .edge_lengths (vs , fs )
650+ mask = igl .is_intrinsic_delaunay (lin , fs ).astype (bool )
651+
652+ expected_mask = np .array (
653+ [
654+ [0 , 1 , 1 ],
655+ [1 , 0 , 1 ],
656+ [1 , 1 , 1 ],
657+ [1 , 1 , 1 ],
658+ [0 , 1 , 1 ],
659+ [1 , 0 , 1 ],
660+ [0 , 1 , 1 ],
661+ [1 , 0 , 1 ],
662+ [1 , 1 , 1 ],
663+ [1 , 1 , 1 ],
664+ [0 , 1 , 1 ],
665+ [1 , 0 , 1 ],
666+ ]
667+ )
668+ assert np .array_equal (mask , expected_mask )
669+
609670def test_rotate_vectors (icosahedron ):
610671 V ,F = icosahedron
611672
0 commit comments