A sample polygon instance

The following figure shows a polygon with one hole and a total of eight vertices.
Figure 1: A sample polygon

The outer shape has vertices number from v1 to v4. The inner shape has vertices number from v5 to v8, with v5 mapping to v1 in the outer shape. Number of vertices is clockwise.
For this example, NumParts equals 2 and NumPoints equals 10. Note that the order of the points for the doughnut (hole) polygon is reversed below.

There are two parts, labeled 0 and 5. There are ten points, numbered from 0 to 9 and listed in this order: v1, v2, v3, v4, v1, v5, v8, v7, v6, v5. Part 0 is mapped to point v1. Part 5 is mapped to point v5.
The following table shows Polygon byte stream contents
Position Field Value Type Number Byte order
Byte 0 Shape Type 5 Integer 1 Little endian
Byte 4 Box Box Double 4 Little endian
Byte 36 NumParts NumParts Integer 1 Little endian
Byte 40 NumPoints NumPoints Integer 1 Little endian
Byte 44 Parts Parts Integer NumParts Little endian
Byte X Points Points Point NumPoints Little endian
Tip: X = 44 + (4 * NumParts)