# A triangulation#

In Sage, the PointConfiguration and Triangulation satisfy a parent/element relationship. In particular, each triangulation refers back to its point configuration. If you want to triangulate a point configuration, you should construct a point configuration first and then use one of its methods to triangulate it according to your requirements. You should never have to construct a Triangulation object directly.

EXAMPLES:

First, we select the internal implementation for enumerating triangulations:

sage: PointConfiguration.set_engine('internal')   # to make doctests independent of TOPCOM

>>> from sage.all import *
>>> PointConfiguration.set_engine('internal')   # to make doctests independent of TOPCOM


Here is a simple example of how to triangulate a point configuration:

sage: p = [[0,-1,-1],[0,0,1],[0,1,0], [1,-1,-1],[1,0,1],[1,1,0]]
sage: points = PointConfiguration(p)
sage: triang = points.triangulate();  triang
(<0,1,2,5>, <0,1,3,5>, <1,3,4,5>)
sage: triang.plot(axes=False)                                                       # needs sage.plot
Graphics3d Object

>>> from sage.all import *
>>> p = [[Integer(0),-Integer(1),-Integer(1)],[Integer(0),Integer(0),Integer(1)],[Integer(0),Integer(1),Integer(0)], [Integer(1),-Integer(1),-Integer(1)],[Integer(1),Integer(0),Integer(1)],[Integer(1),Integer(1),Integer(0)]]
>>> points = PointConfiguration(p)
>>> triang = points.triangulate();  triang
(<0,1,2,5>, <0,1,3,5>, <1,3,4,5>)
>>> triang.plot(axes=False)                                                       # needs sage.plot
Graphics3d Object


See sage.geometry.triangulation.point_configuration for more details.

class sage.geometry.triangulation.element.Triangulation(triangulation, parent, check=True)[source]#

Bases: Element

A triangulation of a PointConfiguration.

Warning

You should never create Triangulation objects manually. See triangulate() and triangulations() to triangulate point configurations.

Return a graph showing which simplices are adjacent in the triangulation.

OUTPUT:

A graph consisting of vertices referring to the simplices in the triangulation, and edges showing which simplices are adjacent to each other.

AUTHORS:

• Stephen Farley (2013-08-10): initial version

EXAMPLES:

sage: p = PointConfiguration([[1,0,0], [0,1,0], [0,0,1], [-1,0,1],
....:                         [1,0,-1], [-1,0,0], [0,-1,0], [0,0,-1]])
sage: t = p.triangulate()
sage: t.adjacency_graph()                                                   # needs sage.graphs
Graph on 8 vertices

>>> from sage.all import *
>>> p = PointConfiguration([[Integer(1),Integer(0),Integer(0)], [Integer(0),Integer(1),Integer(0)], [Integer(0),Integer(0),Integer(1)], [-Integer(1),Integer(0),Integer(1)],
...                         [Integer(1),Integer(0),-Integer(1)], [-Integer(1),Integer(0),Integer(0)], [Integer(0),-Integer(1),Integer(0)], [Integer(0),Integer(0),-Integer(1)]])
>>> t = p.triangulate()
>>> t.adjacency_graph()                                                   # needs sage.graphs
Graph on 8 vertices

boundary()[source]#

Return the boundary of the triangulation.

OUTPUT:

The outward-facing boundary simplices (of dimension $$d-1$$) of the $$d$$-dimensional triangulation as a set. Each boundary is returned by a tuple of point indices.

EXAMPLES:

sage: triangulation = polytopes.cube().triangulate(engine='internal')
sage: triangulation
(<0,1,2,7>, <0,1,5,7>, <0,2,3,7>, <0,3,4,7>, <0,4,5,7>, <1,5,6,7>)
sage: triangulation.boundary()
frozenset({(0, 1, 2),
(0, 1, 5),
(0, 2, 3),
(0, 3, 4),
(0, 4, 5),
(1, 2, 7),
(1, 5, 6),
(1, 6, 7),
(2, 3, 7),
(3, 4, 7),
(4, 5, 7),
(5, 6, 7)})
sage: triangulation.interior_facets()
frozenset({(0, 1, 7), (0, 2, 7), (0, 3, 7), (0, 4, 7), (0, 5, 7), (1, 5, 7)})

