@@ -227,21 +227,21 @@ class Triangulation(Element):
227
227
"""
228
228
def __init__ (self , triangulation , parent , check = True ):
229
229
"""
230
- The constructor of a ``Triangulation`` object. Note that an
231
- internal reference to the underlying ``PointConfiguration`` is
230
+ The constructor of a ``Triangulation`` object.
231
+
232
+ Note that an internal reference to the underlying ``PointConfiguration`` is
232
233
kept.
233
234
234
235
INPUT:
235
236
236
237
- ``parent`` -- a
237
238
:class:`~sage.geometry.triangulation.point_configuration.PointConfiguration`
238
239
239
- - ``triangulation`` -- an iterable of integers or iterable of
240
- iterables (e.g. a list of lists). In the first case, the
241
- integers specify simplices via
242
- :meth:`PointConfiguration.simplex_to_int`. In the second
243
- case, the point indices of the maximal simplices of the
244
- triangulation.
240
+ - ``triangulation`` -- an iterable of integers or an iterable of
241
+ iterables (e.g. a list of lists), specifying the maximal simplices
242
+ of the triangulation. In the first case, each integer specifies a simplex
243
+ by the correspondence :meth:`PointConfiguration.simplex_to_int`. In the second
244
+ case, a simplex is specified by listing the indices of the included points.
245
245
246
246
- ``check`` -- boolean. Whether to perform checks that the
247
247
triangulation is, indeed, a triangulation of the point
@@ -370,7 +370,7 @@ def __getitem__(self, i):
370
370
371
371
def __len__ (self ):
372
372
"""
373
- Returns the length of the triangulation.
373
+ Return the length of the triangulation.
374
374
375
375
TESTS::
376
376
@@ -572,8 +572,7 @@ def fan(self, origin=None):
572
572
@cached_method
573
573
def simplicial_complex (self ):
574
574
r"""
575
- Return a simplicial complex from a triangulation of the point
576
- configuration.
575
+ Return ``self`` as an (abstract) simplicial complex.
577
576
578
577
OUTPUT:
579
578
@@ -598,7 +597,7 @@ def simplicial_complex(self):
598
597
@cached_method
599
598
def _boundary_simplex_dictionary (self ):
600
599
"""
601
- Return facets and the simplices they bound
600
+ Return facets and the simplices they bound.
602
601
603
602
TESTS::
604
603
@@ -675,6 +674,38 @@ def boundary(self):
675
674
in self ._boundary_simplex_dictionary ().items ()
676
675
if len (bounded_simplices ) == 1 )
677
676
677
+ @cached_method
678
+ def boundary_simplicial_complex (self ):
679
+ r"""
680
+ Return the boundary of ``self`` as an (abstract) simplicial complex.
681
+
682
+ OUTPUT:
683
+
684
+ A :class:`~sage.topology.simplicial_complex.SimplicialComplex`.
685
+
686
+ EXAMPLES::
687
+
688
+ sage: p = polytopes.cuboctahedron()
689
+ sage: triangulation = p.triangulate(engine='internal')
690
+ sage: bd_sc = triangulation.boundary_simplicial_complex()
691
+ sage: bd_sc
692
+ Simplicial complex with 12 vertices and 20 facets
693
+
694
+ The boundary of every convex set is a topological sphere, so it has
695
+ spherical homology::
696
+
697
+ sage: bd_sc.homology()
698
+ {0: 0, 1: 0, 2: Z}
699
+
700
+ It is a subcomplex of ``self`` as a :meth:`simplicial_complex`::
701
+
702
+ sage: sc = triangulation.simplicial_complex()
703
+ sage: all(f in sc for f in bd_sc.maximal_faces())
704
+ True
705
+ """
706
+ from sage .topology .simplicial_complex import SimplicialComplex
707
+ return SimplicialComplex (self .boundary (), maximality_check = False )
708
+
678
709
@cached_method
679
710
def interior_facets (self ):
680
711
"""
@@ -711,6 +742,90 @@ def interior_facets(self):
711
742
in self ._boundary_simplex_dictionary ().items ()
712
743
if len (bounded_simplices ) == 2 )
713
744
745
+ def polyhedral_complex (self , ** kwds ):
746
+ """
747
+ Return ``self`` as a :class:`~sage.geometry.polyhedral_complex.PolyhedralComplex`.
748
+
749
+ OUTPUT:
750
+
751
+ A :class:`~sage.geometry.polyhedral_complex.PolyhedralComplex` whose maximal cells
752
+ are the simplices of the triangulation.
753
+
754
+ EXAMPLES::
755
+
756
+ sage: P = polytopes.cube()
757
+ sage: pc = PointConfiguration(P.vertices())
758
+ sage: T = pc.placing_triangulation(); T
759
+ (<0,1,2,7>, <0,1,5,7>, <0,2,3,7>, <0,3,4,7>, <0,4,5,7>, <1,5,6,7>)
760
+ sage: C = T.polyhedral_complex(); C
761
+ Polyhedral complex with 6 maximal cells
762
+ sage: [P.vertices_list() for P in C.maximal_cells_sorted()]
763
+ [[[-1, -1, -1], [-1, -1, 1], [-1, 1, 1], [1, -1, -1]],
764
+ [[-1, -1, -1], [-1, 1, -1], [-1, 1, 1], [1, 1, -1]],
765
+ [[-1, -1, -1], [-1, 1, 1], [1, -1, -1], [1, 1, -1]],
766
+ [[-1, -1, 1], [-1, 1, 1], [1, -1, -1], [1, -1, 1]],
767
+ [[-1, 1, 1], [1, -1, -1], [1, -1, 1], [1, 1, 1]],
768
+ [[-1, 1, 1], [1, -1, -1], [1, 1, -1], [1, 1, 1]]]
769
+ """
770
+ from sage .geometry .polyhedral_complex import PolyhedralComplex
771
+ from sage .geometry .polyhedron .constructor import Polyhedron
772
+ ambient_dim = self .point_configuration ().ambient_dim ()
773
+ points = self .point_configuration ().points ()
774
+ return PolyhedralComplex ([Polyhedron (vertices = [points [i ] for i in simplex ])
775
+ for simplex in self ],
776
+ ambient_dim = ambient_dim ,
777
+ maximality_check = False ,
778
+ face_to_face_check = False ,
779
+ ** kwds )
780
+
781
+ def boundary_polyhedral_complex (self , ** kwds ):
782
+ r"""
783
+ Return the boundary of ``self`` as a :class:`~sage.geometry.polyhedral_complex.PolyhedralComplex`.
784
+
785
+ OUTPUT:
786
+
787
+ A :class:`~sage.geometry.polyhedral_complex.PolyhedralComplex` whose maximal cells
788
+ are the simplices of the boundary of ``self``.
789
+
790
+ EXAMPLES::
791
+
792
+ sage: P = polytopes.cube()
793
+ sage: pc = PointConfiguration(P.vertices())
794
+ sage: T = pc.placing_triangulation(); T
795
+ (<0,1,2,7>, <0,1,5,7>, <0,2,3,7>, <0,3,4,7>, <0,4,5,7>, <1,5,6,7>)
796
+ sage: bd_C = T.boundary_polyhedral_complex(); bd_C
797
+ Polyhedral complex with 12 maximal cells
798
+ sage: [P.vertices_list() for P in bd_C.maximal_cells_sorted()]
799
+ [[[-1, -1, -1], [-1, -1, 1], [-1, 1, 1]],
800
+ [[-1, -1, -1], [-1, -1, 1], [1, -1, -1]],
801
+ [[-1, -1, -1], [-1, 1, -1], [-1, 1, 1]],
802
+ [[-1, -1, -1], [-1, 1, -1], [1, 1, -1]],
803
+ [[-1, -1, -1], [1, -1, -1], [1, 1, -1]],
804
+ [[-1, -1, 1], [-1, 1, 1], [1, -1, 1]],
805
+ [[-1, -1, 1], [1, -1, -1], [1, -1, 1]],
806
+ [[-1, 1, -1], [-1, 1, 1], [1, 1, -1]],
807
+ [[-1, 1, 1], [1, -1, 1], [1, 1, 1]],
808
+ [[-1, 1, 1], [1, 1, -1], [1, 1, 1]],
809
+ [[1, -1, -1], [1, -1, 1], [1, 1, 1]],
810
+ [[1, -1, -1], [1, 1, -1], [1, 1, 1]]]
811
+
812
+ It is a subcomplex of ``self`` as a :meth:`polyhedral_complex`::
813
+
814
+ sage: C = T.polyhedral_complex()
815
+ sage: bd_C.is_subcomplex(C)
816
+ True
817
+ """
818
+ from sage .geometry .polyhedral_complex import PolyhedralComplex
819
+ from sage .geometry .polyhedron .constructor import Polyhedron
820
+ ambient_dim = self .point_configuration ().ambient_dim ()
821
+ points = self .point_configuration ().points ()
822
+ return PolyhedralComplex ([Polyhedron (vertices = [points [i ] for i in simplex ])
823
+ for simplex in self .boundary ()],
824
+ ambient_dim = ambient_dim ,
825
+ maximality_check = False ,
826
+ face_to_face_check = False ,
827
+ ** kwds )
828
+
714
829
@cached_method
715
830
def normal_cone (self ):
716
831
r"""
@@ -798,8 +913,7 @@ def normal_cone(self):
798
913
799
914
def adjacency_graph (self ):
800
915
"""
801
- Returns a graph showing which simplices are adjacent in the
802
- triangulation
916
+ Return a graph showing which simplices are adjacent in the triangulation.
803
917
804
918
OUTPUT:
805
919
0 commit comments