Class GeoPolygon2
- Namespace
- GeometryHelper.Geometry
- Assembly
- GeometryHelper.dll
Whether a polygon touches another shape.
public sealed class GeoPolygon2 : IEquatable<GeoPolygon2>
- Inheritance
-
GeoPolygon2
- Implements
- Inherited Members
- Extension Methods
Constructors
- GeoPolygon2(params GeoPoint2[])
Initializes a new polygon directly from parameter vertices.
- GeoPolygon2(IEnumerable<GeoPoint2>)
Initializes a new polygon from a list of vertices. Duplicate vertex at the end to close the loop will be automatically removed.
Properties
- Area
Gets the area the polygon encloses, whichever way its vertices run.
- Centroid
Gets the geometric centroid of the polygon.
- EdgeCount
Gets the number of edges of the polygon.
- IsClockwise
Gets a value indicating whether the vertices of the polygon run clockwise.
- this[int]
Gets the vertex at a given index.
- Length
Gets the total perimeter length of the polygon.
- SignedArea
Gets the signed area of the polygon, by the shoelace formula: positive when the vertices run counter-clockwise, negative when they run clockwise.
- VertexCount
Gets the number of vertices of the polygon.
- Vertices
Gets the read-only list of vertices of the polygon.
Methods
- BuildIndex()
Builds a spatial index over the edges of this polygon, for asking it many questions.
- Chamfer(double)
Chamfers every corner that has room for it, cutting the same distance along both edges.
- Chamfer(double, Tolerance)
Chamfers every corner that has room for it, cutting the same distance along both edges, within a tolerance.
- Chamfer(double, double)
Chamfers every corner that has room for it.
- Chamfer(double, double, Tolerance)
Chamfers every corner that has room for it, within a tolerance.
- Clone()
Creates a copy of this polygon holding its own vertex array.
- CollidesWith(GeoArc2)
Determines whether this polygon touches or overlaps an arc.
- CollidesWith(GeoArc2, Tolerance)
Determines whether this polygon touches or overlaps an arc, within a tolerance.
- CollidesWith(GeoCircle2)
Checks whether the polygon collides with a circle using default tolerance.
- CollidesWith(GeoCircle2, Tolerance)
Checks whether the polygon collides with a circle within tolerance.
- CollidesWith(GeoEdge2)
Checks whether this polygon touches an edge.
- CollidesWith(GeoEdge2, Tolerance)
Checks whether this polygon touches an edge, within a tolerance.
- CollidesWith(GeoFace2)
Checks whether this polygon reaches the material of a face, using the default tolerance.
- CollidesWith(GeoFace2, Tolerance)
Checks whether this polygon reaches the material of a face, within a tolerance.
- CollidesWith(GeoLine2)
Checks whether the polygon collides with a line segment using default tolerance.
- CollidesWith(GeoLine2, Tolerance)
Checks whether the polygon collides with a line segment within tolerance.
- CollidesWith(GeoPolygon2)
Checks whether the polygon collides with another polygon using default tolerance.
- CollidesWith(GeoPolygon2, Tolerance)
Checks whether the polygon collides with another polygon within tolerance.
- CollidesWith(GeoPolygonArc2)
Determines whether this polygon touches or overlaps a curved loop.
- CollidesWith(GeoPolygonArc2, Tolerance)
Determines whether this polygon touches or overlaps a curved loop, within a tolerance.
- CollidesWith(GeoPolyline2)
Checks whether the polygon collides with a polyline using default tolerance.
- CollidesWith(GeoPolyline2, Tolerance)
Checks whether the polygon collides with a polyline within tolerance.
- CollidesWith(GeoPolylineArc2)
Determines whether this polygon touches or overlaps a curved chain.
- CollidesWith(GeoPolylineArc2, Tolerance)
Determines whether this polygon touches or overlaps a curved chain, within a tolerance.
- CollidesWith(GeoRectangle2)
Checks whether the polygon collides with a rotated rectangle using default tolerance.
- CollidesWith(GeoRectangle2, Tolerance)
Checks whether the polygon collides with a rotated rectangle within tolerance.
- CollidesWith(GeoTriangle2)
Checks whether this polygon touches a triangle, using the default tolerance.
- CollidesWith(GeoTriangle2, Tolerance)
Checks whether this polygon touches a triangle, within a tolerance.
- Contains(GeoPoint2)
Checks whether the polygon contains a point using default tolerance (accepts points on the boundary).
- Contains(GeoPoint2, Tolerance)
Checks whether the polygon contains a point (accepts points on the boundary). Uses the Ray Casting algorithm (shoots a horizontal ray and counts intersections).
- Contains(GeoPolyline2)
Checks whether the polygon entirely contains a polyline using default tolerance.
- Contains(GeoPolyline2, Tolerance)
Checks whether the polygon entirely contains a polyline within tolerance.
- DistanceTo(GeoArc2)
Calculates the shortest distance from this polygon to an arc.
- DistanceTo(GeoArc2, Tolerance)
Calculates the shortest distance from this polygon to an arc, within a tolerance.
- DistanceTo(GeoCircle2)
Calculates the shortest boundary distance from this polygon to a circle.
- DistanceTo(GeoEdge2)
Gets the distance from this polygon to an edge.
- DistanceTo(GeoLine2)
Calculates the shortest boundary distance from this polygon to a line segment.
- DistanceTo(GeoPoint2)
Calculates the shortest distance from this polygon boundary to a point.
- DistanceTo(GeoPolygon2)
Calculates the shortest boundary distance from this polygon to another polygon.
- DistanceTo(GeoPolygonArc2)
Calculates the shortest distance from this polygon to a curved loop.
- DistanceTo(GeoPolygonArc2, Tolerance)
Calculates the shortest distance from this polygon to a curved loop, within a tolerance.
- DistanceTo(GeoPolyline2)
Calculates the shortest boundary distance from this polygon to a polyline.
- DistanceTo(GeoPolylineArc2)
Calculates the shortest distance from this polygon to a curved chain.
- DistanceTo(GeoPolylineArc2, Tolerance)
Calculates the shortest distance from this polygon to a curved chain, within a tolerance.
- DistanceTo(GeoRectangle2)
Calculates the shortest boundary distance from this polygon to a rectangle.
- DistanceTo(GeoTriangle2)
Gets the distance from this polygon to a triangle.
- Equals(GeoPolygon2)
Indicates whether the current polygon is equal to another polygon by comparing vertex arrays in order.
- Equals(object)
Indicates whether this instance and a specified object are equal.
- Fillet(IReadOnlyList<double>)
Rounds the corners of the loop, one radius each.
- Fillet(IReadOnlyList<double>, Tolerance)
Rounds the corners of the loop, one radius each, within a tolerance.
- Fillet(double)
Rounds every corner of the loop by the same radius.
- Fillet(double, Tolerance)
Rounds every corner of the loop by the same radius, within a tolerance.
- GetClosestEdge(GeoCircle2)
Gets the edge of this polygon nearest a circle.
- GetClosestEdge(GeoLine2)
Gets the edge of this polygon nearest a segment.
- GetClosestEdge(GeoPoint2)
Gets the edge of this polygon nearest a point.
- GetClosestPointOnBoundary(GeoPoint2)
Gets the closest point on the boundary of this polygon to a target point, including for points inside the polygon.
- GetDistanceAtParameter(double)
Gets the arc length from the first vertex of this polygon perimeter to a normalized parameter.
- GetDistanceAtPoint(GeoPoint2)
Gets the arc length from the first vertex of this polygon perimeter to the point on it closest to the supplied point.
- GetEdgeAt(int)
Gets the line segment edge of the polygon at a given index.
- GetEdges()
Enumerates all edges of the polygon.
- GetHashCode()
Returns the hash code for this instance.
- GetIntersections(GeoArc2)
Gets the points where this polygon meets an arc.
- GetIntersections(GeoArc2, Tolerance)
Gets the points where this polygon meets an arc, within a tolerance.
- GetIntersections(GeoCircle2)
Gets all intersection points with a circle using default tolerance.
- GetIntersections(GeoCircle2, Tolerance)
Gets all intersection points with a circle within tolerance.
- GetIntersections(GeoEdge2)
Gets every point where this polygon crosses an edge.
- GetIntersections(GeoEdge2, Tolerance)
Gets every point where this polygon crosses an edge, within a tolerance.
- GetIntersections(GeoFace2)
Gets every point where this polygon crosses the boundary of a face, using the default tolerance.
- GetIntersections(GeoFace2, Tolerance)
Gets every point where this polygon crosses the boundary of a face, within a tolerance.
- GetIntersections(GeoLine2)
Gets all intersection points with a line segment using default tolerance.
- GetIntersections(GeoLine2, Tolerance)
Gets all intersection points with a line segment within tolerance.
- GetIntersections(GeoPolygon2)
Gets all intersection points with another polygon using default tolerance.
- GetIntersections(GeoPolygon2, Tolerance)
Gets all intersection points with another polygon within tolerance.
- GetIntersections(GeoPolygonArc2)
Gets the points where this polygon meets a curved loop.
- GetIntersections(GeoPolygonArc2, Tolerance)
Gets the points where this polygon meets a curved loop, within a tolerance.
- GetIntersections(GeoPolyline2)
Gets all intersection points with a polyline using default tolerance.
- GetIntersections(GeoPolyline2, Tolerance)
Gets all intersection points with a polyline within tolerance.
- GetIntersections(GeoPolylineArc2)
Gets the points where this polygon meets a curved chain.
- GetIntersections(GeoPolylineArc2, Tolerance)
Gets the points where this polygon meets a curved chain, within a tolerance.
- GetIntersections(GeoRectangle2)
Gets all intersection points with a rectangle using default tolerance.
- GetIntersections(GeoRectangle2, Tolerance)
Gets all intersection points with a rectangle within tolerance.
- GetIntersections(GeoTriangle2)
Gets every point where this polygon meets the edges of a triangle, using the default tolerance.
- GetIntersections(GeoTriangle2, Tolerance)
Gets every point where this polygon meets the edges of a triangle, within a tolerance.
- GetParameterAtDistance(double)
Gets the normalized parameter at an arc length measured from the first vertex of this polygon perimeter.
- GetParameterAtPoint(GeoPoint2)
Gets the normalized parameter of the point on this polygon perimeter closest to the supplied point.
- GetPointAtDistance(double)
Gets the point at an arc length measured from the first vertex of this polygon perimeter.
- GetPointAtParameter(double)
Gets the point at a normalized parameter along this polygon perimeter, where 0 is the first vertex and 1 is the end. Values outside [0, 1] wrap around, so 1.25 is the same position as 0.25.
- GetShortestLineTo(GeoArc2)
Gets the shortest segment joining this polygon to an arc.
- GetShortestLineTo(GeoArc2, Tolerance)
Gets the shortest segment joining this polygon to an arc, within a tolerance.
- GetShortestLineTo(GeoCircle2)
Finds the shortest line segment connecting a point on the boundary of this polygon to a point on the circumference of a circle using default tolerance.
- GetShortestLineTo(GeoCircle2, Tolerance)
Finds the shortest line segment connecting a point on the boundary of this polygon to a point on the circumference of a circle within tolerance.
- GetShortestLineTo(GeoEdge2)
Gets the shortest segment leaving this polygon and landing on an edge.
- GetShortestLineTo(GeoEdge2, Tolerance)
Gets the shortest segment leaving this polygon and landing on an edge, within a tolerance.
- GetShortestLineTo(GeoFace2)
Gets the shortest segment leaving this polygon and landing on the boundary of a face, using the default tolerance.
- GetShortestLineTo(GeoFace2, Tolerance)
Gets the shortest segment leaving this polygon and landing on the boundary of a face, within a tolerance.
- GetShortestLineTo(GeoLine2)
Finds the shortest line segment connecting a point on the boundary of this polygon to a point on a line segment using default tolerance.
- GetShortestLineTo(GeoLine2, Tolerance)
Finds the shortest line segment connecting a point on the boundary of this polygon to a point on a line segment within tolerance.
- GetShortestLineTo(GeoPolygon2)
Finds the shortest line segment connecting a point on the boundary of this polygon to a point on the boundary of another polygon using default tolerance.
- GetShortestLineTo(GeoPolygon2, Tolerance)
Finds the shortest line segment connecting a point on the boundary of this polygon to a point on the boundary of another polygon within tolerance.
- GetShortestLineTo(GeoPolygonArc2)
Gets the shortest segment joining this polygon to a curved loop.
- GetShortestLineTo(GeoPolygonArc2, Tolerance)
Gets the shortest segment joining this polygon to a curved loop, within a tolerance.
- GetShortestLineTo(GeoPolyline2)
Finds the shortest line segment connecting a point on the boundary of this polygon to a point on a polyline using default tolerance.
- GetShortestLineTo(GeoPolyline2, Tolerance)
Finds the shortest line segment connecting a point on the boundary of this polygon to a point on a polyline within tolerance.
- GetShortestLineTo(GeoPolylineArc2)
Gets the shortest segment joining this polygon to a curved chain.
- GetShortestLineTo(GeoPolylineArc2, Tolerance)
Gets the shortest segment joining this polygon to a curved chain, within a tolerance.
- GetShortestLineTo(GeoRectangle2)
Finds the shortest line segment connecting a point on the boundary of this polygon to a point on the boundary of a rectangle using default tolerance.
- GetShortestLineTo(GeoRectangle2, Tolerance)
Finds the shortest line segment connecting a point on the boundary of this polygon to a point on the boundary of a rectangle within tolerance.
- GetShortestLineTo(GeoTriangle2)
Gets the shortest segment leaving this polygon and landing on a triangle, using the default tolerance.
- GetShortestLineTo(GeoTriangle2, Tolerance)
Gets the shortest segment leaving this polygon and landing on a triangle, within a tolerance.
- Intersect(GeoPolygon2)
Gets the region covered by both this polygon and another, using default tolerance.
- Intersect(GeoPolygon2, Tolerance)
Gets the region covered by both this polygon and another, within tolerance.
- IsEqualTo(GeoPolygon2)
Determines whether another polygon encloses the same region, within the default tolerance.
- IsEqualTo(GeoPolygon2, Tolerance)
Determines whether another polygon encloses the same region, within a tolerance.
- IsSimple()
Checks whether this polygon is simple, using default tolerance: no edge crosses or touches another except where neighbours share their vertex.
- IsSimple(Tolerance)
Checks whether this polygon is simple, within tolerance.
- Locate(GeoPoint2)
Classifies the location of a point relative to this polygon (Inside, OutSide, or OnSide) using default tolerance.
- Locate(GeoPoint2, Tolerance)
Classifies the location of a point relative to this polygon (Inside, OutSide, or OnSide) within tolerance.
- MakeValid()
Gets the region this polygon covers as faces that do not cross themselves, using the default tolerance.
- MakeValid(Tolerance)
Gets the region this polygon covers as faces that do not cross themselves, within a tolerance: the region the booleans and
Locateread, one face per piece.
- Offset(double)
Grows this polygon by a distance, or shrinks it when the distance is negative, with sharp corners, using default tolerance. See Offset(GeoPolygon2, double, OffsetOptions, Tolerance).
- Offset(double, OffsetJoin)
Grows this polygon by a distance, or shrinks it when the distance is negative, with the given corners, using default tolerance.
- Offset(double, OffsetJoin, Tolerance)
Grows this polygon by a distance, or shrinks it when the distance is negative, with the given corners, within tolerance.
- Offset(double, OffsetOptions)
Grows this polygon by a distance, or shrinks it when the distance is negative, as the options say, using default tolerance.
- Offset(double, OffsetOptions, Tolerance)
Grows this polygon by a distance, or shrinks it when the distance is negative, as the options say, within tolerance.
- Offset(double, Tolerance)
Grows this polygon by a distance, or shrinks it when the distance is negative, with sharp corners, within tolerance.
- Reverse()
Gets the polygon running the other way round.
- RotateBy(double, GeoPoint2)
Rotates the polygon around a center point by an angle in radians (counter-clockwise).
- SignedDistanceTo(GeoPoint2)
Calculates the distance from this polygon to a point, negative for a point within it.
- SignedDistanceTo(GeoPoint2, Tolerance)
Calculates the distance from this polygon to a point, negative for a point within it, within a tolerance.
- Subtract(GeoPolygon2)
Gets the region of this polygon with another taken out of it, using default tolerance.
- Subtract(GeoPolygon2, Tolerance)
Gets the region of this polygon with another taken out of it, within tolerance.
- Subtract(IEnumerable<GeoPolygon2>)
Gets the region of this polygon with every one of a set of polygons taken out of it, using default tolerance.
- Subtract(IEnumerable<GeoPolygon2>, Tolerance)
Gets the region of this polygon with every one of a set of polygons taken out of it, within tolerance.
- ToMesh(MeshKind)
Breaks the polygon into faces of a kind, using the default tolerance. A grid needs the size of its cells, which ToMesh(MeshOptions) takes.
- ToMesh(MeshOptions)
Breaks the polygon into faces as the options say, using the default tolerance.
- ToMesh(MeshOptions, Tolerance)
Breaks the polygon into faces as the options say, within a tolerance: triangles, the cells of a grid, strips or convex pieces, each a simple polygon with no hole, counter-clockwise, meeting its neighbours edge to edge.
- ToPolygon3(GeoCoordinateSystem3)
Puts this polygon of the plane back into space, on the plane of a frame.
- ToPolyline()
Converts this polygon's boundary into a closed 2D GeoPolyline2. The boundary is closed by repeating the first vertex at the end of the chain.
- ToString()
Returns the string representation of the polygon.
- TransformBy(GeoTransform2)
Applies a transformation to this polygon. A transformation that turns shapes round, a mirror or a negative scaling, reverses the winding: a polygon that ran counter-clockwise comes back clockwise.
- Translate(GeoVector2)
Translates the polygon by a displacement vector.
- TriangulateSurface()
Breaks the polygon into triangles that each lie within it, using the default tolerance.
- TriangulateSurface(Tolerance)
Breaks the polygon into triangles that each lie within it, within a tolerance.
- TryChamferAt(int, double, double, out GeoPolygon2)
Chamfers one corner, using the default tolerance.
- TryChamferAt(int, double, double, out GeoPolygon2, Tolerance)
Chamfers one corner, within a tolerance.
- TryFilletAt(int, double, out GeoPolygonArc2)
Rounds one corner of the loop; every vertex of a loop is a corner.
- TryFilletAt(int, double, out GeoPolygonArc2, Tolerance)
Rounds one corner of the loop within a tolerance; every vertex of a loop is a corner.
- TryIntersectWith(GeoPolygonArc2, out GeoPoint2[])
Tries to find where this polygon crosses a curved loop, using the default tolerance.
- TryIntersectWith(GeoPolygonArc2, out GeoPoint2[], Tolerance)
Tries to find where this polygon crosses a curved loop, within a tolerance.
- TryIntersectWith(GeoPolylineArc2, out GeoPoint2[])
Tries to find where this polygon crosses a curved chain, using the default tolerance.
- TryIntersectWith(GeoPolylineArc2, out GeoPoint2[], Tolerance)
Tries to find where this polygon crosses a curved chain, within a tolerance.
- TrySplitBy(GeoLine2, out GeoPolygon2[], out GeoPolygon2[])
Cuts the loop by the straight line through a segment.
- TrySplitBy(GeoLine2, out GeoPolygon2[], out GeoPolygon2[], Tolerance)
Cuts the loop by the straight line through a segment, within a tolerance.
- TrySplitBy(GeoPolyline2, out GeoPolygon2[])
Cuts the loop in two along a chain drawn across it.
- TrySplitBy(GeoPolyline2, out GeoPolygon2[], Tolerance)
Cuts the loop in two along a chain drawn across it, within a tolerance.
- Union(GeoPolygon2)
Gets the region covered by this polygon or another, using default tolerance. See Boolean2.
- Union(GeoPolygon2, Tolerance)
Gets the region covered by this polygon or another, within tolerance.
- Xor(GeoPolygon2)
Gets the region covered by exactly one of this polygon and another, using default tolerance.
- Xor(GeoPolygon2, Tolerance)
Gets the region covered by exactly one of this polygon and another, within tolerance.
Operators
- operator +(GeoPolygon2, GeoVector2)
Translates a polygon by a vector.
- operator ==(GeoPolygon2, GeoPolygon2)
Compares two GeoPolygon2 instances for equality.
- operator !=(GeoPolygon2, GeoPolygon2)
Compares two GeoPolygon2 instances for inequality.
- operator -(GeoPolygon2, GeoVector2)
Translates a polygon backwards by a vector.