>>> from sage.all import *
>>> triangulation = polytopes.cube().triangulate(engine='internal')
>>> triangulation
(<0,1,2,7>, <0,1,5,7>, <0,2,3,7>, <0,3,4,7>, <0,4,5,7>, <1,5,6,7>)
>>> triangulation.boundary()
frozenset({(0, 1, 2),
(0, 1, 5),
(0, 2, 3),
(0, 3, 4),
(0, 4, 5),
(1, 2, 7),
(1, 5, 6),
(1, 6, 7),
(2, 3, 7),
(3, 4, 7),
(4, 5, 7),
(5, 6, 7)})
>>> triangulation.interior_facets()
frozenset({(0, 1, 7), (0, 2, 7), (0, 3, 7), (0, 4, 7), (0, 5, 7), (1, 5, 7)})

boundary_polyhedral_complex(**kwds)[source]#

Return the boundary of self as a PolyhedralComplex.

OUTPUT:

A PolyhedralComplex whose maximal cells are the simplices of the boundary of self.

EXAMPLES:

sage: P = polytopes.cube()
sage: pc = PointConfiguration(P.vertices())
sage: T = pc.placing_triangulation(); T
(<0,1,2,7>, <0,1,5,7>, <0,2,3,7>, <0,3,4,7>, <0,4,5,7>, <1,5,6,7>)
sage: bd_C = T.boundary_polyhedral_complex(); bd_C                          # needs sage.graphs
Polyhedral complex with 12 maximal cells
sage: [P.vertices_list() for P in bd_C.maximal_cells_sorted()]              # needs sage.graphs
[[[-1, -1, -1], [-1, -1, 1], [-1, 1, 1]],
[[-1, -1, -1], [-1, -1, 1], [1, -1, -1]],
[[-1, -1, -1], [-1, 1, -1], [-1, 1, 1]],
[[-1, -1, -1], [-1, 1, -1], [1, 1, -1]],
[[-1, -1, -1], [1, -1, -1], [1, 1, -1]],
[[-1, -1, 1], [-1, 1, 1], [1, -1, 1]],
[[-1, -1, 1], [1, -1, -1], [1, -1, 1]],
[[-1, 1, -1], [-1, 1, 1], [1, 1, -1]],
[[-1, 1, 1], [1, -1, 1], [1, 1, 1]],
[[-1, 1, 1], [1, 1, -1], [1, 1, 1]],
[[1, -1, -1], [1, -1, 1], [1, 1, 1]],
[[1, -1, -1], [1, 1, -1], [1, 1, 1]]]

>>> from sage.all import *
>>> P = polytopes.cube()
>>> pc = PointConfiguration(P.vertices())
>>> T = pc.placing_triangulation(); T
(<0,1,2,7>, <0,1,5,7>, <0,2,3,7>, <0,3,4,7>, <0,4,5,7>, <1,5,6,7>)
>>> bd_C = T.boundary_polyhedral_complex(); bd_C                          # needs sage.graphs
Polyhedral complex with 12 maximal cells
>>> [P.vertices_list() for P in bd_C.maximal_cells_sorted()]              # needs sage.graphs
[[[-1, -1, -1], [-1, -1, 1], [-1, 1, 1]],
[[-1, -1, -1], [-1, -1, 1], [1, -1, -1]],
[[-1, -1, -1], [-1, 1, -1], [-1, 1, 1]],
[[-1, -1, -1], [-1, 1, -1], [1, 1, -1]],
[[-1, -1, -1], [1, -1, -1], [1, 1, -1]],
[[-1, -1, 1], [-1, 1, 1], [1, -1, 1]],
[[-1, -1, 1], [1, -1, -1], [1, -1, 1]],
[[-1, 1, -1], [-1, 1, 1], [1, 1, -1]],
[[-1, 1, 1], [1, -1, 1], [1, 1, 1]],
[[-1, 1, 1], [1, 1, -1], [1, 1, 1]],
[[1, -1, -1], [1, -1, 1], [1, 1, 1]],
[[1, -1, -1], [1, 1, -1], [1, 1, 1]]]


