Each object is formed by creating an polygonal mesh using a bidimensional matrix of 3D points. Each point is connected with it's horizontal and vertical neighbours, as shown by the following drawing:
o----o----o----o----o----o-- ... --o | | | | | | | o----o----o----o----o----o-- ... --o | | | | | | | o----o----o----o----o----o-- ... --o | | | | | | | o----o----o----o----o----o-- ... --o | | | | | | | . . . . . . . . . . . . . . . . . . . . . | | | | | | | o----o----o----o----o----o-- ... --o
The contents of the pts files it's nothing more than a listing of the matrix that composes the object. In the header of the file there are three lines with information about the matrix dimensions and object topology. After that you have the matrix's points, one by line and the matrix filling should be done by lines.
If the flag is 1, it means that the last column column connects to the first one, making a closed object.