-
首页
-
C4D R23.110 C++ SDK
GeometryUtilsInterface Class Reference
#include <geometryutils.h>
详细描述
2D and 3D geometrical utility functions.
静态公共成员函数
|
static
MAXON_METHOD
Float
|
LinearRemapToRange
(
Float
value,
Float
from1,
Float
to1,
Float
from2,
Float
to2)
|
static
MAXON_METHOD
Float
|
GetAngle2D
(const
Vector2d
&direction1, const
Vector2d
&direction2)
|
static
MAXON_METHOD
Float
|
InterpolatePointOnSegment
(const
向量
&segmentPoint1, const
向量
&segmentPoint2, const
向量
&point,
Bool
clamp=true)
|
static
MAXON_METHOD
Float
|
InterpolatePointOnSegment2D
(const
Vector2d
&segmentPoint1, const
Vector2d
&segmentPoint2, const
Vector2d
&point,
Bool
clamp=true)
|
static
MAXON_METHOD
Bool
|
CalculateBestFitPlane
(const
Block
< const
向量
> &pointCloud,
向量
¢roid,
向量
&normal,
Int
iterMax=500)
|
static
MAXON_METHOD
Result
< void >
|
Points3Dto2D
(const
Block
< const
向量
> &points, const
向量
&normal,
向量
&basisVector0,
向量
&basisVector1,
向量
&translate,
Bool
checkDegenerated,
WritableArrayInterface
<
Vector2d
> &outPoints,
Bool
computeBasis=true)
|
static
MAXON_METHOD
Result
< void >
|
Points3Dto2D
(const
Block
< const
向量
> &points, const
向量
&normal,
Bool
checkDegenerated,
WritableArrayInterface
<
Vector2d
> &outPoints)
|
static
MAXON_METHOD
向量
|
Point2Dto3D
(const
Vector2d
&point, const
向量
&basisVector0, const
向量
&basisVector1, const
向量
&translate)
|
static
MAXON_METHOD
Result
< void >
|
Points2Dto3D
(const
Block
< const
Vector2d
> &points, const
向量
&basisVector0, const
向量
&basisVector1, const
向量
&translate,
WritableArrayInterface
<
向量
> &outPoints)
|
static
MAXON_METHOD
Float
|
CalculateTriangleArea
(const
向量
&a, const
向量
&b, const
向量
&c)
|
static
MAXON_METHOD
Float
|
CalculateSignedTriangleArea
(const
向量
&a, const
向量
&b, const
向量
&c)
|
static
MAXON_METHOD
Float
|
CalculateQuadrangleArea
(const
向量
&a, const
向量
&b, const
向量
&c, const
向量
&d)
|
static
MAXON_METHOD
Float
|
CalculateOutlineArea
(const
Block
< const
向量
> &outlinePoints)
|
static
MAXON_METHOD
向量
|
CalculateOutlineNormal
(const
Block
< const
向量
> &points, const
Block
< const
Int32
> &indices,
Bool
normalized=true)
|
static
MAXON_METHOD
向量
|
CalculateOutlineNormal
(const
Block
< const
向量
> &points,
Bool
normalize=true)
|
static
MAXON_METHOD
Bool
|
IsVertexConvex
(const
向量
&vertex, const
向量
&next, const
向量
&pred, const
向量
&up=
向量
(0, 1, 0))
|
static
MAXON_METHOD
GEOMETRY_TEST_EXACT
|
IsVertexConvexExact
(const
向量
&vertex, const
向量
&next, const
向量
&pred, const
向量
&up=
向量
(0, 1, 0),
Float
epsilon=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Result
< void >
|
CalculateMeanValueCoordinatesWeights
(const
向量
&point, const
Block
< const
向量
> &outline,
WritableArrayInterface
<
Float
> &weights)
|
static
MAXON_METHOD
Result
< void >
|
CalculateMeanValueCoordinatesWeights
(const
向量
&point, const
Block
< const
向量
> &points, const
Block
< const
UInt32
> &outlineIndices, const
向量
&normal,
WritableArrayInterface
<
Float
> &weights)
|
static
MAXON_METHOD
Bool
|
IsVertexConvex2D
(const
Vector2d
&vertex, const
Vector2d
&next, const
Vector2d
&pred)
|
static
MAXON_METHOD
GEOMETRY_TEST_EXACT
|
IsVertexConvexExact2D
(const
Vector2d
&vertex, const
Vector2d
&next, const
Vector2d
&pred,
Float
epsilon=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Vector2d
|
CalculateBarycentricCoordinate
(const
向量
&point, const
向量
&a, const
向量
&b, const
向量
&c)
|
static
MAXON_METHOD
向量
|
CalculateBarycentricCoordinate3D
(const
向量
&point, const
向量
&a, const
向量
&b, const
向量
&c)
|
static
MAXON_METHOD
Bool
|
PointInTriangle
(const
向量
&point, const
向量
&a, const
向量
&b, const
向量
&c)
|
static
MAXON_METHOD
Bool
|
PointInTriangle2D
(const
Vector2d
&point, const
Vector2d
&a, const
Vector2d
&b, const
Vector2d
&c)
|
static
MAXON_METHOD
Int
|
GetPointInPolygonWindingNumber2D
(
Vector2d
point, const
Block
< const
Vector2d
> &outline)
|
static
MAXON_METHOD
Int
|
GetPointInPolygonWindingNumber2DExact
(
Vector2d
point, const
Block
< const
Vector2d
> &outline)
|
static
MAXON_METHOD
Int
|
GetPointInPolygonWindingNumber2D
(
Vector2d
point, const
Block
< const
Vector2d
> &outline,
Int
&edgeHit)
|
static
MAXON_METHOD
Int
|
GetPointInPolygonWindingNumber
(
向量
point, const
Block
< const
向量
> &outline)
|
static
MAXON_METHOD
Int
|
GetPointInPolygonWindingNumber
(
向量
point, const
Block
< const
向量
> &outline,
Int
&edgeHit)
|
static
MAXON_METHOD
Bool
|
PointInOutline2D
(const
向量
&point, const
Block
< const
Vector2d
> &outline)
|
static
MAXON_METHOD
Bool
|
PointInOutlineRobust2D
(const
向量
&point, const
Block
< const
Vector2d
> &outline)
|
static
MAXON_METHOD
向量
|
CalculateBisector
(const
向量
&v1, const
向量
&v2, const
向量
&up=
向量
(0, 1, 0),
Float
w1=1.0,
Float
w2=1.0)
|
static
MAXON_METHOD
Bool
|
CalculateCircumcenter2D
(const
Vector2d
&a, const
Vector2d
&b, const
Vector2d
&c,
Vector2d
¢er,
Float
&sqrRad,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
CalculateCircumcenter
(const
向量
&a, const
向量
&b, const
向量
&c,
向量
¢er,
Float
&rad,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
SegmentsIntersectionTest2D
(const
Vector2d
&segment1Point1, const
Vector2d
&segment1Point2, const
Vector2d
&segment2Point1, const
Vector2d
&segment2Point2)
|
static
MAXON_METHOD
Bool
|
SegmentRayIntersectionTest2D
(const
Vector2d
&segmentPoint1, const
Vector2d
&segmentPoint2, const
Vector2d
&rayStartPoint, const
Vector2d
&rayDirection)
|
static
MAXON_METHOD
Bool
|
IntersectSegments2D
(const
Vector2d
&segment1Point1, const
Vector2d
&segment1Point2, const
Vector2d
&segment2Point1, const
Vector2d
&segment2Point2,
Vector2d
&intersectionPoint,
Float
tolerance=0.0_f)
|
static
MAXON_METHOD
向量
|
LineLineDistance
(const
向量
&line1Point, const
向量
&line1Dir, const
向量
&line2Point, const
向量
&line2Dir,
Bool
¶llel,
Float
¶m1,
Float
¶m2,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
PointInSegment2D
(const
Vector2d
&point, const
Vector2d
&segmentPoint1, const
Vector2d
&segmentPoint2,
Float
tolerance)
|
static
MAXON_METHOD
Bool
|
PointInSegment
(const
向量
&point, const
向量
&segmentPoint1, const
向量
&segmentPoint2,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
PointInHalfLine
(const
向量
&point, const
向量
&halfLineOrigin, const
向量
&halfLineDir,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
IntersectLines
(const
向量
&line1Point, const
向量
&line1Dir, const
向量
&line2Point, const
向量
&line2Dir,
向量
&intersectionPoint,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
IntersectLineSegment
(const
向量
&linePoint, const
向量
&lineDir, const
向量
&segmentPoint1, const
向量
&segmentPoint2,
向量
&intersectionPoint,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
IntersectSegments
(const
向量
&segment1Point1, const
向量
&segment1Point2, const
向量
&segment2Point1, const
向量
&segment2Point2,
向量
&intersectionPoint,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
IntersectHalfLines
(const
向量
&halfLine1Origin, const
向量
&halfLine1Dir, const
向量
&halfLine2Origin, const
向量
&halfLine2Dir,
向量
&intersectionPoint,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
IntersectLineHalfLine
(const
向量
&linePoint, const
向量
&lineDir, const
向量
&halfLineOrigin, const
向量
&halfLineDir,
向量
&intersectionPoint,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
IntersectHalfLineSegment
(const
向量
&halfLineOrigin, const
向量
&halfLineDir, const
向量
&segmentPoint1, const
向量
&segmentPoint2,
向量
&intersectionPoint,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
IntersectPlanes
(const
向量
&plane1Point, const
向量
&plane1Normal, const
向量
&plane2Point, const
向量
&plane2Normal,
向量
&resLinePoint,
向量
&resLineDirection,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
IntersectLinePlane
(const
向量
&linePoint, const
向量
&lineDir, const
向量
&planePoint, const
向量
&planeNormal,
向量
&intersectionPoint,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
IntersectLinePlane
(const
向量
&linePoint, const
向量
&lineDir, const
向量
&planePoint, const
向量
&planeNormal,
向量
&intersectionPoint,
Float
¶m,
Bool
&samePlane,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
IntersectSegmentPlane
(const
向量
&segmentPoint1, const
向量
&segmentPoint2, const
向量
&planePoint, const
向量
&planeNormal,
向量
&intersectionPoint,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
IntersectHalfLinePlane
(const
向量
&halfLinePoint, const
向量
&halfLineDir, const
向量
&planePoint, const
向量
&planeNormal,
向量
&intersectionPoint,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
IntersectLineTriangle
(const
向量
&linePoint, const
向量
&lineDir, const
向量
&a, const
向量
&b, const
向量
&c,
向量
&intersectionPoint,
Vector2d
*barycCoords=nullptr,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
IntersectHalfLineTriangle
(const
向量
&halfLineOrigin, const
向量
&halfLineDir, const
向量
&a, const
向量
&b, const
向量
&c,
向量
&intersectionPoint,
Vector2d
*barycCoords=nullptr,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
IntersectLineQuadrangle
(const
向量
&linePoint, const
向量
&lineDir, const
向量
&a, const
向量
&b, const
向量
&c, const
向量
&d,
向量
&intersectionPoint,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
IntersectHalfLineQuadrangle
(const
向量
&halfLineOrigin, const
向量
&halfLineDir, const
向量
&a, const
向量
&b, const
向量
&c, const
向量
&d,
向量
&intersectionPoint,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
IntersectSegmentTriangle
(const
向量
&segmentPoint1, const
向量
&segmentPoint2, const
向量
&a, const
向量
&b, const
向量
&c,
向量
&intersectionPoint,
向量
*barycCoords=nullptr,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
TrianglesIntersectionTest
(const
向量
&t1a, const
向量
&t1b, const
向量
&t1c, const
向量
&t2a, const
向量
&t2b, const
向量
&t2c,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
Bool
|
CalculatePolygonPointST
(const
向量
&point, const
向量
&pa, const
向量
&pb, const
向量
&pc, const
向量
&pd,
Bool
isQuad,
Float
&s,
Float
&t,
Float
tolerance=
GeomConstants::EPSILON4
)
|
static
MAXON_METHOD
void
|
InverseBilinarInterpolate
(const
向量
&pa, const
向量
&pb, const
向量
&pc, const
向量
&pd, const
向量
&point,
Vector2d
&bilinarVariables)
|
static
MAXON_METHOD
void
|
InverseBilinarInterpolateNewton
(const
向量
&pa, const
向量
&pb, const
向量
&pc, const
向量
&pd, const
向量
&point,
Int32
iterations,
Vector2d
&bilinarVariables)
|
static
MAXON_METHOD
void
|
InverseBilinarInterpolate2D
(const
Vector2d
&pa, const
Vector2d
&pb, const
Vector2d
&pc, const
Vector2d
&pd, const
Vector2d
&point,
Vector2d
&bilinarVariables)
|
static
MAXON_METHOD
void
|
InverseBilinarInterpolate2DNewton
(const
Vector2d
&pa, const
Vector2d
&pb, const
Vector2d
&pc, const
Vector2d
&pd, const
Vector2d
&point,
Int32
iterations,
Vector2d
&bilinarVariables)
|
static
MAXON_METHOD
向量
|
BilinearInterpolate
(const
向量
&pa, const
向量
&pb, const
向量
&pc, const
向量
&pd, const
Float
s, const
Float
t)
|
static
MAXON_METHOD
Float
|
CalculateSignedTriangleArea
(const
向量
&a, const
向量
&b, const
向量
&c, const
向量
&normal)
|
static
MAXON_METHOD
Result
< void >
|
CalculateMeanValueCoordinatesWeights
(const
向量
&point, const
Block
< const
向量
> &outline, const
向量
&normal,
WritableArrayInterface
<
Float
> &weights)
|
static
MAXON_METHOD
Float
|
CalculatePerimeterLength2D
(const
Block
< const
Vector2d
> &outlinePoints)
|
static
MAXON_METHOD
Result
<
Bool
>
|
IsWoundClockwise2D
(const
Block
< const
Vector2d
> &outlinePoints)
|
static
MAXON_METHOD
Vector2d
|
CalculateOutlineCentroidAndArea2D
(const
Block
< const
Vector2d
> &outlinePoints,
Float
*area=nullptr,
Bool
*windingPolarity=nullptr)
|
static
MAXON_METHOD
Result
<
Vector2d
>
|
CalculateMultiOutlineCentroidAndAreas2D
(const
Block
< const
Vector2d
> &loopVertices, const
Block
< const
Int
> &loopVertexCounts,
Bool
includeHolesInCogCalcs,
Float
*overallArea=nullptr,
BaseArray
<
Float
> *loopSoloAreas=nullptr,
BaseArray
<
Bool
> *windingPolarity=nullptr)
|
static
MAXON_METHOD
Result
<
BaseArray
<
Int
> >
|
CalculateConvexHull2D
(const
Block
< const
Vector2d
> &outlinePoints)
|
static
MAXON_METHOD
Result
<
BaseArray
<
BaseArray
<
Int
> > >
|
CalculateConvexDecomposition2D
(const
Block
< const
Vector2d
> &outlinePoints)
|
static
MAXON_METHOD
Result
<
Bool
>
|
CleanLoop2DInPlace
(
BaseArray
<
Vector2d
> &outlinePoints,
Bool
maintainStart)
|
static
MAXON_METHOD
Result
<
BaseArray
<
Vector2d
> >
|
CalculateNoFitPolygonForConvex
(const
Block
< const
Vector2d
> &outlinePointsA, const
Block
< const
Vector2d
> &outlinePointsB,
Bool
relativeBToA=true)
|
static
MAXON_METHOD
Result
<
BaseArray
<
Vector2d
> >
|
CalculateNoFitPolygonUsingSliding
(const
Block
< const
Vector2d
> &outlinePointsA, const
Block
< const
Vector2d
> &outlinePointsB,
Bool
relativeBToA=true)
|
static
MAXON_METHOD
Result
<
BaseArray
<
Vector2d
> >
|
CalculateInnerFitPolygonUsingSliding
(const
Block
< const
Vector2d
> &outlinePointsCcwA, const
Block
< const
Vector2d
> &outlinePointsB)
|
static
MAXON_METHOD
Result
<
BaseArray
<
Vector2d
> >
|
CalculateNoFitPolygonForConvex
(const
Block
< const
Vector2d
> &outlinePointsA, const
Block
< const
Vector2d
> &outlinePointsB, const
Matrix2d
&transformA, const
Matrix2d
&transformB,
Bool
relativeBToA=true)
|
static
MAXON_METHOD
Result
<
BaseArray
<
Vector2d
> >
|
CalculateNoFitPolygonUsingSliding
(const
Block
< const
Vector2d
> &outlinePointsA, const
Block
< const
Vector2d
> &outlinePointsB, const
Matrix2d
&transformA, const
Matrix2d
&transformB,
Bool
relativeBToA=true)
|
static
MAXON_METHOD
Result
<
BaseArray
<
BaseArray
<
Vector2d
> > >
|
CalculateUnionOfPolygons
(const
Block
< const
Vector2d
> &outlinePointsA, const
Block
< const
Vector2d
> &outlinePointsB,
Bool
includeHolesInResult,
Bool
createOuterLoop=true)
|
static
MAXON_METHOD
Bool
|
IntersectsSegmentsExact2D
(const
Vector2d
&segment1Point1, const
Vector2d
&segment1Point2, const
Vector2d
&segment2Point1, const
Vector2d
&segment2Point2,
Vector2d
&intersectionPoint,
Bool
&areParallel,
Vector2d
*intersectionPoint2=nullptr,
Float
tolerance=0.0_f)
|
static
MAXON_METHOD
LOOP_OVERLAP_STATE
|
GetContainmentStateForNonIntersectingLoops
(const
Block
< const
Vector2d
> &outlinePointsA, const
Block
< const
Vector2d
> &outlinePointsB)
|
static
MAXON_METHOD
Bool
|
AreLoopsEqualToWithinTolerance
(const
Block
< const
Vector2d
> &loopA, const
Block
< const
Vector2d
> &loopB,
Bool
allowCyclicRotation=true,
Bool
ignoreTranslationOffset=true,
maxon::Float
tol=
maxon::GeomConstants::EPSILON5
)
|
static
MAXON_METHOD
void
|
CalculateBoundingBoxIndices
(const
Block
< const
Vector2d
> &verts,
Int
&minIdxX,
Int
&maxIdxX,
Int
&minIdxY,
Int
&maxIdxY,
Bool
findMostCounterClockwise)
|
成员函数文档编制
◆
MAXON_INTERFACE_NONVIRTUAL()
◆
LinearRemapToRange()
Remaps a value from one range to another.
-
参数
-
[in]
|
value
|
The value to remap.
|
[in]
|
from1
|
First bound of source range.
|
[in]
|
to1
|
Second bound of source range.
|
[in]
|
from2
|
First bound of destination range.
|
[in]
|
to2
|
Second bound of destination range.
|
-
返回
-
The remapped value.
◆
GetAngle2D()
Gets the 2D angle between two direction vectors.
-
参数
-
[in]
|
direction1
|
First direction vector.
|
[in]
|
direction2
|
Second direction vector.
|
-
返回
-
The angle value in between 0 and 2PI in radians.
◆
InterpolatePointOnSegment()
static
MAXON_METHOD
Float
InterpolatePointOnSegment
|
(
|
const
向量
&
|
segmentPoint1
,
|
|
|
const
向量
&
|
segmentPoint2
,
|
|
|
const
向量
&
|
point
,
|
|
|
Bool
|
clamp
=
true
|
|
)
|
|
|
|
static
|
Calculates the normalized position of a point along a directed segment.
-
参数
-
[in]
|
segmentPoint1
|
First segment point.
|
[in]
|
segmentPoint2
|
Second segment point.
|
[in]
|
point
|
The point position along the segment line.
|
[in]
|
clamp
|
If true the resulting value will be clamped between 0 and 1.
|
-
返回
-
The normalized position of the point on the segment.
◆
InterpolatePointOnSegment2D()
Calculates the normalized position of a 2D point along a directed segment.
-
参数
-
[in]
|
segmentPoint1
|
First segment point.
|
[in]
|
segmentPoint2
|
Second segment point.
|
[in]
|
point
|
The point position along the segment line.
|
[in]
|
clamp
|
If true the resulting value will be clamped between 0 and 1.
|
-
返回
-
The normalized position of the point on the segment.
◆
CalculateBestFitPlane()
Calculates the the best fit plane centroid and normal from a point cloud.
-
参数
-
[in]
|
pointCloud
|
A block filled with point coordinates.
|
[out]
|
centroid
|
The resulting point cloud centroid.
|
[out]
|
normal
|
The resulting plane normal.
|
[in]
|
iterMax
|
Max iteration for computation.
|
-
返回
-
True if successful otherwise false.
◆
Points3Dto2D()
[1/2]
Projects 3D points as 2D points on a plane which is parallel to the points best fit plane and which passes through the origin of the world coordinate system.
-
参数
-
[in]
|
points
|
Points 3D positions to project.
|
[in]
|
normal
|
The normal vector of the plane onto which to project the points.
|
[in,out]
|
basisVector0
|
First basis vector of the 2D plane coordinate system.
|
[in,out]
|
basisVector1
|
Second basis vector of the 2D plane coordinate system.
|
[out]
|
translate
|
Translation vector between the projection plane origin (which is the world CS origin) and the best fit plane origin (which is the orthogonal projection of the world CS origin to the fit plane). In other words, translation vector is the distance vector between the projection plane an the best fit planes.
|
[in]
|
checkDegenerated
|
If true try to avoid cases where the resulting 2d outline contains coincident vertices.
|
[out]
|
outPoints
|
Array
containing 2D projected points positions.
|
[out]
|
computeBasis
|
Compute basis vectors from the normal and the input points if enabled.
|
-
返回
-
OK on success. DegeneratedInputError if input points are collapsed in one point.
◆
Points3Dto2D()
[2/2]
Projects 3D points as 2D points on a plane. Overloaded function.
-
参数
-
[in]
|
points
|
Points 3D positions to project.
|
[in]
|
normal
|
The normal vector of the plane onto which to project the points.
|
[in]
|
checkDegenerated
|
If true try to avoid cases where the resulting 2d outline contains coincident vertices.
|
[out]
|
outPoints
|
Array
containing 2D projected points positions.
|
-
返回
-
OK on success. DegeneratedInputError if input points are collapsed in one point.
◆
Point2Dto3D()
Calculates 3D world point coordinates from its 2D local coordinates.
-
参数
-
[in]
|
point
|
Point 2D local coordinates.
|
[in]
|
basisVector0
|
First basis vector of the 2D local coordinate system.
|
[in]
|
basisVector1
|
Second basis vector of the 2D local coordinate system.
|
[in]
|
translate
|
Translation vector.
|
-
返回
-
Point 3D world coordinates.
◆
Points2Dto3D()
Calculates 3D world points coordinates from its 2D local coordinates.
-
参数
-
[in]
|
points
|
Points 2D local coordinates.
|
[in]
|
basisVector0
|
First basis vector of the 2D local coordinate system.
|
[in]
|
basisVector1
|
Second basis vector of the 2D local coordinate system.
|
[in]
|
translate
|
Translation vector.
|
[out]
|
outPoints
|
Points 3D world coordinates.
|
◆
CalculateTriangleArea()
Calculates the area of a triangle.
-
参数
-
[in]
|
a
|
Triangle point A.
|
[in]
|
b
|
Triangle point B.
|
[in]
|
c
|
Triangle point C.
|
-
返回
-
Unsigned triangle area.
◆
CalculateSignedTriangleArea()
[1/2]
Calculates the signed area of an oriented triangle. Sign is defined as the sign of the z coordinate of the triangle normal vector.
-
参数
-
[in]
|
a
|
Triangle point A.
|
[in]
|
b
|
Triangle point B.
|
[in]
|
c
|
Triangle point C.
|
-
返回
-
Unsigned triangle area.
◆
CalculateQuadrangleArea()
Calculates the area of a quadrangle.
-
参数
-
[in]
|
a
|
Quadrangle point A.
|
[in]
|
b
|
Quadrangle Point B.
|
[in]
|
c
|
Quadrangle Point C.
|
[in]
|
d
|
Quadrangle Point D.
|
-
返回
-
Unsigned area of Quadrangle.
◆
CalculateOutlineArea()
Calculates the unsigned area of an outline defined by points in outlinePoints. If the points are not co-planar, they will be flattened on a "best fit" plane.
-
参数
-
[in]
|
outlinePoints
|
An array with a point sequence.
|
-
返回
-
The outline area.
◆
CalculateOutlineNormal()
[1/2]
Calculates the normal of an ngon outline.
-
参数
-
[in]
|
points
|
A list of points that includes the outline points.
|
[in]
|
indices
|
The indices in the points list for the outline points to use. The order is important.
|
[in]
|
normalized
|
If true, the output normal will be normalized.
|
-
返回
-
The normal of the point outline.
◆
CalculateOutlineNormal()
[2/2]
Calculates the normal of an ngon outline.
-
参数
-
[in]
|
points
|
The correctly ordered points that include the points for the outline.
|
[in]
|
normalize
|
If true, the output normal will be normalized.
|
-
返回
-
The normal of the point outline.
◆
IsVertexConvex()
A convexity test for vertex in between 2 other vertices in 3D space.
-
参数
-
[in]
|
vertex
|
The vertex to check.
|
[in]
|
next
|
The next point.
|
[in]
|
pred
|
The prev point.
|
[in]
|
up
|
Up vector or the normal of the polygon.
|
-
返回
-
True if vertex is convex otherwise false, in case of aligned point (angle == PI) return true.
◆
IsVertexConvexExact()
A convexity test for vertex in between 2 other vertices in 3D space. This is the same test as IsVertexConvex, but explicitly reports degenerate cases.
-
参数
-
[in]
|
vertex
|
The vertex to check.
|
[in]
|
next
|
The next point.
|
[in]
|
pred
|
The prev point.
|
[in]
|
up
|
Up vector or the normal of the polygon.
|
-
返回
-
The detectected state
◆
CalculateMeanValueCoordinatesWeights()
[1/3]
Calculates the mean value coordinates weights for a point inside an outline.
-
参数
-
[in]
|
point
|
The point for which to calculate weights.
|
[in]
|
outline
|
The outline.
|
[in]
|
weights
|
Array
of weights. The amount of entries in the resulting array is the same amount of outline vertices.
|
-
返回
-
OK on success.
◆
CalculateMeanValueCoordinatesWeights()
[2/3]
Calculates the mean value coordinates weights for a point inside an outline.
-
参数
-
[in]
|
point
|
The point for which to calculate weights.
|
[in]
|
points
|
A list of points that the outlineIndices reference to.
|
[in]
|
outlineIndices
|
The indices of the outline.
|
[in]
|
normal
|
The normal direction of the outline.
|
[in]
|
weights
|
Array
of weights. The amount of entries in the resulting array is the same amount of outline vertices.
|
-
返回
-
OK on success.
◆
IsVertexConvex2D()
A convexity test for vertex in between two other vertices in 2D.
-
参数
-
[in]
|
vertex
|
The vertex to check.
|
[in]
|
next
|
The next point.
|
[in]
|
pred
|
The prev point.
|
-
返回
-
True if vertex is convex otherwise false, in case of aligned point (angle == PI) return true.
◆
IsVertexConvexExact2D()
A convexity test for vertex in between 2 other vertices in 2D This is the same test as IsVertexConvex, but explicitly reports degenerate cases.
-
参数
-
[in]
|
vertex
|
The vertex to check.
|
[in]
|
next
|
The next point.
|
[in]
|
pred
|
The prev point.
|
-
返回
-
The detectected state
◆
CalculateBarycentricCoordinate()
Calculates the barycentric UV coordinate of a point within a triangle.
-
参数
-
[in]
|
point
|
The point.
|
[in]
|
a
|
Triangle vertex A.
|
[in]
|
b
|
Triangle vertex B.
|
[in]
|
c
|
Triangle vertex C.
|
-
返回
-
The barycentric point coordinate. 'x' component of the vector is the coordinate of the point
c
, 'y' component of the vector is the coordinate of the point
b
.
◆
CalculateBarycentricCoordinate3D()
static
MAXON_METHOD
向量
CalculateBarycentricCoordinate3D
|
(
|
const
向量
&
|
point
,
|
|
|
const
向量
&
|
a
,
|
|
|
const
向量
&
|
b
,
|
|
|
const
向量
&
|
c
|
|
)
|
|
|
|
static
|
Calculates the barycentric UVW coordinate of a point within a triangle.
-
参数
-
[in]
|
point
|
The point.
|
[in]
|
a
|
Triangle vertex A.
|
[in]
|
b
|
Triangle vertex B.
|
[in]
|
c
|
Triangle vertex C.
|
-
返回
-
The barycentric point coordinate.
◆
PointInTriangle()
Checks if a point is inside a triangle.
-
参数
-
[in]
|
point
|
The point to test.
|
[in]
|
a
|
Triangle vertex A.
|
[in]
|
b
|
Triangle vertex B.
|
[in]
|
c
|
Triangle vertex C.
|
-
返回
-
True if point is inside the triangle.
◆
PointInTriangle2D()
Checks if a point is inside triangle in 2D.
-
参数
-
[in]
|
point
|
The point to test.
|
[in]
|
a
|
Triangle vertex A.
|
[in]
|
b
|
Triangle vertex B.
|
[in]
|
c
|
Triangle vertex C.
|
-
返回
-
True if point is inside the triangle.
◆
GetPointInPolygonWindingNumber2D()
[1/2]
Checks if a point is inside an outline.
-
参数
-
[in]
|
point
|
The point ot test.
|
[in]
|
outline
|
The array with outline points.
|
-
返回
-
The resulting winding number, 0 means point is outside.
◆
GetPointInPolygonWindingNumber2DExact()
Checks if a point is inside an outline. Exact yet slower version.
-
参数
-
[in]
|
point
|
The point ot test.
|
[in]
|
outline
|
The array with outline points.
|
-
返回
-
The resulting winding number, 0 means point is outside.
◆
GetPointInPolygonWindingNumber2D()
[2/2]
Checks if a point is inside an outline.
-
参数
-
[in]
|
point
|
The point ot test.
|
[in]
|
outline
|
The array with outline points.
|
[out]
|
edgeHit
|
In case point lies on an outline edge this will be filled with the edge index, otherwise
maxon::InvalidArrayIndex
.
|
-
返回
-
The resulting winding number, 0 means point is outside.
◆
GetPointInPolygonWindingNumber()
[1/2]
Checks if a point is inside an outline. Accepts 3d vectors but assumes points to lie in xy plane.
-
参数
-
[in]
|
point
|
The point to test.
|
[in]
|
outline
|
The array with outline points.
|
-
返回
-
The resulting winding number. 0 means point is outside.
◆
GetPointInPolygonWindingNumber()
[2/2]
Checks if a point is inside an outline. Accepts 3d vectors but assumes points to lie in xy plane.
-
参数
-
[in]
|
point
|
The point to test.
|
[in]
|
outline
|
The array with outline points.
|
[out]
|
edgeHit
|
In case point lies on an outline edge, this will be filled with the edge index. Otherwise the value
maxon::InvalidArrayIndex
is set.
|
-
返回
-
The resulting winding number. 0 means point is outside.
◆
PointInOutline2D()
Checks if a point is inside an outline.
-
参数
-
[in]
|
point
|
The point ot test.
|
[in]
|
outline
|
The array with outline points.
|
-
返回
-
True if the point is inside the outline.
◆
PointInOutlineRobust2D()
Checks if a point is inside an outline.
-
参数
-
[in]
|
point
|
The point ot test.
|
[in]
|
outline
|
The array with outline points.
|
-
返回
-
True if the point is inside the outline.
◆
CalculateBisector()
Calculates the 3D bisector angle using an up vector to identify the sliding surface. A custom weight for each side can optionally be specified.
-
参数
-
[in]
|
v1
|
First vector.
|
[in]
|
v2
|
Second vector.
|
[in]
|
up
|
The up vector.
|
[in]
|
w1
|
Optional weight value for v1.
|
[in]
|
w2
|
Optional weight value for v2.
|
-
返回
-
The bisector angle vector.
◆
CalculateCircumcenter2D()
Calculates the circumcenter and radius of a planar triangle.
-
参数
-
[in]
|
a
|
Triangle point A.
|
[in]
|
b
|
Triangle point B.
|
[in]
|
c
|
Triangle point C.
|
[out]
|
center
|
Triangle circumcenter.
|
[out]
|
sqrRad
|
Squared radius of the circle defined by the triangle points.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
False if the points are collinear or if the triangle is collapsed, true otherwise.
◆
CalculateCircumcenter()
Calculates the circumcenter and radius of a triangle.
-
参数
-
[in]
|
a
|
Triangle point A.
|
[in]
|
b
|
Triangle point B.
|
[in]
|
c
|
Triangle point C.
|
[out]
|
center
|
Triangle circumcenter.
|
[out]
|
rad
|
Radius of the circle defined by the triangle points.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
False if the points are collinear or if the triangle is collapsed, true otherwise.
◆
SegmentsIntersectionTest2D()
Checks if two segments intersect in 2D space.
-
参数
-
[in]
|
segment1Point1
|
First segment point 1.
|
[in]
|
segment1Point2
|
First segment point 2.
|
[in]
|
segment2Point1
|
Second segment point 1.
|
[in]
|
segment2Point2
|
Second segment point 2.
|
-
返回
-
True if the segments intersect in 2D.
◆
SegmentRayIntersectionTest2D()
Checks if a segment is intersected by a ray in 2D space.
-
参数
-
[in]
|
segmentPoint1
|
Segment
point 1.
|
[in]
|
segmentPoint2
|
Segment
point 2.
|
[in]
|
rayStartPoint
|
Line start point.
|
[in]
|
rayDirection
|
Line Direction.
|
-
返回
-
True if the segments intersect in 2D.
◆
IntersectSegments2D()
Checks if two segment intersect in 2D space and calculates the intersection point (if any).
-
参数
-
[in]
|
segment1Point1
|
First segment point.
|
[in]
|
segment1Point2
|
First segment point.
|
[in]
|
segment2Point1
|
Second segment point.
|
[in]
|
segment2Point2
|
Second segment point.
|
[out]
|
intersectionPoint
|
Calculated intersection point in xy plane.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation by default = 0.0.
|
-
返回
-
True if the segments intersect in 2D.
◆
LineLineDistance()
Calculates min distance for given lines, fill param1/param2 with parametrized distance form first point.
-
参数
-
[in]
|
line1Point
|
A point on first line.
|
[in]
|
line1Dir
|
First line direction vector.
|
[in]
|
line2Point
|
A point on second line.
|
[in]
|
line2Dir
|
Second line direction vector.
|
[out]
|
parallel
|
The function set it true if the tow line are parallel.
|
[out]
|
param1
|
Parametrized distance from fist line first point where the distance is calculated (p = line1Point + !line1Dir * param1)
|
[out]
|
param2
|
Parametrized distance from second line first point where the distance is calculated (p = line2Point + !line2Dir * param2)
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
Distance Vector.
◆
PointInSegment2D()
Checks if a point is on a line segment in 2D. The tolerance value is used for the colinearity test only, not for the boundary test.
-
参数
-
[in]
|
point
|
The point to check.
|
[in]
|
segmentPoint1
|
1st
Segment
point.
|
[in]
|
segmentPoint2
|
2nd
Segment
point.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if point is on segment, otherwise false.
◆
PointInSegment()
Checks if a point is on a line segment in 3D. The tolerance value is used for the colinearity test only, not for the boundary test.
-
参数
-
[in]
|
point
|
The point to check.
|
[in]
|
segmentPoint1
|
1st
Segment
point.
|
[in]
|
segmentPoint2
|
2nd
Segment
point.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if point is on segment, otherwise false.
◆
PointInHalfLine()
Checks if a point is on a half line.
-
参数
-
[in]
|
point
|
The point to check.
|
[in]
|
halfLineOrigin
|
Half line origin.
|
[in]
|
halfLineDir
|
Half line direction.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if point is on half line, otherwise false.
◆
IntersectLines()
Checks for intersection between two lines and fills intersectionPoint with the intersection position.
-
参数
-
[in]
|
line1Point
|
A point on 1st line.
|
[in]
|
line1Dir
|
1st line direction vector.
|
[in]
|
line2Point
|
A point on 2nd line.
|
[in]
|
line2Dir
|
2nd line direction vector.
|
[out]
|
intersectionPoint
|
Resulting intersection position if intersection happens.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if an intersection happens otherwise false.
◆
IntersectLineSegment()
Checks for line vs. segment intersection and fills intersection with the intersection position.
-
参数
-
[in]
|
linePoint
|
A point on the line.
|
[in]
|
lineDir
|
Line direction vector.
|
[in]
|
segmentPoint1
|
First segment point.
|
[in]
|
segmentPoint2
|
Second segment point.
|
[out]
|
intersectionPoint
|
Resulting intersection position if intersection happens.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if an intersection happens otherwise false.
◆
IntersectSegments()
Checks for segment vs. segment intersection and fills intersection with the intersection position.
-
参数
-
[in]
|
segment1Point1
|
First
Segment
first point.
|
[in]
|
segment1Point2
|
First
Segment
second point.
|
[in]
|
segment2Point1
|
Second
Segment
first point.
|
[in]
|
segment2Point2
|
Second
Segment
second point.
|
[out]
|
intersectionPoint
|
Resulting intersection position if intersection happens.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if an intersection happens otherwise false.
◆
IntersectHalfLines()
Checks for halfline/halfline intersection and fills intersectionPoint with the intersection position.
-
参数
-
[in]
|
halfLine1Origin
|
Start point 1st half line.
|
[in]
|
halfLine1Dir
|
1st half line direction vector.
|
[in]
|
halfLine2Origin
|
Start point 2nd half line.
|
[in]
|
halfLine2Dir
|
2nd half line direction vector.
|
[out]
|
intersectionPoint
|
Resulting intersection position if intersection happens.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if an intersection happens otherwise false.
◆
IntersectLineHalfLine()
Checks for line/halfline intersection and fills intersectionPoint with the intersection position.
-
参数
-
[in]
|
linePoint
|
A point on the line.
|
[in]
|
lineDir
|
Line direction vector.
|
[in]
|
halfLineOrigin
|
Start point of Half line.
|
[in]
|
halfLineDir
|
Half line direction vector.
|
[out]
|
intersectionPoint
|
Intersection position if intersection happens.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if an intersection happens otherwise false.
◆
IntersectHalfLineSegment()
Checks for halfLine/segment Intersection and fills intersectionPoint with the intersection position.
-
参数
-
[in]
|
halfLineOrigin
|
Start point of Half line.
|
[in]
|
halfLineDir
|
Half line direction vector.
|
[in]
|
segmentPoint1
|
First
Segment
point.
|
[in]
|
segmentPoint2
|
Second
Segment
point.
|
[out]
|
intersectionPoint
|
Intersection position if intersection happens.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if an intersection happens otherwise false.
◆
IntersectPlanes()
Checks for plane/plane intersection and fills the intersection line.
-
参数
-
[in]
|
plane1Point
|
Plane 1 point.
|
[in]
|
plane1Normal
|
Plane 1 normal.
|
[in]
|
plane2Point
|
Plane 2 point.
|
[in]
|
plane2Normal
|
Plane 2 normal.
|
[out]
|
resLinePoint
|
A point on the intersection line.
|
[out]
|
resLineDirection
|
Intersection line direction.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if an intersection happens otherwise false.
◆
IntersectLinePlane()
[1/2]
Checks for plane/Line intersection and fills intersectionPoint with the intersection position.
-
参数
-
[in]
|
linePoint
|
A point on line.
|
[in]
|
lineDir
|
Line direction vector.
|
[in]
|
planePoint
|
Plane point.
|
[in]
|
planeNormal
|
Plane normal.
|
[out]
|
intersectionPoint
|
Intersection position if intersection happens.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if an intersection happens otherwise false. (line is parallel or lie on the plane)
◆
IntersectLinePlane()
[2/2]
Checks for plane/line intersection and fills intersectionPoint with the intersection position.
-
参数
-
[in]
|
linePoint
|
A point on line.
|
[in]
|
lineDir
|
Line direction vector.
|
[in]
|
planePoint
|
Plane point.
|
[in]
|
planeNormal
|
Plane normal.
|
[out]
|
intersectionPoint
|
Intersection position if intersection happens.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if an intersection happens otherwise false. (line is parallel or lie on the plane)
◆
IntersectSegmentPlane()
Checks for plane/segment intersection and fills intersectionPoint with the intersection position.
-
参数
-
[in]
|
segmentPoint1
|
Segment
point 1.
|
[in]
|
segmentPoint2
|
Segment
point 2.
|
[in]
|
planePoint
|
Plane point.
|
[in]
|
planeNormal
|
Plane normal.
|
[out]
|
intersectionPoint
|
Intersection position if intersection happens.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if an intersection happens otherwise false.
◆
IntersectHalfLinePlane()
Checks for plane/halfline intersection and fills intersectionPoint with the intersection position.
-
参数
-
[in]
|
halfLinePoint
|
Half line Origin.
|
[in]
|
halfLineDir
|
Half line direction vector.
|
[in]
|
planePoint
|
Plane point.
|
[in]
|
planeNormal
|
Plane normal.
|
[out]
|
intersectionPoint
|
Intersection position if intersection happens.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if an intersection happens otherwise false.
◆
IntersectLineTriangle()
Checks for line/triangle intersection and fills intersectionPoint with the intersection position.
-
参数
-
[in]
|
linePoint
|
A point on the line.
|
[in]
|
lineDir
|
The line direction vector.
|
[in]
|
a
|
Triangle vertex.
|
[in]
|
b
|
Triangle vertex.
|
[in]
|
c
|
Triangle vertex.
|
[out]
|
intersectionPoint
|
Intersection position if intersection happens.
|
[out]
|
barycCoords
|
In case of intersection the pointr is filled with barycentric coordinates of the hit point, can be nullptr.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if an intersection happens otherwise false.
◆
IntersectHalfLineTriangle()
Checks for halfline/triangle intersection and fills intersectionPoint with the intersection position.
-
参数
-
[in]
|
halfLineOrigin
|
Half line origin point.
|
[in]
|
halfLineDir
|
The half line direction vector.
|
[in]
|
a
|
Triangle vertex.
|
[in]
|
b
|
Triangle vertex.
|
[in]
|
c
|
Triangle vertex.
|
[out]
|
intersectionPoint
|
Intersection position if intersection happens.
|
[out]
|
barycCoords
|
In case of intersection the pointr is filled with barycentric coordinates of the hit point, can be nullptr.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if an intersection happens otherwise false.
◆
IntersectLineQuadrangle()
Checks for line/quadrangle intersection and fills intersectionPoint with the intersection position.
-
参数
-
[in]
|
linePoint
|
A point on the line.
|
[in]
|
lineDir
|
The line direction vector.
|
[in]
|
a
|
Quadrangle vertex.
|
[in]
|
b
|
Quadrangle vertex.
|
[in]
|
c
|
Quadrangle vertex.
|
[in]
|
d
|
Quadrangle vertex.
|
[out]
|
intersectionPoint
|
Intersection position if intersection happens.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if an intersection happens otherwise false.
◆
IntersectHalfLineQuadrangle()
Checks for halfline/quadrangle intersection and fills intersectionPoint with the intersection position.
-
参数
-
[in]
|
halfLineOrigin
|
Half line origin point.
|
[in]
|
halfLineDir
|
The half line direction vector.
|
[in]
|
a
|
Quadrangle vertex.
|
[in]
|
b
|
Quadrangle vertex.
|
[in]
|
c
|
Quadrangle vertex.
|
[in]
|
d
|
Quadrangle vertex.
|
[out]
|
intersectionPoint
|
Intersection position if intersection happens.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if an intersection happens otherwise false.
◆
IntersectSegmentTriangle()
Checks for linesegment/triangle intersection and fills intersectionPoint with the intersection position.
-
参数
-
[in]
|
segmentPoint1
|
Segment
point.
|
[in]
|
segmentPoint2
|
Segment
point.
|
[in]
|
a
|
Triangle vertex.
|
[in]
|
b
|
Triangle vertex.
|
[in]
|
c
|
Triangle vertex.
|
[out]
|
intersectionPoint
|
Intersection position if intersection happens.
|
[out]
|
barycCoords
|
In case of intersection the pointr is filled with barycentric coordinates of the hit point, can be nullptr.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if an intersection happens otherwise false.
◆
TrianglesIntersectionTest()
Checks if 2 triangles intersect.
-
参数
-
[in]
|
t1a
|
Triangle 1 vertex.
|
[in]
|
t1b
|
Triangle 1 vertex.
|
[in]
|
t1c
|
Triangle 1 vertex.
|
[in]
|
t2a
|
Triangle 2 vertex.
|
[in]
|
t2b
|
Triangle 2 vertex.
|
[in]
|
t2c
|
Triangle 2 vertex.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation.
|
-
返回
-
True if an intersection happens otherwise false.
◆
CalculatePolygonPointST()
Calculates a S/T coordinate for a given 3D point and polygon in the polygon plane. The 3D point needs to be on the plane that is defined by the polygon. The function is just a 2d evaluation so not coplanar polygons need to be evaluated by projecting vertex on best fit plane.
-
参数
-
[in]
|
point
|
The point to find s and t.
|
[in]
|
pa
|
Polygon point.
|
[in]
|
pb
|
Polygon point.
|
[in]
|
pc
|
Polygon point.
|
[in]
|
pd
|
Polygon point.
|
[in]
|
isQuad
|
If true evaluate using a quadrangle, otherwise ignore pd and use a triangle.
|
[out]
|
s
|
The resulting s coordinate, or MINVLAUE_FLOAT if the functions fail.
|
[out]
|
t
|
The resulting t coordinate, or MINVLAUE_FLOAT if the functions fail.
|
[in]
|
tolerance
|
Geometric linear tolerance for the operation, used to define if the point is inside of polygon or not.
|
-
返回
-
True if the point is in the polygon boundary otherwise false (negative s or t values).
◆
InverseBilinarInterpolate()
static
MAXON_METHOD
void InverseBilinarInterpolate
|
(
|
const
向量
&
|
pa
,
|
|
|
const
向量
&
|
pb
,
|
|
|
const
向量
&
|
pc
,
|
|
|
const
向量
&
|
pd
,
|
|
|
const
向量
&
|
point
,
|
|
|
Vector2d
&
|
bilinarVariables
|
|
)
|
|
|
|
static
|
Calculates the bilinear coordinates of a point in a quad. The quad is defined by the points pa, pb, pc and pd.
-
参数
-
[in]
|
pa
|
Polygon point.
|
[in]
|
pb
|
Polygon point.
|
[in]
|
pc
|
Polygon point.
|
[in]
|
pd
|
Polygon point.
|
[in]
|
point
|
The point to find the bilinear interpolation values for.
|
[out]
|
bilinarVariables
|
The resulting coordinates.
|
◆
InverseBilinarInterpolateNewton()
static
MAXON_METHOD
void InverseBilinarInterpolateNewton
|
(
|
const
向量
&
|
pa
,
|
|
|
const
向量
&
|
pb
,
|
|
|
const
向量
&
|
pc
,
|
|
|
const
向量
&
|
pd
,
|
|
|
const
向量
&
|
point
,
|
|
|
Int32
|
iterations
,
|
|
|
Vector2d
&
|
bilinarVariables
|
|
)
|
|
|
|
static
|
Calculates the bilinear coordinates of a point in a quad with a Newton iteration method. The quad is defined by the points pa, pb, pc and pd.
-
参数
-
[in]
|
pa
|
Polygon point.
|
[in]
|
pb
|
Polygon point.
|
[in]
|
pc
|
Polygon point.
|
[in]
|
pd
|
Polygon point.
|
[in]
|
point
|
The point to find the bilinear interpolation values for.
|
[in]
|
iterations
|
The iteration count of the Newton iteration.
|
[out]
|
bilinarVariables
|
The resulting coordinates.
|
◆
InverseBilinarInterpolate2D()
Calculates the bilinear coordinates of a 2d point in a 2d quad. The quad is defined by the points pa, pb, pc and pd.
-
参数
-
[in]
|
pa
|
Polygon 2d point.
|
[in]
|
pb
|
Polygon 2d point.
|
[in]
|
pc
|
Polygon 2d point.
|
[in]
|
pd
|
Polygon 2d point.
|
[in]
|
point
|
The 2d point to find the bilinear interpolation values for.
|
[out]
|
bilinarVariables
|
The resulting coordinates.
|
◆
InverseBilinarInterpolate2DNewton()
Calculates the bilinear coordinates of a 2d point in a 2d quad with a Newton iteration method. The quad is defined by the points pa, pb, pc and pd.
-
参数
-
[in]
|
pa
|
Polygon 2d point.
|
[in]
|
pb
|
Polygon 2d point.
|
[in]
|
pc
|
Polygon 2d point.
|
[in]
|
pd
|
Polygon 2d point.
|
[in]
|
point
|
The 2d point to find the bilinear interpolation values for.
|
[in]
|
iterations
|
The iteration count of the Newton iteration.
|
[out]
|
bilinarVariables
|
The resulting coordinates.
|
◆
BilinearInterpolate()
Calculates the bilinear interpolation within a quad. The quad is defined by the points pa, pb, pc and pd.
-
参数
-
[in]
|
pa
|
Polygon point.
|
[in]
|
pb
|
Polygon point.
|
[in]
|
pc
|
Polygon point.
|
[in]
|
pd
|
Polygon point.
|
[in]
|
s
|
The first bilinar coordinate.
|
[in]
|
t
|
The second bilinear coordinate.
|
-
返回
-
The point in space with these bilinear coordinates relative to the quad pa, pb, pc and pd.
◆
CalculateSignedTriangleArea()
[2/2]
Calculates the signed area of an oriented triangle. Sign is defined as the sign of the z coordinate of the triangle normal vector.
-
参数
-
[in]
|
a
|
Triangle point A.
|
[in]
|
b
|
Triangle point B.
|
[in]
|
c
|
Triangle point C.
|
[in]
|
normal
|
The reference normal to calculate the sign.
|
-
返回
-
Unsigned triangle area.
◆
CalculateMeanValueCoordinatesWeights()
[3/3]
Calculates the mean value coordinates weights for a point inside an outline.
-
参数
-
[in]
|
point
|
The point for which to calculate weights.
|
[in]
|
outline
|
The outline.
|
[in]
|
normal
|
The normal direction of the outline.
|
[in]
|
weights
|
Array
of weights. The amount of entries in the resulting array is the same amount of outline vertices.
|
-
返回
-
OK on success.
◆
CalculatePerimeterLength2D()
Calculates the perimeter length for an outline defined by a loop of points in outlinePoints.
-
参数
-
[in]
|
outlinePoints
|
An array with a point sequence defining the perimeter.
|
-
返回
-
The perimeter
◆
IsWoundClockwise2D()
Determines whether outline defined by a loop of points is would clockwise or not This is only meaningful if the loop has no self crossings.
-
参数
-
[in]
|
outlinePoints
|
An array with a point sequence defining the perimeter.
|
-
返回
-
Whether loop is wound clockwise
◆
CalculateOutlineCentroidAndArea2D()
Calculates the centroid coordinates for an outline defined by a loop of points in outlinePoints.
-
参数
-
[in]
|
outlinePoints
|
An array with a point sequence.
|
[out]
|
area
|
If non-null, then pointed value is set to the enclosed area.
|
[out]
|
windingPolarity
|
If non-null, then pointed value contains the winding direction of the loop.
|
-
返回
-
The centroid coordinates.
◆
CalculateMultiOutlineCentroidAndAreas2D()
Calculates the centroid coordinates for an outline with optional holes, defined by loop(s) of vertices.
-
参数
-
[in]
|
loopVertices
|
An array with one or more point sequences which define perimeter loop followed by any hole loops. All loops are ASSUMED to neither overlap nor intersect, and first loop must enclose all others.
|
[in]
|
loopVertexCounts
|
An array containing the number of vertices in each loop. If no holes, then this will be a single value equal to the number of entries in loopVertices.
|
[in]
|
includeHolesInCogCalcs
|
If true, the holes are considered in calculation of the centroid position. If false, only the first loop (outer perimeter) is considered.
|
[out]
|
overallArea
|
If non-null, then pointed value is set to the enclosed area. Holes are ALWAYS considered in this calculation.
|
[out]
|
loopSoloAreas
|
If non-null, then pointed array contains the areas enclosed by each loop in isolation. Overall area is then the first value minus the sum of the rest.
|
[out]
|
windingPolarity
|
If non-null, then pointed array contains the winding direction of each loop.
|
-
返回
-
The centroid coordinates.
◆
CalculateConvexHull2D()
Calculates the convex hull for an outline, defined by a loop of vertices Note that the polygon is assumed to be non-self intersecting, and with edges formed by the vertices in order. In particular, the vertices are NOT treated as a 'sea of points' - but instead as defining edges; order matters!
-
参数
-
[in]
|
outlinePoints
|
An array with a point sequence representing the perimeter of the polgon
|
-
返回
-
BaseArray
containing the indices of the input array corresponding to the vertices of the convex hull of the polygon.
◆
CalculateConvexDecomposition2D()
Decomposes an outline defined by a loop of vertices into a set of convex parts Note that the polygon is assumed to be non-self intersecting, and with edges formed by the vertices in order. In particular, the vertices are NOT treated as a 'sea of points' - but instead as defining edges; order matters!
-
参数
-
[in]
|
outlinePoints
|
An array with a point sequence representing the perimeter of the polgon
|
-
返回
-
BaseArray
containing
BaseArray
of indices of the input array corresponding to the vertices of each of the convex parts of.
◆
CleanLoop2DInPlace()
Given a loop of vertices, this performs in-place cleaning operations.
-
Duplicated consecutive vertices are removed.
-
Colinear and anti-colinear vertices are removed.
-
参数
-
[in]
|
outlinePoints
|
An array with a point sequence representing the perimeter of the polgon
|
[in]
|
maintainStart
|
If false, then vertex order is rotated such that the first vertex lies on the convex hull. (If it is true, then starting vertex remains unchanged, unless that vertex was removed during cleaning. In this case the new start vertex is the first vertex after that which survived.)
|
-
返回
-
Whether any changes were made.
◆
CalculateNoFitPolygonForConvex()
[1/2]
Given two loops of vertices which represent two convex polygons, this calculates the corresponding No-Fit Polygon NFP of convex polygons never contain internal holes, only the main perimeter, hence only ever a single returned edge loop.
-
参数
-
[in]
|
outlinePointsA
|
An array with a point sequence representing the perimeter of the first convex polygon
|
[in]
|
outlinePointsB
|
An array with a point sequence representing the perimeter of the second convex polygon
|
[in]
|
relativeBToA
|
If true, returned NFP is the result of moving polygon B relative to polygon A. If false then A relative to B.
|
-
返回
-
The resulting NoFit polygon
◆
CalculateNoFitPolygonUsingSliding()
[1/2]
Given two loops of vertices which represent two polygons, this calculates the corresponding No-Fit Polygon using the sliding method. Internal holes are NOT generated, only the main perimeter, hence only ever a single returned edge loop.
-
参数
-
[in]
|
outlinePointsA
|
An array with a point sequence representing the perimeter of the first polygon
|
[in]
|
outlinePointsB
|
An array with a point sequence representing the perimeter of the second polygon
|
[in]
|
relativeBToA
|
If true, returned NFP is the result of moving polygon B relative to polygon A. If false then A relative to B.
|
-
返回
-
The resulting NoFit polygon
◆
CalculateInnerFitPolygonUsingSliding()
Given two loops of vertices which represent two polygons, this calculates the corresponding Inner-Fit Polygon using the sliding method. Internal holes are NOT generated, only the main perimeter, hence only ever a single returned edge loop.
-
参数
-
[in]
|
outlinePointsCcwA
|
An array with a point sequence representing the perimeter of the first polygon. This must be counterclockwise wound.
|
[in]
|
outlinePointsB
|
An array with a point sequence representing the perimeter of the second polygon. This must be clockwise wound.
|
-
返回
-
The resulting Inner-Fit polygon
◆
CalculateNoFitPolygonForConvex()
[2/2]
Given two loops of vertices which represent two convex polygons, this calculates the corresponding No-Fit Polygon NFP of convex polygons never contain internal holes, only the main perimeter, hence only ever a single returned edge loop.
-
参数
-
[in]
|
outlinePointsA
|
An array with a point sequence representing the perimeter of the first convex polygon
|
[in]
|
outlinePointsB
|
An array with a point sequence representing the perimeter of the second convex polygon
|
[in]
|
transformA
|
Transformation to be applied to vertices in A prior to calculation.
|
[in]
|
transformB
|
Transformation to be applied to vertices in B prior to calculation.
|
[in]
|
relativeBToA
|
If true, returned NFP is the result of moving polygon B relative to polygon A. If false then A relative to B.
|
-
返回
-
The resulting NoFit polygon
◆
CalculateNoFitPolygonUsingSliding()
[2/2]
Given two loops of vertices which represent two polygons, this calculates the corresponding No-Fit Polygon using the sliding method. Internal holes are NOT generated, only the main perimeter, hence only ever a single returned edge loop.
-
参数
-
[in]
|
outlinePointsA
|
An array with a point sequence representing the perimeter of the first polygon
|
[in]
|
outlinePointsB
|
An array with a point sequence representing the perimeter of the second polygon
|
[in]
|
transformA
|
Transformation to be applied to vertices in A prior to calculation.
|
[in]
|
transformB
|
Transformation to be applied to vertices in B prior to calculation.
|
[in]
|
relativeBToA
|
If true, returned NFP is the result of moving polygon B relative to polygon A. If false then A relative to B.
|
-
返回
-
The resulting NoFit polygon
◆
CalculateUnionOfPolygons()
Given two loops of vertices which represent two polygon outlines, this calculates the union.
-
参数
-
[in]
|
outlinePointsA
|
An array with a point sequence representing the perimeter of the first polygon
|
[in]
|
outlinePointsB
|
An array with a point sequence representing the perimeter of the second polygon
|
[in]
|
includeHolesInResult
|
If true, then if union shape contains holes, then these are also calculated and returned. If false then only the outer perimeter is returned.
|
[in]
|
createOuterLoop
|
If true, then attempt to generate an outer loop before looking for holes. Otherwise just generate holes.
|
-
返回
-
The resulting union. If this contains multiple loops the first is the outer perimeter and all others represent internal loops (holes). If this is empty, then the outlines do not overlap.
◆
IntersectsSegmentsExact2D()
Checks if two segment intersect in 2D space and calculates the intersection point (if any). If the lines are parallel and intersect: If intersectionPoint2 is nullptr then the midpoint of the intersection range will be returned via 'intersectionPoint' If intersectionPoint2 is non-null, then the start of the intersection range will be returned via 'intersectionPoint', and the end via '*intersectionPoint2'
-
参数
-
[in]
|
segment1Point1
|
First segment point.
|
[in]
|
segment1Point2
|
First segment point.
|
[in]
|
segment2Point1
|
Second segment point.
|
[in]
|
segment2Point2
|
Second segment point.
|
[out]
|
intersectionPoint
|
Calculated intersection point in xy plane. For parallel intersection segments this is the start or mid-point of the overlapping region - see above.
|
[out]
|
areParallel
|
If non null, routine sets to true or false to indicate whether the line segments were detected to be parallel.
|
[out]
|
intersectionPoint2
|
If non null, and segments are colinear and overlapping, then is the end of the overlapping region.
|
[in]
|
tolerance
|
Geometric tolerance for the operation.
|
-
返回
-
True if the segments intersect in 2D.
◆
GetContainmentStateForNonIntersectingLoops()
Given two boundary loops of vertices WHICH ARE KNOWN TO CONTAIN NO INTERSECTIONS, this determines the relative containment state of the two loops.
-
参数
-
[in]
|
outlinePointsA
|
An array with a point sequence representing the perimeter of the first polygon
|
[in]
|
outlinePointsB
|
An array with a point sequence representing the perimeter of the second polygon
|
-
返回
-
The containment state
◆
AreLoopsEqualToWithinTolerance()
Given two boundary loops of vertices, this determines whether the two loops are the same shape. They are deemed to be the same if there are the same number of vertices, and the pairwise vertices have the same coordinates to within the tolerance distance.
-
参数
-
[in]
|
loopA
|
An array with a point sequence representing the first loop
|
[in]
|
loopB
|
An array with a point sequence representing the second loop
|
[in]
|
allowCyclicRotation
|
If true, then cyclically rotated loops are considered equivalent, i.e. the loops don't have to start on the same vertices for a match to be found. Loops which match, but have opposing winding directions are also considered to be a match when this is true. If false then vertices with the same indices must have the same coordinates to declare a match.
|
[in]
|
ignoreTranslationOffset
|
If true then any translational offset between the loops is ignored. I.e. the same shapes at different offsets will be considered to match.
|
[in]
|
tol
|
The position tolerance. If vertices differ by more than this in either x or y then they are considered to be different and non-matching.
|
-
返回
-
Whether the loops represent the same shape.
◆
CalculateBoundingBoxIndices()
Given a set of vertices, returns indices of vertices which lie on each of the maximal extents.
-
参数
-
[in]
|
verts
|
The set of vertices
|
[out]
|
minIdxX
|
The index of a vertex with minimum X extent
|
[out]
|
maxIdxX
|
The index of a vertex with maximum X extent
|
[out]
|
minIdxY
|
The index of a vertex with minimum Y extent
|
[out]
|
maxIdxY
|
The index of a vertex with minimum Y extent
|
[in]
|
findMostCounterClockwise
|
If true then when multiple vertices lie on the same extent, the most counterclockwise one will be the one whose index is returned.
|