POLY Files (original) (raw)
POLY is a data directory which contains examples of POLY files, a format used by Jonathan Shewchuk to define PSLG's, planar straight line graphs, for use with his program TRIANGLE.
A Planar Straight Line Graph (PSLG) is a set of vertices and segments. Segments are simply edges, whose endpoints are vertices in the PSLG. Segments may intersect each other only at their endpoints.
POLY File Characteristics:
- ASCII
- 2D
- vertices are specified by coordinates.
- line segments are specified by listing the indices of pairs of vertices.
- a hole may be specified by listing the coordinates of a point inside the hole.
- No compression
- 1 image
Comments are prefixed by the character '#'. Everything from the comment character to the end of the line is ignored.
Vertices, segments, holes, and regions must be numbered and listed consecutively, starting from either 1 or 0.
The first line lists
- The number of vertices (this is sometimes set to 0, to indicate that the vertices should be read from a NODE file);
- The spatial dimension, which must be 2;
- The number of vertex attributes;
- The number of vertex boundary markers, which must be 0 or 1.
The vertex records must follow, with the format:
- vertex index (these must be consecutive, starting either from 0 or 1);
- X and Y coordinates;
- The vertex attributes (if any);
- The vertex boundary marker (if any).
The next line lists
- The number of segments;
- The number of segment boundary markers (0 or 1).
Segments should not cross each other; vertices should only lie on the ends of segments, and are never contained inside a segment.
The segments records must follow, with the format:
- segment index;
- start vertex, end vertex;
- Boundary marker (if any).
The third section lists holes (and concavities, if -c is selected) in the triangulation. Holes are specified by identifying a point inside each hole. After the triangulation is formed, Triangle creates holes by eating triangles, spreading out from each hole point until its progress is blocked by PSLG segments; you must be careful to enclose each hole in segments, or your whole triangulation might be eaten away. If the two triangles abutting a segment are eaten, the segment itself is also eaten. Do not place a hole directly on a segment; if you do, Triangle chooses one side of the segment arbitrarily.
The next line lists
- The number of holes.
The hole records must follow, with the format:
- hole index;
- X coordinate, Y coordinate of some point within the hole.
The optional fourth section lists regional attributes (to be assigned to all triangles in a region) and regional constraints on the maximum triangle area. Triangle reads this section only if the -A switch is used or the -a switch is used without a number following it, and the -r switch is not used. Regional attributes and area constraints are propagated in the same manner as holes; you specify a point for each attribute and/or constraint, and the attribute and/or constraint affects the whole region (bounded by segments) containing the point. If two values are written on a line after the x and y coordinate, the first such value is assumed to be a regional attribute (but is only applied if the -A switch is selected), and the second value is assumed to be a regional area constraint (but is only applied if the -a switch is selected). You may specify just one value after the coordinates, which can serve as both an attribute and an area constraint, depending on the choice of switches. If you are using the -A and -a switches simultaneously and wish to assign an attribute to some region without imposing an area constraint, use a negative maximum area.
The next line is optional. If given, it lists
- The number of region attributes.
The optional regional attributes records must follow, with the format:
- region index;
- X coordinate, Y coordinate of a point in the region;
- Attributes (if any);
- Maximum area of triangles in the region;
A Sample POLY file:
Here is a sample file box.poly describing a square with a square hole.
# A box with eight vertices in 2D, no attributes, one boundary marker.
8 2 0 1
# Outer box has these vertices:
1 0 0 0
2 0 3 0
3 3 0 0
4 3 3 33 # A special marker for this vertex.
# Inner square has these vertices:
5 1 1 0
6 1 2 0
7 2 1 0
8 2 2 0
# Five segments with boundary markers.
5 1
1 1 2 5 # Left side of outer box.
# Square hole has these segments:
2 5 7 0
3 7 8 0
4 8 6 10
5 6 5 0
# One hole in the middle of the inner square.
1
1 1.5 1.5
Licensing:
The computer code and data files described and made available on this web page are distributed underthe GNU LGPL license.
Sample Files:
A represents the capital letter A.
- <a.poly>, the POLY file.
- <a.png>, a PNG version.
BICYCLE_SEAT is a region looking like a bicycle seat.
- <bicycle%5Fseat.poly>, the POLY file.
- <bicycle%5Fseat.png>, a PNG version.
BOX is a box.
- <box.poly>, the POLY file.
- <box.png>, a PNG version.
DOUBLE_HEX is a box with two hexagonal holes.
- <double%5Fhex.poly>, the POLY file.
- <double%5Fhex.png>, a PNG version.
EXAMPLE is a 3D example used with TETGEN.
- <example.poly>, the POLY file.
MESH01 is test mesh #1.
- <mesh01.poly>, the POLY file.
- <mesh01.png>, a PNG version.
MESH02 is test mesh #2.
- <mesh02.poly>, the POLY file.
- <mesh02.png>, a PNG version.
MESH03 is test mesh #3.
- <mesh03.poly>, the POLY file.
- <mesh03.png>, a PNG version.
MESH04 is test mesh #4.
- <mesh04.poly>, the POLY file.
- <mesh04.png>, a PNG version.
MESH05 is test mesh #5.
- <mesh05.poly>, the POLY file.
- <mesh05.png>, a PNG version.
MESH06 is test mesh #6.
- <mesh06.poly>, the POLY file.
- <mesh06.png>, a PNG version.
MESH07 is test mesh #7.
- <mesh07.poly>, the POLY file.
- <mesh07.png>, a PNG version.
MESH08 is test mesh #8.
- <mesh08.poly>, the POLY file.
- <mesh08.png>, a PNG version.
MESH09 is test mesh #9.
- <mesh09.poly>, the POLY file.
- <mesh09.png>, a PNG version.
- p01.poly, TEST_TRIANGULATION problem #1.
- p02.poly, TEST_TRIANGULATION problem #2.
- p03.poly, TEST_TRIANGULATION problem #3.
- p04.poly, TEST_TRIANGULATION problem #4.
- p05.poly, TEST_TRIANGULATION problem #5.
- p06.poly, TEST_TRIANGULATION problem #6.
- p07.poly, TEST_TRIANGULATION problem #7.
- p08.poly, TEST_TRIANGULATION problem #8.
- p09.poly, TEST_TRIANGULATION problem #9.
- p10.poly, TEST_TRIANGULATION problem #10.
- p11.poly, TEST_TRIANGULATION problem #11.
- p12.poly, TEST_TRIANGULATION problem #12.
- p13.poly, TEST_TRIANGULATION problem #13.
- p14.poly, TEST_TRIANGULATION problem #14.
- p15.poly, TEST_TRIANGULATION problem #15.
- <pie.poly>, a region that looks like a piece of pie with a hole in it;
SHAPE is a simple shape with two hexagonal holes.
- <shape.poly>, the POLY file.
- <shape.png>, a PNG version.
SQUARE_CIRCLE_HOLE is a mesh of 826 points in a square region with a circular hole.
- <square%5Fcircle%5Fhole.poly>, the POLY file.
- <square%5Fcircle%5Fhole.png>, a PNG version.
You can go up one level tothe DATA page.
Last revised on 25 February 2011.