The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....


Unit: SDL_math2
Class: none
Declaration: function ConvertToDiffPolygon(PolyG: TPDblArray; var DiffPolyG: TPDblArray; PruneMode: integer): integer;

The function ConvertToDiffPolygon converts the polygon specified in parameter PolyG into a differential representation where the polygonal is defined by the differences dx and dy between the individual polygon vertices. The resulting differential polygon is returned in the variable parameter DiffPolyG. The parameter PruneMode controls the removal of unnecessary vertices:

0 no pruning is done
1 subsequent duplicate points are removed
2 collinear points and subsequent duplicates are removed
The function returns the size of the differential polygon.

Hint: Please note that the starting point of the polygon PolyG[0] is not stored in the differential form. Thus, you have to store the starting point separately.

Last Update: 2019-Mar-01