PLC File Format

The .plc file format is used for defining a piecewise linear complex (PLC).  The goal of this format is to fully specify a PLC and not require any additional intersection checks between features.

A .plc file consists of 5 sections.

1. PLC
2. Dimension
3. Points
4. Segments
5. Faces (omitted if dimension is 2)

Section 1. PLC section

This section identifies the file type.

First line: PLC

Section 2.  Dimension section

This section specifies the dimension of the PLC: either 2 or 3.

First line: DIMENSION <dim>

Section 3.  Points section

This sections gives the coordinates of all the points in the PLC.

First line: POINTS <# points>
Remaining lines: <point id> <x coord> <y coord> <z coord>

<point id> should be a unique integer identifier.  <z coord> is omitted if <dim> is 2.

Section 4.  Segments section

This section defines all of the segments.

First Line: SEGMENTS <# segments>
Remaining lines: <segment id> <end point 1> <end point 2>

<segment id> should be a unique integer identifier.

Section 5.  Faces section

This section defines all of the faces.

First Line: FACES <# faces>

This is followed by <# faces> face definitions.  Each face is specified in the following format.

<face id> <# boundary segments> <#interior segments> <# interior points> <N/C>
<boundary segment list> <interior segment list> <interior point list>

<face id> should be an integer identifier.

The boundary segment list must be a sequence of segments in a consistent order so that the boundary is always on the same side.  "Holes" are also specified an oriented list of segments included in the list of boundary segments.  The interior segment list is a list of segments which are contained in the face.   

Using the flag N or C tells the code to use simplifications in the convex case (the C option) or not (the N option).  In the convex case, the list of boundary segments do not need to be given in order. 

Example


PLC
DIMENSION 3
POINTS 10
0 -4 -4 0
1 4 -4 0
2 4 4 0
3 -4 4 0
4 0 2 0
5 2 0 0
6 0 -2 0
7 -2 0 0
8 0 0 1
9 0 0 -1
SEGMENTS 20
100     0 1
101     1 2
102     2 3
103     3 0
104     4 5
105     5 6
106     6 7
107     7 4
108     0 6
109     1 5
110     2 4
111     3 7
112     4 8
113     5 8
114     6 8
115     7 8
116     4 9
117     5 9
118     6 9
119     7 9
FACES 9
200 8 4 0 N    100 101 102 103 104 105 106 107 108 109 110 111
201 3 0 0 C    104 112 113
202 3 0 0 C    105 113 114
203 3 0 0 C    106 114 115
204 3 0 0 C    107 115 112
205 3 0 0 C    104 116 117
206 3 0 0 C    105 117 118
207 3 0 0 C    106 118 119
208 3 0 0 C    107 119 116