It is a subcomplex of self as a polyhedral_complex():

sage: C = T.polyhedral_complex()                                            # needs sage.graphs
sage: bd_C.is_subcomplex(C)                                                 # needs sage.graphs
True

>>> from sage.all import *
>>> C = T.polyhedral_complex()                                            # needs sage.graphs
>>> bd_C.is_subcomplex(C)                                                 # needs sage.graphs
True

boundary_simplicial_complex()[source]#

Return the boundary of self as an (abstract) simplicial complex.

OUTPUT:

EXAMPLES:

sage: p = polytopes.cuboctahedron()
sage: triangulation = p.triangulate(engine='internal')
sage: bd_sc = triangulation.boundary_simplicial_complex(); bd_sc            # needs sage.graphs
Simplicial complex with 12 vertices and 20 facets

>>> from sage.all import *
>>> p = polytopes.cuboctahedron()
>>> triangulation = p.triangulate(engine='internal')
>>> bd_sc = triangulation.boundary_simplicial_complex(); bd_sc            # needs sage.graphs
Simplicial complex with 12 vertices and 20 facets


The boundary of every convex set is a topological sphere, so it has spherical homology:

sage: bd_sc.homology()                                                      # needs sage.graphs
{0: 0, 1: 0, 2: Z}

>>> from sage.all import *
>>> bd_sc.homology()                                                      # needs sage.graphs
{0: 0, 1: 0, 2: Z}


It is a subcomplex of self as a simplicial_complex():

sage: sc = triangulation.simplicial_complex()                               # needs sage.graphs
sage: all(f in sc for f in bd_sc.maximal_faces())                           # needs sage.graphs
True

>>> from sage.all import *
>>> sc = triangulation.simplicial_complex()                               # needs sage.graphs
>>> all(f in sc for f in bd_sc.maximal_faces())                           # needs sage.graphs
True

enumerate_simplices()[source]#

Return the enumerated simplices.

OUTPUT:

A tuple of integers that uniquely specifies the triangulation.

EXAMPLES:

sage: pc = PointConfiguration(matrix([
....:    [ 0, 0, 0, 0, 0, 2, 4,-1, 1, 1, 0, 0, 1, 0],
....:    [ 0, 0, 0, 1, 0, 0,-1, 0, 0, 0, 0, 0, 0, 0],
....:    [ 0, 2, 0, 0, 0, 0,-1, 0, 1, 0, 1, 0, 0, 1],
....:    [ 0, 1, 1, 0, 0, 1, 0,-2, 1, 0, 0,-1, 1, 1],
....:    [ 0, 0, 0, 0, 1, 0,-1, 0, 0, 0, 0, 0, 0, 0]
....: ]).columns())
sage: triangulation = pc.lexicographic_triangulation()
sage: triangulation.enumerate_simplices()
(1678, 1688, 1769, 1779, 1895, 1905, 2112, 2143, 2234, 2360, 2555, 2580,
2610, 2626, 2650, 2652, 2654, 2661, 2663, 2667, 2685, 2755, 2757, 2759,
2766, 2768, 2772, 2811, 2881, 2883, 2885, 2892, 2894, 2898)

>>> from sage.all import *
>>> pc = PointConfiguration(matrix([
...    [ Integer(0), Integer(0), Integer(0), Integer(0), Integer(0), Integer(2), Integer(4),-Integer(1), Integer(1), Integer(1), Integer(0), Integer(0), Integer(1), Integer(0)],
...    [ Integer(0), Integer(0), Integer(0), Integer(1), Integer(0), Integer(0),-Integer(1), Integer(0), Integer(0), Integer(0), Integer(0), Integer(0), Integer(0), Integer(0)],
...    [ Integer(0), Integer(2), Integer(0), Integer(0), Integer(0), Integer(0),-Integer(1), Integer(0), Integer(1), Integer(0), Integer(1), Integer(0), Integer(0), Integer(1)],
...    [ Integer(0), Integer(1), Integer(1), Integer(0), Integer(0), Integer(1), Integer(0),-Integer(2), Integer(1), Integer(0), Integer(0),-Integer(1), Integer(1), Integer(1)],
...    [ Integer(0), Integer(0), Integer(0), Integer(0), Integer(1), Integer(0),-Integer(1), Integer(0), Integer(0), Integer(0), Integer(0), Integer(0), Integer(0), Integer(0)]
... ]).columns())
>>> triangulation = pc.lexicographic_triangulation()
>>> triangulation.enumerate_simplices()
(1678, 1688, 1769, 1779, 1895, 1905, 2112, 2143, 2234, 2360, 2555, 2580,
2610, 2626, 2650, 2652, 2654, 2661, 2663, 2667, 2685, 2755, 2757, 2759,
2766, 2768, 2772, 2811, 2881, 2883, 2885, 2892, 2894, 2898)


