Loop Type
A counter-clockwise, closed series of 2D points. Checked for too short segments and duplicate points but might have colinear points. Checked for self intersection. This class stores for each segment precomputed list of unit-vectors, lengths and bounding Rectangles. This is to have better performance when calculating Loop with Loop intersections or point containment.
Instance members
Instance member |
Description
|
Full Usage:
this.Area
Returns: float
|
Without sign, since loop is guaranteed to be Counter Clockwise. This Value is precomputed in constructor.
|
|
A List of precomputed bounding rectangles for each segment. Each bounding rectangle is expanded by the SnapThreshold. This list is one item shorter than Points.
|
|
Creates a deep copy.
|
|
|
|
|
|
Returns closest and second closest segment index. They might both contain the closest point. ( in the corner where they meet)
|
|
Returns Relation between point and Loop: Inside, On or Outside. Tolerance for being on Loop is SnapThreshold.
|
|
The overall bounding rectangle. Including an expansion by snapThreshold.
|
Full Usage:
this.Lengths
Returns: float[]
|
A List of the lengths of each segment. This list is one item shorter than Points.
|
Full Usage:
this.MinSegmentLength
Returns: float
|
The minimum distance between points in this loop, This is a parameter at creation.
|
|
This list is one item Longer than vectors, BRects or Lengths. Last point equals the first point.
|
Full Usage:
this.SegmentCount
Returns: int
|
One less than Points count.
|
Full Usage:
this.SnapThreshold
Returns: float
|
This value is used when calculating intersection or point containment. Points within this distance of the segment will be considered on the segment. This parameter needs to be set at creation since it is used in pre-computations of bounding rectangles.
|
|
A List of precomputed UnitVectors for each segment. This list is one item shorter than Points.
|
Full Usage:
this.WindingNumber
Parameters:
Pt
-
The point to check winding around
Returns: int
The winding number, if it is not 0 then point is contained in the Loop
|
Returns the winding number for this polygon, around a given point
|
Static members
Static member |
Description
|
|