Aardvark.Base


Polygon3dExtensions

Static members

Static memberDescription
ComputeArea(polygon)
Signature: polygon:Polygon3d -> float

Computes the area as the length of the sum of the simple triangulation cross-product normals. NOTE: This has been tested to be slightly faster and slightly more accurate than the computation via the 3d Newell normal (see Math.Tests/GeometryTests, rft 2013-05-04).

ComputeCentroid(polygon)
Signature: polygon:Polygon3d -> V3d

The geometric center of a 3-dimensional, flat polygon. WARNING: UNTESTED!

ComputeDoubleAreaNormal(polygon)
Signature: polygon:Polygon3d -> V3d

Computes the normal with the length of twice the polygon area as the sum of the simple triangulation cross-product normals. NOTE: This has been tested to be slightly faster and slightly more accurate than the computation via the 3d Newell normal (see Math.Tests/GeometryTests, rft 2013-05-04).

ComputeFromPointFormFactor(...)
Signature: (targetPolygon:Polygon3d * sourcePoint:V3d * sourceNormal:V3d * eps:float) -> float
ComputeNormal(polygon)
Signature: polygon:Polygon3d -> V3d

Computes the normalized normal as the sum of the simple triangulation cross-product normals. NOTE: This has been tested to be slightly faster and slightly more accurate than the computation via the 3d Newell normal (see Math.Tests/GeometryTests, rft 2013-05-04).

ComputePerimeter(polygon)
Signature: polygon:Polygon3d -> float
ComputePlane3d(polygon)
Signature: polygon:Polygon3d -> Plane3d

Computes the supporting plane of the polygon via the vertex centroid and the sum of the simple triangulation cross-product normals. NOTE: This has been tested to be slightly faster and slightly more accurate than the computation via the 3d Newell normal (see Math.Tests/GeometryTests, rft 2013-05-04).

ComputeToPointFormFactor(...)
Signature: (sourcePolygon:Polygon3d * polygonArea:float * targetPoint:V3d * targetNormal:V3d * eps:float) -> float
ComputeUnscaledFormFactor(...)
Signature: (polygon:Polygon3d * p:V3d * n:V3d * eps:float) -> float
ComputeVertexCentroid(polygon)
Signature: polygon:Polygon3d -> V3d

The vertex centroid is the average of the vertex coordinates.

ConvexClipped(polygon, plane, eps)
Signature: (polygon:Polygon3d * plane:Plane3d * eps:float) -> Polygon3d

Clip the supplied polygon at the supplied plane. The method should work with all non-selfintersecting polygons.

ConvexClipped(polygon, planes, eps)
Signature: (polygon:Polygon3d * planes:Plane3d [] * eps:float) -> Polygon3d

Returns the convex polygon clipped by the set of planes (defined as Plane3ds).

ConvexClipped(polygon, hull, eps)
Signature: (polygon:Polygon3d * hull:Hull3d * eps:float) -> Polygon3d

Returns the polygon clipped by the hull, i.e. all parts of the polygon that are at the positive side of the hull planes.

ConvexClipped(polygon, box, eps)
Signature: (polygon:Polygon3d * box:Box3d * eps:float) -> Polygon3d

TODO summary.

GetCoincidentPoints(...)
Signature: (polygon:Polygon3d * toleranceAbsolute:float) -> IEnumerable<Pair<int>>

Enumerates all pairs of coincident vertices (as pairs of vertex indices).

GetPlane3d(polygon)
Signature: polygon:Polygon3d -> Plane3d

Returns the plane through the first 3 points of the polygon.

GetSelfIntersections(...)
Signature: (polygon:Polygon3d * toleranceAbsolute:float) -> IEnumerable<Pair<int>>

Enumerates all pairs of edges that intersect (as pairs of edge indices).

GetSpikes(self, toleranceInDegrees)
Signature: (self:Polygon3d * toleranceInDegrees:float) -> IEnumerable<int>

Enumerates all vertex indexes at which both outgoing edges meet at an angle that is less than the given threshold.

HasCoincidentPoints(...)
Signature: (polygon:Polygon3d * toleranceAbsolute:float) -> bool

Returns true if at least two vertices are coincident.

HasSpikes(self, toleranceInDegrees)
Signature: (self:Polygon3d * toleranceInDegrees:float) -> bool

Returns true if at least one vertex both outgoing edges meet at an angle that is less than the given threshold.

IsSelfIntersecting(...)
Signature: (self:Polygon3d * toleranceAbsolute:float) -> bool

Returns true if at least two edges intersect.

Scaled(polygon, scale)
Signature: (polygon:Polygon3d * scale:float) -> Polygon3d
Scaled(polygon, center, scale)
Signature: (polygon:Polygon3d * center:V3d * scale:float) -> Polygon3d
Scaled(polygon, scale)
Signature: (polygon:Polygon3d * scale:V3d) -> Polygon3d
Scaled(polygon, center, scale)
Signature: (polygon:Polygon3d * center:V3d * scale:V3d) -> Polygon3d
ScaledAboutVertexCentroid(...)
Signature: (polygon:Polygon3d * scale:float) -> Polygon3d
ScaledAboutVertexCentroid(...)
Signature: (polygon:Polygon3d * scale:V3d) -> Polygon3d
ToPolygon2d(polygon, point_copyFun)
Signature: (polygon:Polygon3d * point_copyFun:Func<V3d,V2d>) -> Polygon2d
ToPolygon2d(...)
Signature: (polygon:Polygon3d * point_index_copyFun:Func<V3d,int,V2d>) -> Polygon2d
Transformed(polygon, m)
Signature: (polygon:Polygon3d * m:M33d) -> Polygon3d
Transformed(polygon, m)
Signature: (polygon:Polygon3d * m:M44d) -> Polygon3d
WithoutMultiplePoints(polygon, eps)
Signature: (polygon:Polygon3d * eps:float) -> Polygon3d
Fork me on GitHub