You can recreate the triangulation from this list by passing it to the constructor:

sage: from sage.geometry.triangulation.point_configuration import Triangulation
sage: Triangulation([1678, 1688, 1769, 1779, 1895, 1905, 2112, 2143,
....:  2234, 2360, 2555, 2580, 2610, 2626, 2650, 2652, 2654, 2661, 2663,
....:  2667, 2685, 2755, 2757, 2759, 2766, 2768, 2772, 2811, 2881, 2883,
....:  2885, 2892, 2894, 2898], pc)
(<1,3,4,7,10,13>, <1,3,4,8,10,13>, <1,3,6,7,10,13>, <1,3,6,8,10,13>,
<1,4,6,7,10,13>, <1,4,6,8,10,13>, <2,3,4,6,7,12>, <2,3,4,7,12,13>,
<2,3,6,7,12,13>, <2,4,6,7,12,13>, <3,4,5,6,9,12>, <3,4,5,8,9,12>,
<3,4,6,7,11,12>, <3,4,6,9,11,12>, <3,4,7,10,11,13>, <3,4,7,11,12,13>,
<3,4,8,9,10,12>, <3,4,8,10,12,13>, <3,4,9,10,11,12>, <3,4,10,11,12,13>,
<3,5,6,8,9,12>, <3,6,7,10,11,13>, <3,6,7,11,12,13>, <3,6,8,9,10,12>,
<3,6,8,10,12,13>, <3,6,9,10,11,12>, <3,6,10,11,12,13>, <4,5,6,8,9,12>,
<4,6,7,10,11,13>, <4,6,7,11,12,13>, <4,6,8,9,10,12>, <4,6,8,10,12,13>,
<4,6,9,10,11,12>, <4,6,10,11,12,13>)

>>> from sage.all import *
>>> from sage.geometry.triangulation.point_configuration import Triangulation
>>> Triangulation([Integer(1678), Integer(1688), Integer(1769), Integer(1779), Integer(1895), Integer(1905), Integer(2112), Integer(2143),
...  Integer(2234), Integer(2360), Integer(2555), Integer(2580), Integer(2610), Integer(2626), Integer(2650), Integer(2652), Integer(2654), Integer(2661), Integer(2663),
...  Integer(2667), Integer(2685), Integer(2755), Integer(2757), Integer(2759), Integer(2766), Integer(2768), Integer(2772), Integer(2811), Integer(2881), Integer(2883),
...  Integer(2885), Integer(2892), Integer(2894), Integer(2898)], pc)
(<1,3,4,7,10,13>, <1,3,4,8,10,13>, <1,3,6,7,10,13>, <1,3,6,8,10,13>,
<1,4,6,7,10,13>, <1,4,6,8,10,13>, <2,3,4,6,7,12>, <2,3,4,7,12,13>,
<2,3,6,7,12,13>, <2,4,6,7,12,13>, <3,4,5,6,9,12>, <3,4,5,8,9,12>,
<3,4,6,7,11,12>, <3,4,6,9,11,12>, <3,4,7,10,11,13>, <3,4,7,11,12,13>,
<3,4,8,9,10,12>, <3,4,8,10,12,13>, <3,4,9,10,11,12>, <3,4,10,11,12,13>,
<3,5,6,8,9,12>, <3,6,7,10,11,13>, <3,6,7,11,12,13>, <3,6,8,9,10,12>,
<3,6,8,10,12,13>, <3,6,9,10,11,12>, <3,6,10,11,12,13>, <4,5,6,8,9,12>,
<4,6,7,10,11,13>, <4,6,7,11,12,13>, <4,6,8,9,10,12>, <4,6,8,10,12,13>,
<4,6,9,10,11,12>, <4,6,10,11,12,13>)

fan(origin=None)[source]#

Construct the fan of cones over the simplices of the triangulation.

INPUT:

• originNone (default) or coordinates of a point. The common apex of all cones of the fan. If None, the triangulation must be a star triangulation and the distinguished central point is used as the origin.

OUTPUT:

A RationalPolyhedralFan. The coordinates of the points are shifted so that the apex of the fan is the origin of the coordinate system.

Note

If the set of cones over the simplices is not a fan, a suitable exception is raised.

EXAMPLES:

sage: pc = PointConfiguration([(0,0), (1,0), (0,1), (-1,-1)], star=0, fine=True)
sage: triangulation = pc.triangulate()
sage: fan = triangulation.fan(); fan
Rational polyhedral fan in 2-d lattice N
sage: fan.is_equivalent(toric_varieties.P2().fan())                         # needs palp sage.graphs
True

>>> from sage.all import *
>>> pc = PointConfiguration([(Integer(0),Integer(0)), (Integer(1),Integer(0)), (Integer(0),Integer(1)), (-Integer(1),-Integer(1))], star=Integer(0), fine=True)
>>> triangulation = pc.triangulate()
>>> fan = triangulation.fan(); fan
Rational polyhedral fan in 2-d lattice N
>>> fan.is_equivalent(toric_varieties.P2().fan())                         # needs palp sage.graphs
True


Toric diagrams (the $$\ZZ_5$$ hyperconifold):

sage: vertices=[(0, 1, 0), (0, 3, 1), (0, 2, 3), (0, 0, 2)]
sage: interior=[(0, 1, 1), (0, 1, 2), (0, 2, 1), (0, 2, 2)]
sage: points = vertices + interior
sage: pc = PointConfiguration(points, fine=True)
sage: triangulation = pc.triangulate()
sage: fan = triangulation.fan((-1,0,0)); fan
Rational polyhedral fan in 3-d lattice N
sage: fan.rays()
N(1, 1, 0),
N(1, 3, 1),
N(1, 2, 3),
N(1, 0, 2),
N(1, 1, 1),
N(1, 1, 2),
N(1, 2, 1),
N(1, 2, 2)
in 3-d lattice N

>>> from sage.all import *
>>> vertices=[(Integer(0), Integer(1), Integer(0)), (Integer(0), Integer(3), Integer(1)), (Integer(0), Integer(2), Integer(3)), (Integer(0), Integer(0), Integer(2))]
>>> interior=[(Integer(0), Integer(1), Integer(1)), (Integer(0), Integer(1), Integer(2)), (Integer(0), Integer(2), Integer(1)), (Integer(0), Integer(2), Integer(2))]
>>> points = vertices + interior
>>> pc = PointConfiguration(points, fine=True)
>>> triangulation = pc.triangulate()
>>> fan = triangulation.fan((-Integer(1),Integer(0),Integer(0))); fan
Rational polyhedral fan in 3-d lattice N
>>> fan.rays()
N(1, 1, 0),
N(1, 3, 1),
N(1, 2, 3),
N(1, 0, 2),
N(1, 1, 1),
N(1, 1, 2),
N(1, 2, 1),
N(1, 2, 2)
in 3-d lattice N

gkz_phi()[source]#

Calculate the GKZ phi vector of the triangulation.

The phi vector is a vector of length equals to the number of points in the point configuration. For a fixed triangulation $$T$$, the entry corresponding to the $$i$$-th point $$p_i$$ is

$\phi_T(p_i) = \sum_{t\in T, t\owns p_i} Vol(t)$

that is, the total volume of all simplices containing $$p_i$$. See also [GKZ1994] page 220 equation 1.4.

OUTPUT:

The phi vector of self.

EXAMPLES:

sage: p = PointConfiguration([[0,0],[1,0],[2,1],[1,2],[0,1]])
sage: p.triangulate().gkz_phi()
(3, 1, 5, 2, 4)
sage: p.lexicographic_triangulation().gkz_phi()
(1, 3, 4, 2, 5)

>>> from sage.all import *
>>> p = PointConfiguration([[Integer(0),Integer(0)],[Integer(1),Integer(0)],[Integer(2),Integer(1)],[Integer(1),Integer(2)],[Integer(0),Integer(1)]])
>>> p.triangulate().gkz_phi()
(3, 1, 5, 2, 4)
>>> p.lexicographic_triangulation().gkz_phi()
(1, 3, 4, 2, 5)

interior_facets()[source]#

Return the interior facets of the triangulation.

OUTPUT:

The inward-facing boundary simplices (of dimension $$d-1$$) of the $$d$$-dimensional triangulation as a set. Each boundary is returned by a tuple of point indices.

EXAMPLES:

sage: triangulation = polytopes.cube().triangulate(engine='internal')
sage: triangulation
(<0,1,2,7>, <0,1,5,7>, <0,2,3,7>, <0,3,4,7>, <0,4,5,7>, <1,5,6,7>)
sage: triangulation.boundary()
frozenset({(0, 1, 2),
(0, 1, 5),
(0, 2, 3),
(0, 3, 4),
(0, 4, 5),
(1, 2, 7),
(1, 5, 6),
(1, 6, 7),
(2, 3, 7),
(3, 4, 7),
(4, 5, 7),
(5, 6, 7)})
sage: triangulation.interior_facets()
frozenset({(0, 1, 7), (0, 2, 7), (0, 3, 7), (0, 4, 7), (0, 5, 7), (1, 5, 7)})

>>> from sage.all import *
>>> triangulation = polytopes.cube().triangulate(engine='internal')
>>> triangulation
(<0,1,2,7>, <0,1,5,7>, <0,2,3,7>, <0,3,4,7>, <0,4,5,7>, <1,5,6,7>)
>>> triangulation.boundary()
frozenset({(0, 1, 2),
(0, 1, 5),
(0, 2, 3),
(0, 3, 4),
(0, 4, 5),
(1, 2, 7),
(1, 5, 6),
(1, 6, 7),
(2, 3, 7),
(3, 4, 7),
(4, 5, 7),
(5, 6, 7)})
>>> triangulation.interior_facets()
frozenset({(0, 1, 7), (0, 2, 7), (0, 3, 7), (0, 4, 7), (0, 5, 7), (1, 5, 7)})

normal_cone()[source]#

Return the (closure of the) normal cone of the triangulation.

Recall that a regular triangulation is one that equals the “crease lines” of a convex piecewise-linear function. This support function is not unique, for example, you can scale it by a positive constant. The set of all piecewise-linear functions with fixed creases forms an open cone. This cone can be interpreted as the cone of normal vectors at a point of the secondary polytope, which is why we call it normal cone. See [GKZ1994] Section 7.1 for details.

OUTPUT:

The closure of the normal cone. The $$i$$-th entry equals the value of the piecewise-linear function at the $$i$$-th point of the configuration.

For an irregular triangulation, the normal cone is empty. In this case, a single point (the origin) is returned.

EXAMPLES:

sage: triangulation = polytopes.hypercube(2).triangulate(engine='internal')
sage: triangulation
(<0,1,3>, <1,2,3>)
sage: N = triangulation.normal_cone();  N
4-d cone in 4-d lattice
sage: N.rays()
( 0,  0,  0, -1),
( 0,  0,  1,  1),
( 0,  0, -1, -1),
( 1,  0,  0,  1),
(-1,  0,  0, -1),
( 0,  1,  0, -1),
( 0, -1,  0,  1)
in Ambient free module of rank 4
over the principal ideal domain Integer Ring
sage: N.dual().rays()
(1, -1, 1, -1)
in Ambient free module of rank 4
over the principal ideal domain Integer Ring

>>> from sage.all import *
>>> triangulation = polytopes.hypercube(Integer(2)).triangulate(engine='internal')
>>> triangulation
(<0,1,3>, <1,2,3>)
>>> N = triangulation.normal_cone();  N
4-d cone in 4-d lattice
>>> N.rays()
( 0,  0,  0, -1),
( 0,  0,  1,  1),
( 0,  0, -1, -1),
( 1,  0,  0,  1),
(-1,  0,  0, -1),
( 0,  1,  0, -1),
( 0, -1,  0,  1)
in Ambient free module of rank 4
over the principal ideal domain Integer Ring
>>> N.dual().rays()
(1, -1, 1, -1)
in Ambient free module of rank 4
over the principal ideal domain Integer Ring

