My Project
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Properties | List of all members
TriangleNet.Geometry.Contour Class Reference

Public Member Functions

 Contour (IEnumerable< Vertex > points)
 Initializes a new instance of the Contour class.
 
 Contour (IEnumerable< Vertex > points, int marker)
 Initializes a new instance of the Contour class.
 
 Contour (IEnumerable< Vertex > points, int marker, bool convex)
 Initializes a new instance of the Contour class.
 
List< ISegmentGetSegments ()
 
Point FindInteriorPoint (int limit=5, float eps=2e-5f)
 Try to find a point inside the contour.
 

Static Public Member Functions

static bool IsPointInPolygon (Point point, List< Vertex > poly)
 Return true if the given point is inside the polygon, or false if it is not.
 

Properties

List< VertexPoints [get, set]
 Gets or sets the list of points making up the contour.
 

Constructor & Destructor Documentation

◆ Contour() [1/3]

TriangleNet.Geometry.Contour.Contour ( IEnumerable< Vertex points)
inline

Initializes a new instance of the Contour class.

Parameters
pointsThe points that make up the contour.

◆ Contour() [2/3]

TriangleNet.Geometry.Contour.Contour ( IEnumerable< Vertex points,
int  marker 
)
inline

Initializes a new instance of the Contour class.

Parameters
pointsThe points that make up the contour.
markerContour marker.

◆ Contour() [3/3]

TriangleNet.Geometry.Contour.Contour ( IEnumerable< Vertex points,
int  marker,
bool  convex 
)
inline

Initializes a new instance of the Contour class.

Parameters
pointsThe points that make up the contour.
markerContour marker.
convexThe hole is convex.

Member Function Documentation

◆ FindInteriorPoint()

Point TriangleNet.Geometry.Contour.FindInteriorPoint ( int  limit = 5,
float  eps = 2e-5f 
)
inline

Try to find a point inside the contour.

Parameters
limitThe number of iterations on each segment (default = 5).
epsThreshold for co-linear points (default = 2e-5).
Returns
Point inside the contour
Exceptions
ExceptionThrows if no point could be found.

For each corner (index i) of the contour, the 3 points with indices i-1, i and i+1 are considered and a search on the line through the corner vertex is started (either on the bisecting line, or, if IPredicates.CounterClockwise is less than eps, on the perpendicular line. A given number of points will be tested (limit), while the distance to the contour boundary will be reduced in each iteration (with a factor 1 / 2^i, i = 1 ... limit).

◆ IsPointInPolygon()

static bool TriangleNet.Geometry.Contour.IsPointInPolygon ( Point  point,
List< Vertex poly 
)
inlinestatic

Return true if the given point is inside the polygon, or false if it is not.

Parameters
pointThe point to check.
polyThe polygon (list of contour points).
Returns

WARNING: If the point is exactly on the edge of the polygon, then the function may return true or false.

See http://alienryderflex.com/polygon/


The documentation for this class was generated from the following file: