|
Name
|
Description
|
|
Add(Arc2d)
|
Adds an arc segment last to the poly. If the arcs startpoint is further away than epsilon from the
current endpoint of the poly a line segment is added between.
|
|
Add(Line2d)
|
Adds a line segment last to the poly. If the lines startpoint is further away than epsilon from the
current endpoint of the poly a line segment is added between.
|
|
Add(Point2d)
|
Adds a copy of a point to the polygon.
|
|
Add(Point2d, double)
|
Creates a poly node from a point and a bulge factor.
|
|
Add(Point2d, object)
|
Adds a copy of a point to the polygon.
|
|
Add(Poly2d, bool)
|
Adds all points of a given polygon to this one.
|
|
Add(PolyPoint2d)
|
Adds a copy of a PolyPoint2d to the poly.
|
|
Add(Vector2d)
|
Adds a copy of the polys last point translated with a given vector last to the poly.
If the poly is empty a point at 0,0 is added first.
|
|
Add(double, double)
|
Adds a point to the polygon given real numbers.
|
|
Add(double, double, double)
|
Adds a point to the polygon given real numbers and a bulge factor.
|
|
AddRaw(PolyPoint2d)
|
Adds a point directly to the polygon without copying it. Use with care if speed is needed.
|
|
Arc(int)
|
Extracts one segment of this poly as an Arc2d. If the poly contains less than two nodes, an exception is thrown.
|
|
ArcFit(double)
|
Returns a new poly, which is created by fitting arcs to this poly within a given tolerance.
This can reduce the number of segments needed to describe this geometry.
|
|
CalcOffsetExtendPoint(Arc2d, Arc2d, out Point2d, out Point2d, double, Point2d, bool, double)
|
Calculates the extension points of a1 and a2 using maxdist for chamfer.
|
|
CalcOffsetExtendPointSimple(Arc2d, Arc2d, double, Point2d)
|
Calculates the extension intersection point of two arcs if the distance is shorter than maxdist.
|
|
ChangeStart(int)
|
Creates a new poly with a changed start point.
|
|
Clean()
|
Perform a default clean using Calc.Epsilon.
|
|
Clean(double)
|
Removes all edges in the poly whose length is less than the given tolerance.
This function modifies the poly in-place.
|
|
Clear()
|
Removes all nodes from the poly and makes it open, just like a new default poly.
|
|
Clip(Extents2d, out Poly2d)
|
Clips the Poly2d to a specified clipping box.
The result is a new Poly2d defining the part that is completely inside the clip box.
The Poly2d must be closed and consist of only lines.
|
|
ClosestNode(Point2d)
|
Computes the index of the closest node in the poly from a given point.
If the poly is empty, an exception will be thrown.
|
|
ClosestNode(Point2d, out double)
|
Computes the index of the closest node in the poly from a given point.
If the poly is empty, an exception will be thrown.
|
|
ClosestOuterCorner(Point2d, double, bool)
|
Returns the closest oputer corner index from point pt
|
|
ClosestPoint(Point2d)
|
Computes a new point on the poly that is as close as possible to a given point.
If the poly is empty, an exception will be thrown.
|
|
ClosestSegment(Point2d)
|
Computes the index of the closest segment in the poly from a given point.
If the poly has less than two nodes (=0 segments), an exception will be thrown.
|
|
ClosestSegment(Point2d, out double)
|
Computes the index of the closest segment in the poly from a given point.
If the poly has less than two nodes (=0 segments), an exception will be thrown.
|
|
Contains(Point2d)
|
Checks if a point is inside the poly. If the poly is open, an exception is thrown.
The direction (CW/CCW) of the poly is not taken into account.
|
|
Distance(Point2d)
|
Computes the minimum distance from a point to the poly.
|
|
DouglasPeucker(double)
|
Creates a DouglasPeucker poly.
|
|
Eval(double)
|
Evaluates a point on the polygon given a parameter in the range 0-1 between the polygons endpoints.
If the poly is closed, larger or smaller valus than this range wraps around the poly. If the poly
is open, the point is on the extension of the start/end point.
|
|
Eval(double, out double)
|
Evaluates a point on the polygon given a parameter in the range 0-1 between the polygons endpoints.
If the poly is closed, larger or smaller valus than this range wraps around the poly. If the poly
is open, the point is on the extension of the start/end point. A tangent at the point found is
computed as well.
|
|
Flatten(double, FlattenMode)
|
Computes a new polygon, containing only line segments. Arc segments are flattened using the given tolerance.
|
|
GetCentralPoint()
|
Calculates an optimal point that is most inside the poly
|
|
GetCentralPoint(out double)
|
Calculates an optimal point that is most inside the poly
|
|
GetEnumerator()
|
Returns an enumerator that iterates through the collection.
|
|
GetX(double)
|
Get X for a certain Y, works only on Y-monotone polys
|
|
GetY(double)
|
Get Y for a certain X, works only on X-monotone polys
|
|
InsertNode(double)
|
Inserts a node at pos and returns the index to the inserted node
If the node allready exists the index is just returned
|
|
IsCircular(double)
|
Checks if a poly is a circle
|
|
IsCircular(out Circle2d, double)
|
Checks if a poly is a circle
|
|
IsConvex()
|
Checks if this polygon is convex.
|
|
IsLongerThan(double)
|
Checks if the length of this poly is longer than a given length. This is faster than checking if the length property
is longer than a value, because it can break when the limit has been reached.
|
|
IsOuterCorner(int, double, bool)
|
Detects if a node in a poly is an outside corner. Poly is supposed to be closed and CCW.
|
|
IsOuterCornerAtParam(double, double)
|
|
|
IsShorterThan(double)
|
Checks if the length of this poly is shorter than a given length. This is faster than checning if the length property
is shorter than a value, because it can break when the limit has been reached.
|
|
LineFit(double)
|
Creates a new optimized poly with only lines.
|
|
MakeYMonotone()
|
Splits all arcs so that they are Y-monotone.
|
|
Measure(double)
|
Divides a poly into pieces with length dist
The last piece might be shorter
|
|
MeasureEdges(double)
|
Creates a point list along the poly with distance dist.
Works per edge so the actual distance can vary between edges.
|
|
MergeArcs(double)
|
Merges concecutive arcs within accuracy.
|
|
Midpoint()
|
The point splitting the poly in two polys of equal length.
|
|
Mirror(Point2d, Point2d)
|
Reflects the poly in-place over a line given with two points.
Note that the polys direction inverts when reflecting it.
|
|
Offset(List<Double>, double, bool)
|
Offsets the poly with different distances for every segment. The gap is connected with an interpolated arc.
|
|
Offset(double, OffsetGapType, double)
|
Computes a new poly which is an offset of this poly. The offsetted segments can be joined with an arc or by extension.
This function automatically removes trivial (zero length) segments in the result poly.
The resulting poly will _not_ be trimmed and may contain loops. Use Union() or Trim() to remove such loops if needed.
|
|
Offset(double, OffsetGapType, double, bool)
|
Computes a new poly which is an offset of this poly. The offsetted segments can be joined with an arc or by extension.
This function automatically removes trivial (zero length) segments in the result poly.
The resulting poly will _not_ be trimmed and may contain loops. Use Union() or Trim() to remove such loops if needed.
|
|
OffsetRound(double)
|
Untrimmed offset with Arc gaptype
|
|
OffsetUnion(double, OffsetGapType, double)
|
Offsets a closed poly and trims it using a self union. See Offset(...) and Union(...) function for more details.
If the poly is open the result is undefined or an exception is thrown.
|
|
Param(Point2d)
|
Computes a parameter on the poly in the range 0-1 where a given point resides.
If the point is further away than 1e-4 from the poly, an exception is thrown.
If the point is at a self intersection of the poly, the first(lowest) parameter is computed.
|
|
Pop()
|
Removes the last point in the poly. If the poly is empty, an exception will be thrown.
|
|
ReportDebugPoly(Poly2d, int)
|
|
|
Reverse()
|
Reverses the polygon in-place. Note that all bulge factors will be inverted.
|
|
Rotate(double)
|
Rotates the poly in-place with a specified angle in radians.
|
|
Rotate(double, Point2d)
|
Rotates the poly in-place with a given angle around a specified point.
|
|
Scale(double)
|
Scales the poly in-place with a given factor. Factors larger then 1 gives a larger geometry and smaller than 1 gives a smaller.
|
|
Scale(double, Point2d)
|
Scales the poly in-place with a given factor using a specified scaling center.
Factors larger then 1 gives a larger geometry and smaller than 1 gives a smaller.
|
|
Shorten(double)
|
Shortens an open poly with dist (must be positive).
If not possible a copy of the poly is returned unchanged.
|
|
ShortestSeg()
|
Returns the length of the shortest segment
|
|
Split(IEnumerable<Point2d>)
|
Tries to split a polygon into a list of subpolygons using the given points.
If a point does not lie on the polygon, it is ignored.
|
|
Split(IEnumerable<Double>)
|
Splits the polygon into sub-polygons at a list of parameters in the range 0-1. The parameter list
does _not_ need to be sorted. Any points outside the polygon are ignored.
If the number of points on the polygon is N, the number of polys returned is exactly N+1.
|
|
Split(params Point2d[])
|
Tries to split a polygon into a list of subpolygons using the given points.
If a point does not lie on the polygon, it is ignored.
|
|
Split(params double[])
|
Splits the polygon into sub-polygons at a list of parameters in the range 0-1. The parameter list
does _not_ need to be sorted.
|
|
Split(double, out Poly2d, out Poly2d)
|
Splits this poly at a given parameter. If this poly is closed, a single result with
a poly open at that point is computed, otherwise two result polygons is computed.
|
|
Stroke(double, LineCapMode, OffsetGapType, double)
|
Returns a new poly that is a two-way offset of this poly, which for example is suitable when this poly is
to be rasterized as a fat line. Line joins and end caps can be choosen. If the poly is closed, an exception will be thrown.
The result is _not_ trimmed. See Union() function for this.
|
|
SubPoly(double, double)
|
Splits a poly at startparam and creates an open poly of paramlength
If paramlength is negative direction is reversed
Handles any parameters not just in 0-1
|
|
Swell(double)
|
Shortcut to Stroke(...) the poly with Round linecaps and round endcaps, that is the 'real' offset
of the line (all points of the result has the given distance to the original line).
The result is _not_ trimmed. See Union() function for this.
If the poly is closed, an exception will be thrown.
|
|
ToPoints()
|
Returns the polys points as a list of Point2d
|
|
ToRegion(double)
|
Creates a region representing the poly exactly.
|
|
ToString()
|
Returns a new string that contains debug information for the poly.
|
|
Transform(Matrix2d)
|
Transforms the poly in-place with a matrix.
|
|
Translate(double, double)
|
Translates the poly in-place by a given delta x and delta y.
|
|
TryClose(double)
|
Tries to close the poly. Removes last point and sets closed=true.
|
|
Union()
|
Computes a self-union of this poly. This will for example remove loops created by an offset of a closed polygon.
Note that clockwise polygons are seen as holes and will produce no results if union:ed.
|
|
WriteAutoCADScript(StreamWriter, int)
|
Appends text that can be loaded in AutoCAD as a script to a stream.
|