# triangle

## Name

triangle — A single triangle in a 2-manifold triangulation

## Synopsis

Content Model

    triangle ::= (#PCDATA)

Attributes
Name | Type
`desc` | CDATA

## Description

A `triangle` element stores a single triangle in a 2-manifold triangulation with its associated edge gluings.

The character data of this XML element should be a whitespace-separated list of three integer pairs, representing the gluings of edges 0, 1 and 2 of this triangle. Note that edge `i` is always opposite vertex `i` in a triangle.

For each pair, the first integer represents the triangle to which the edge is glued (note that triangles in a triangulation are numbered 0, 1, 2, etc.). The second integer represents the permutation of vertices from this triangle to the other describing precisely how this gluing takes place. This permutation will take the current edge number to the corresponding edge number of the adjacent triangle, and the other two vertex numbers to the corresponding two vertex numbers on the adjacent triangle to which they are identified by this gluing.

A permutation is represented as an integer between 0 and 5 inclusive, representing the index of the permutation into Regina's internal array `NPerm3::S3`. Specifically, the integers 0, 1, 2, 3, 4 and 5 represent the permutations (0,1,2), (0,2,1), (1,2,0), (1,0,2), (2,0,1) and (2,1,0) respectively.

If a face is a boundary face (i.e., it is not glued to anything), the two corresponding integers stored in the XML character data should be -1 and -1.

### Parents

The following elements contain `triangle`: `triangles`.

### Children

Element `triangle` has no children.

## Attributes

`desc`

  A human-readable description of the role that this triangle plays in the overall 2-manifold triangulation.