plot(**kwds)[source]#

Produce a graphical representation of the triangulation.

EXAMPLES:

sage: p = PointConfiguration([[0,0],[0,1],[1,0],[1,1],[-1,-1]])
sage: triangulation = p.triangulate()
sage: triangulation
(<1,3,4>, <2,3,4>)
sage: triangulation.plot(axes=False)                                        # needs sage.plot
Graphics object consisting of 12 graphics primitives

>>> from sage.all import *
>>> p = PointConfiguration([[Integer(0),Integer(0)],[Integer(0),Integer(1)],[Integer(1),Integer(0)],[Integer(1),Integer(1)],[-Integer(1),-Integer(1)]])
>>> triangulation = p.triangulate()
>>> triangulation
(<1,3,4>, <2,3,4>)
>>> triangulation.plot(axes=False)                                        # needs sage.plot
Graphics object consisting of 12 graphics primitives

point_configuration()[source]#

Returns the point configuration underlying the triangulation.

EXAMPLES:

sage: pconfig = PointConfiguration([[0,0],[0,1],[1,0]])
sage: pconfig
A point configuration in affine 2-space over Integer Ring
consisting of 3 points. The triangulations of this point
configuration are assumed to be connected, not necessarily
fine, not necessarily regular.
sage: triangulation = pconfig.triangulate()
sage: triangulation
(<0,1,2>)
sage: triangulation.point_configuration()
A point configuration in affine 2-space over Integer Ring
consisting of 3 points. The triangulations of this point
configuration are assumed to be connected, not necessarily
fine, not necessarily regular.
sage: pconfig == triangulation.point_configuration()
True

>>> from sage.all import *
>>> pconfig = PointConfiguration([[Integer(0),Integer(0)],[Integer(0),Integer(1)],[Integer(1),Integer(0)]])
>>> pconfig
A point configuration in affine 2-space over Integer Ring
consisting of 3 points. The triangulations of this point
configuration are assumed to be connected, not necessarily
fine, not necessarily regular.
>>> triangulation = pconfig.triangulate()
>>> triangulation
(<0,1,2>)
>>> triangulation.point_configuration()
A point configuration in affine 2-space over Integer Ring
consisting of 3 points. The triangulations of this point
configuration are assumed to be connected, not necessarily
fine, not necessarily regular.
>>> pconfig == triangulation.point_configuration()
True

polyhedral_complex(**kwds)[source]#

Return self as a PolyhedralComplex.

OUTPUT:

A PolyhedralComplex whose maximal cells are the simplices of the triangulation.

EXAMPLES:

sage: P = polytopes.cube()
sage: pc = PointConfiguration(P.vertices())
sage: T = pc.placing_triangulation(); T
(<0,1,2,7>, <0,1,5,7>, <0,2,3,7>, <0,3,4,7>, <0,4,5,7>, <1,5,6,7>)
sage: C = T.polyhedral_complex(); C                                         # needs sage.graphs
Polyhedral complex with 6 maximal cells
sage: [P.vertices_list() for P in C.maximal_cells_sorted()]                 # needs sage.graphs
[[[-1, -1, -1], [-1, -1, 1], [-1, 1, 1], [1, -1, -1]],
[[-1, -1, -1], [-1, 1, -1], [-1, 1, 1], [1, 1, -1]],
[[-1, -1, -1], [-1, 1, 1], [1, -1, -1], [1, 1, -1]],
[[-1, -1, 1], [-1, 1, 1], [1, -1, -1], [1, -1, 1]],
[[-1, 1, 1], [1, -1, -1], [1, -1, 1], [1, 1, 1]],
[[-1, 1, 1], [1, -1, -1], [1, 1, -1], [1, 1, 1]]]

