.poly files


Examples are found at here.

A .poly file represents a piecewise linear complex (PLC) as well as some additional information. It consists of four parts, which are a list of points, a list of facets, a list of (volume) hole points, and a list of region attributes, respectively. The first three parts are mandatory, but the fourth part is optional.

Part 1 - node list

Part 2 - facet list

where each <facet #> has the following format:

Part 3 - hole list

Part 4 - region attributes list

Part 1 lists all the points, and is identical to the format of .node files. <\# of points> may be set to zero to indicate that the points are listed in a separate .node file.

Part 2 lists all the facets. To understand the format of a facet is crucial. Each facet is a planar straight line graph (PSLG), i.e., it is a polygonal region which may contain segments, single points and holes in it. A list of polygons is used to represent a facet. Each polygon has n corners, n >= 1. The polygon can be degenerate, i.e., n = 1 or n = 2 represents a single point or a segment, respectively.

A hole in a facet (don't confuse with the volume hole below) is sepcified by identifying a point inside the hole. However, this point need not be exactly in the hole, as long as its orthogonal projection onto this facet is in the hole. The list of hole points (consecutively) follows the list of polygons.

If the boundary markers is '1', TetGen will produce an additional boundary marker for each face in .face file (in the last column of each record). You can prevent boundary markers from being written into .face file by using the -B switch.

Boundary markers of facets are tags used mainly to identify which faces of the tetrahedralization are associated with which PLC facet, hence identify which faces occur on a boundary of the tetrahedralization. A common use is to determine where the boundary conditions should be applied to a mesh.

Part 3 lists all holes in the volume. Each holeis specified by identifying a point inside it. After the constrained Delaunay tetrahedrization is formed, TetGen creates holes by removing tetrahedra. Thus exactly is the reason why TetGen requires a closed boundary of the PLCs. In case of non closed PLC facets the whole tetrahedrization will be 'eaten' away. If two tetrahedra abutting a subface are removed, the subface itself is also vanished. Hole points have to be placed inside a region, else the rounding error determines which side of the facet is being transformed into the hole.

Part 4 (optional) lists regional attributes (to be assigned to all tetrahedra in a region) and regional constraints on the maximum tetrahedron volume. TetGen will read this section only if the -A switch is used or the -a switch without a number is invoked. Regional attributes and volume constraints are propagated in the same manner as holes.

If two values are written on a line after the x, y and z coordinate, the former is assumed to be a regional attribute (but will only be applied if the -A switch is selected), and the latter is assumed to be a regional volume constraint (but will only be applied if the -a switch is selected). It is possible to specify just one value after the coordinates. It can serve as both an attribute and an volume constraint, depending on the choice of switches. A negative maximum volume constraint allows to use the -A and the -a switches without imposing a volume constraint in this specific region.

In the following, a 1x1x1 cube is described by the poly file format.


  # Part 1 - node list 
  # node count, 3 dim, no attribute, no boundary marker
  8  3  0  0
  # Node index, node coordinates
  1  0.0 0.0 0.0
  2  1.0 0.0 0.0
  3  1.0 1.0 0.0
  4  0.0 1.0 0.0
  5  0.0 0.0 1.0
  6  1.0 0.0 1.0
  7  1.0 1.0 1.0
  8  0.0 1.0 1.0

  # Part 2 - facet list
  # facet count, no boundary marker
  6  0
  # facets
  1            # 1 polygon, no hole, no boundary marker
  4  1 2 3 4   # front
  1
  4  5 6 7 8   # back
  1
  4  1 2 6 5   # bottom
  1
  4  2 3 7 6   # right
  1
  4  3 4 8 7   # top
  1
  4  4 1 5 8   # left
  
  # Part 3 - hole list
  0            # no hole

  # Part 4 - region list
  0            # no region


Examples are found at here.


Return to TetGen file formats page.
Return to TetGen home page.
Hang Si