>>> from sage.all import *
>>> P = polytopes.cube()
>>> pc = PointConfiguration(P.vertices())
>>> T = pc.placing_triangulation(); T
(<0,1,2,7>, <0,1,5,7>, <0,2,3,7>, <0,3,4,7>, <0,4,5,7>, <1,5,6,7>)
>>> C = T.polyhedral_complex(); C                                         # needs sage.graphs
Polyhedral complex with 6 maximal cells
>>> [P.vertices_list() for P in C.maximal_cells_sorted()]                 # needs sage.graphs
[[[-1, -1, -1], [-1, -1, 1], [-1, 1, 1], [1, -1, -1]],
[[-1, -1, -1], [-1, 1, -1], [-1, 1, 1], [1, 1, -1]],
[[-1, -1, -1], [-1, 1, 1], [1, -1, -1], [1, 1, -1]],
[[-1, -1, 1], [-1, 1, 1], [1, -1, -1], [1, -1, 1]],
[[-1, 1, 1], [1, -1, -1], [1, -1, 1], [1, 1, 1]],
[[-1, 1, 1], [1, -1, -1], [1, 1, -1], [1, 1, 1]]]

simplicial_complex()[source]#

Return self as an (abstract) simplicial complex.

OUTPUT:

EXAMPLES:

sage: p = polytopes.cuboctahedron()
sage: sc = p.triangulate(engine='internal').simplicial_complex(); sc        # needs sage.graphs
Simplicial complex with 12 vertices and 16 facets

>>> from sage.all import *
>>> p = polytopes.cuboctahedron()
>>> sc = p.triangulate(engine='internal').simplicial_complex(); sc        # needs sage.graphs
Simplicial complex with 12 vertices and 16 facets


Any convex set is contractable, so its reduced homology groups vanish:

sage: sc.homology()                                                         # needs sage.graphs
{0: 0, 1: 0, 2: 0, 3: 0}

>>> from sage.all import *
>>> sc.homology()                                                         # needs sage.graphs
{0: 0, 1: 0, 2: 0, 3: 0}

sage.geometry.triangulation.element.triangulation_render_2d(triangulation, **kwds)[source]#

Return a graphical representation of a 2-d triangulation.

INPUT:

• triangulation – a Triangulation.

• **kwds – keywords that are passed on to the graphics primitives.

OUTPUT:

A 2-d graphics object.

EXAMPLES:

sage: points = PointConfiguration([[0,0],[0,1],[1,0],[1,1],[-1,-1]])
sage: triang = points.triangulate()
sage: triang.plot(axes=False, aspect_ratio=1)   # indirect doctest              # needs sage.plot
Graphics object consisting of 12 graphics primitives

>>> from sage.all import *
>>> points = PointConfiguration([[Integer(0),Integer(0)],[Integer(0),Integer(1)],[Integer(1),Integer(0)],[Integer(1),Integer(1)],[-Integer(1),-Integer(1)]])
>>> triang = points.triangulate()
>>> triang.plot(axes=False, aspect_ratio=Integer(1))   # indirect doctest              # needs sage.plot
Graphics object consisting of 12 graphics primitives

sage.geometry.triangulation.element.triangulation_render_3d(triangulation, **kwds)[source]#

Return a graphical representation of a 3-d triangulation.

INPUT:

• triangulation – a Triangulation.

• **kwds – keywords that are passed on to the graphics primitives.

OUTPUT:

A 3-d graphics object.

EXAMPLES:

sage: p = [[0,-1,-1],[0,0,1],[0,1,0], [1,-1,-1],[1,0,1],[1,1,0]]
sage: points = PointConfiguration(p)
sage: triang = points.triangulate()
sage: triang.plot(axes=False)     # indirect doctest                            # needs sage.plot
Graphics3d Object

>>> from sage.all import *
>>> p = [[Integer(0),-Integer(1),-Integer(1)],[Integer(0),Integer(0),Integer(1)],[Integer(0),Integer(1),Integer(0)], [Integer(1),-Integer(1),-Integer(1)],[Integer(1),Integer(0),Integer(1)],[Integer(1),Integer(1),Integer(0)]]
>>> points = PointConfiguration(p)
>>> triang = points.triangulate()
>>> triang.plot(axes=False)     # indirect doctest                            # needs sage.plot
Graphics3d Object