C3D Toolkit
Kernel - 117982, Vision - 2.9.2.2
|
Classes | |
class | MbSpaceParamPnt |
A space-parametric point. More... | |
class | MbPointOnCurve< Curve > |
Point on a curve. More... | |
class | MbCrossPoint |
Intersection point of two curves. More... | |
Enumerations | |
enum | MbeIntersectionType { ipt_Simple = 0 , ipt_Tangent = 1 } |
Types of intersection points. More... | |
Functions | |
MbResultType | PointsOnSurface (const MbSurface &surface, MbeStepType stepType, double uValue, double vValue, bool truncateByBounds, RPArray< SArray< MbLocPnt > > &result) |
Create points on a surface. More... | |
MbResultType | PointsOnSurface (const MbSurface &surface, MbeItemGridType &gridType, const MbCartPoint &uv0, double angle, MbeStepType stepType, double step1, double step2, bool truncateByBounds, RPArray< SArray< MbLocPnt > > &result, size_t maxPntsCnt=c3d::ARRAY_MAX_COUNT) |
Create points on a surface. More... | |
void | DefinePointsOnSurfaceCounts (const MbSurface &surface, size_t &uPntsCnt, size_t &vPntsCnt) |
Define the default sampling of a surface. More... | |
MbeNewtonResult | IntersectionPoint (const MbSurface &surf0, bool ext0, const MbSurface &surf1, bool ext1, const MbSurface &surf2, bool ext2, MbCartPoint &uv0, MbCartPoint &uv1, MbCartPoint &uv2) |
Calculate the intersection point of three surfaces. More... | |
void | IntersectionPoints (const MbSurface &surf, bool surfExt, const MbCurve3D &curv, bool curveExt, SArray< MbCartPoint > &uv, SArray< double > &tt, bool touchInclude=false) |
Calculate all the points of intersection of a surface and a curve. More... | |
void | FastLineLine (const MbLine &line1, const MbLine &line2, MbCartPoint &result) |
Calculate the point of two lines intersection. More... | |
int | LineLine (const MbLine &line1, const MbLine &line2, MbCartPoint &result) |
Calculate the point of two lines intersection. More... | |
int | LineLine (const MbLine &line1, const MbLine &line2, MbCrossPoint &result) |
Calculate the point of two lines intersection. More... | |
int | LineLineSeg (const MbLine &line, const MbLineSegment &lseg, MbCrossPoint &result) |
Calculate the intersection point of a line and a line segment. More... | |
int | LineCircle (const MbLine &line, const MbCartPoint ¢re, double radius, MbCrossPoint *result) |
Calculate intersection points of a line and a circle. More... | |
ptrdiff_t | IntersectTwoCurves (const MbCurve &pCurve1, const MbCurve &pCurve2, SArray< MbCrossPoint > &result, bool touchInclude, double epsilon=Math::LengthEps *c3d::METRIC_DELTA, bool allowInaccuracy=true) |
Calculate intersection points of two curves. More... | |
ptrdiff_t | CurveCurveIntersection (const MbCurve &curve1, const MbCurve &curve2, SArray< double > &result1, SArray< double > &result2, double xEpsilon, double yEpsilon, bool touchInclude, bool allowInaccuracy=true) |
Calculate intersection points of two curves. More... | |
void | CurveSelfIntersect (const MbCurve &curve, double xEpsilon, double yEpsilon, SArray< double > &result1, SArray< double > &result2, VERSION version=Math::DefaultMathVersion()) |
Calculate the points of curve self-intersection. More... | |
void | RemoveAllTouchParams (const MbCurve &curve1, const MbCurve &curve2, SArray< MbCrossPoint > &result, double eps=PARAM_NEAR) |
Remove touch points. More... | |
ptrdiff_t | CurveCurveIntersection (const MbCurve3D &curve1, const MbCurve3D &curve2, SArray< double > &result1, SArray< double > &result2, double mEps, VERSION version=Math::DefaultMathVersion()) |
Calculate intersection points of two curves. More... | |
bool | IsSelfIntersect (const MbCurve3D &curve, double mEps=Math::metricRegion) |
Determine if the curve has self-intersections. More... | |
void | FilterTouchParams (const MbCurve3D &curve1, const MbCurve3D &curve2, SArray< double > &result1, SArray< double > &result2, double mEps=Math::metricRegion) |
Remove the tangent intersection points. More... | |
ptrdiff_t | CurveCurveCrossing (const MbCurve3D &curve1, const MbCurve3D &curve2, SArray< double > &result1, SArray< double > &result2, double epsilon=Math::metricRegion) |
Calculate the points of two curves crossing. More... | |
bool | PointProjectionRelativeOuterLoop (const MbSurface &surface, const MbCartPoint3D &pnt, bool byOuterRectOnly, MbCartPoint &result) |
Find the projection of a point on a surface relative to the outer contour of the surface. More... | |
bool | IsMultipleProjection (const MbSurface &surface, const MbCartPoint3D &result) |
Determine whether the point projection is multiple-valued. More... | |
bool | TouchIntersectionPoints (const MbSurface &surf1, bool ext1, const MbSurface &surf2, bool ext2, std::vector< MbCartPoint > &uv1arr, std::vector< MbCartPoint > &uv2arr) |
Calculate the touch points of two surfaces. More... | |
bool | PointsRelativeShell (const std::vector< MbCartPoint3D > &points, const MbFaceShell &shell, std::vector< MbeItemLocation > &pLocs) |
Determine the position of points relative to the shell. More... | |
enum MbeIntersectionType |
MbResultType PointsOnSurface | ( | const MbSurface & | surface, |
MbeStepType | stepType, | ||
double | uValue, | ||
double | vValue, | ||
bool | truncateByBounds, | ||
RPArray< SArray< MbLocPnt > > & | result | ||
) |
Create points on a surface.
Create a group of points on a surface.
[in] | surface | - The source surface. |
[in] | stepType | - Type of spacing on a surface. |
[in] | uValue | - U-spacing value or number of points in u-direction while sampling by parameter |
[in] | vValue | - V-spacing value or number of points in v-direction while sampling by parameter. |
[in] | truncateByBounds | - Whether to truncate by surface boundary. |
[out] | result | - Indexed space-parametric points. |
MbResultType PointsOnSurface | ( | const MbSurface & | surface, |
MbeItemGridType & | gridType, | ||
const MbCartPoint & | uv0, | ||
double | angle, | ||
MbeStepType | stepType, | ||
double | step1, | ||
double | step2, | ||
bool | truncateByBounds, | ||
RPArray< SArray< MbLocPnt > > & | result, | ||
size_t | maxPntsCnt = c3d::ARRAY_MAX_COUNT |
||
) |
Create points on a surface.
Create a group of points on a surface.
[in] | surface | - The source surface. |
[in] | gridType | - A type of a grid on a surface. |
[in] | uv0 | - The central point of the grid. |
[in] | angle | - Rotation angle of the grid relative to U direction (in radians). |
[in] | stepType | - Type of spacing on a surface. |
[in] | step1 | - A spacing value in the first direction |
[in] | step2 | - A spacing value in the second direction |
[in] | truncateByBounds | - Whether to truncate by surface boundary. |
[out] | result | - Indexed space-parametric points. |
[in] | maxPntsCnt | - The maximal acceptable number of points. |
void DefinePointsOnSurfaceCounts | ( | const MbSurface & | surface, |
size_t & | uPntsCnt, | ||
size_t & | vPntsCnt | ||
) |
Define the default sampling of a surface.
Define the default sampling of a surface
(an auxiliary function for function PointsOnSurface).
[in] | surface | - The initial surface. |
[out] | uPntsCnt | - The points number in U direction. |
[out] | vPntsCnt | - The points number in V direction. |
MbeNewtonResult IntersectionPoint | ( | const MbSurface & | surf0, |
bool | ext0, | ||
const MbSurface & | surf1, | ||
bool | ext1, | ||
const MbSurface & | surf2, | ||
bool | ext2, | ||
MbCartPoint & | uv0, | ||
MbCartPoint & | uv1, | ||
MbCartPoint & | uv2 | ||
) |
Calculate the intersection point of three surfaces.
Calculate the intersection point of three surfaces given the initial estimates.
[in] | surf0 | - The first surface. |
[in] | ext0 | - Whether to use the extension of the first surface. |
[in] | surf1 | - The second surface. |
[in] | ext1 | - Whether to use the extension of the second surface. |
[in] | surf2 | - The third surface. |
[in] | ext2 | - Whether to use the extension of the third surface. |
[in,out] | uv0 | - The initial approximation and the result on surface surf0. |
[in,out] | uv1 | - The initial approximation and the result on surface surf1. |
[in,out] | uv2 | - The initial approximation and the result on surface surf2. |
void IntersectionPoints | ( | const MbSurface & | surf, |
bool | surfExt, | ||
const MbCurve3D & | curv, | ||
bool | curveExt, | ||
SArray< MbCartPoint > & | uv, | ||
SArray< double > & | tt, | ||
bool | touchInclude = false |
||
) |
Calculate all the points of intersection of a surface and a curve.
Calculate all the points of intersection of a surface and a curve.
[in] | surf | - A surface. |
[in] | surfExt | - Use the surface extension. |
[in] | curv | - The curve. |
[in] | curveExt | - Use the curve extension. |
[out] | uv | - Parameters of the intersection points on the surface. |
[out] | tt | - Parameters of the intersection points on the curve. |
[in] | touchInclude | - Consider tangencies as intersections. |
|
inline |
Calculate the point of two lines intersection.
Calculate the intersection point of two exactly intersecting lines without check.
[in] | line1 | - The first line. |
[in] | line2 | - The second line. |
[out] | result | - The intersection point. |
int LineLine | ( | const MbLine & | line1, |
const MbLine & | line2, | ||
MbCartPoint & | result | ||
) |
Calculate the point of two lines intersection.
Calculate the point of two lines intersection.
The curves can be parallel or coincident.
[in] | line1 | - The first line. |
[in] | line2 | - The second line. |
[out] | result | - The intersection point. |
int LineLine | ( | const MbLine & | line1, |
const MbLine & | line2, | ||
MbCrossPoint & | result | ||
) |
Calculate the point of two lines intersection.
Calculate the point of two lines intersection.
The curves can be parallel or coincident.
[in] | line1 | - The first line. |
[in] | line2 | - The second line. |
[out] | result | - The intersection point. |
int LineLineSeg | ( | const MbLine & | line, |
const MbLineSegment & | lseg, | ||
MbCrossPoint & | result | ||
) |
Calculate the intersection point of a line and a line segment.
Calculate the intersection point of a line and a line segment.
The line segment can be parallel to the curve or lie on it.
[in] | line | - The line. |
[in] | lseg | - The segment. |
[out] | result | - The intersection point. |
int LineCircle | ( | const MbLine & | line, |
const MbCartPoint & | centre, | ||
double | radius, | ||
MbCrossPoint * | result | ||
) |
Calculate intersection points of a line and a circle.
Calculate the parameters of intersection points of a line and a circle.
[in] | line | - The line. |
[in] | centre | - The circle center. |
[in] | radius | - The circle radius. |
[out] | result | - The intersection points (a pointer to the array of two (!) elements). |
ptrdiff_t IntersectTwoCurves | ( | const MbCurve & | pCurve1, |
const MbCurve & | pCurve2, | ||
SArray< MbCrossPoint > & | result, | ||
bool | touchInclude, | ||
double | epsilon = Math::LengthEps *c3d::METRIC_DELTA , |
||
bool | allowInaccuracy = true |
||
) |
Calculate intersection points of two curves.
Calculate the parameters of intersection points of two arbitrary curves.
The touching point is determined by the collinearity of the tangent vectors to the curves at the point of intersection.
If the intersection point coincides with the junction point of the compound curve, then the tangency will be determined
by the collinearity of the tangent vectors for each segment of the compound curve.
The general method is used if there is no special function for intersection.
[in] | pCurve1 | - The first curve. |
[in] | pCurve2 | - The second curve. |
[out] | result | - The array of intersection points. |
[in] | touchInclude | - Consider tangencies as intersections. |
[in] | epsilon | - The accuracy of coincidence points of intersection. |
[in] | allowInaccuracy | - Allow lowering input accuracy. |
ptrdiff_t CurveCurveIntersection | ( | const MbCurve & | curve1, |
const MbCurve & | curve2, | ||
SArray< double > & | result1, | ||
SArray< double > & | result2, | ||
double | xEpsilon, | ||
double | yEpsilon, | ||
bool | touchInclude, | ||
bool | allowInaccuracy = true |
||
) |
Calculate intersection points of two curves.
Calculate the parameters of intersection points of two arbitrary curves.
The general method is used if there is no special function for intersection.
[in] | curve1 | - The first curve. |
[in] | curve2 | - The second curve. |
[out] | result1 | - The parameters of intersections for the first curve. |
[out] | result2 | - The parameters of intersections for the second curve. |
[in] | xEpsilon | - Tolerance in x direction. |
[in] | yEpsilon | - Tolerance in y direction. |
[in] | touchInclude | - Consider tangencies as intersections. |
[in] | allowInaccuracy | - Allow to find a solution with less precision when we can't get a solution with given precision. |
void CurveSelfIntersect | ( | const MbCurve & | curve, |
double | xEpsilon, | ||
double | yEpsilon, | ||
SArray< double > & | result1, | ||
SArray< double > & | result2, | ||
VERSION | version = Math::DefaultMathVersion() |
||
) |
Calculate the points of curve self-intersection.
Calculate the self-intersection points parameters with the given tolerance.
[in] | curve | - The curve. |
[in] | xEpsilon | - Tolerance in x direction. |
[in] | yEpsilon | - Tolerance in y direction. |
[out] | result1 | - The self-intersection parameters array. |
[out] | result2 | - The self-intersection parameters array. |
[in] | version | - The version of the operation. |
void RemoveAllTouchParams | ( | const MbCurve & | curve1, |
const MbCurve & | curve2, | ||
SArray< MbCrossPoint > & | result, | ||
double | eps = PARAM_NEAR |
||
) |
Remove touch points.
Remove all curves touch points regardless the position on the curve (in the domain or on the borders).
[in] | curve1 | - The first curve. |
[in] | curve2 | - The second curve. |
[in,out] | result | - The array of intersection points. |
[in] | eps | - Accuracy for the function RoundColinear of testing the parallelism of tangents. |
ptrdiff_t CurveCurveIntersection | ( | const MbCurve3D & | curve1, |
const MbCurve3D & | curve2, | ||
SArray< double > & | result1, | ||
SArray< double > & | result2, | ||
double | mEps, | ||
VERSION | version = Math::DefaultMathVersion() |
||
) |
Calculate intersection points of two curves.
Calculate the parameters of intersection points of two arbitrary curves.
[in] | curve1 | - The first curve. |
[in] | curve2 | - The second curve. |
[out] | result1 | - The intersection points parameters for the first curve. |
[out] | result2 | - The intersection points parameters for the second curve. |
[in] | mEps | - The intersection tolerance. |
bool IsSelfIntersect | ( | const MbCurve3D & | curve, |
double | mEps = Math::metricRegion |
||
) |
Determine if the curve has self-intersections.
Determine if the given curve has self-intersections.
[in] | curve | - The curve. |
[in] | mEps | - The tolerance of self-intersections. |
void FilterTouchParams | ( | const MbCurve3D & | curve1, |
const MbCurve3D & | curve2, | ||
SArray< double > & | result1, | ||
SArray< double > & | result2, | ||
double | mEps = Math::metricRegion |
||
) |
Remove the tangent intersection points.
Remove the tangent intersection points parameters inside the domains of curves.
[in] | curve1 | - The first curve. |
[in] | curve2 | - The second curve. |
[out] | result1 | - The intersection points parameters for the first curve. |
[out] | result2 | - The intersection points parameters for the second curve. |
[in] | mEps | - The intersection tolerance. |
ptrdiff_t CurveCurveCrossing | ( | const MbCurve3D & | curve1, |
const MbCurve3D & | curve2, | ||
SArray< double > & | result1, | ||
SArray< double > & | result2, | ||
double | epsilon = Math::metricRegion |
||
) |
Calculate the points of two curves crossing.
Calculate parameters of the points of two curves crossing.
[in] | curve1 | - The first curve. |
[in] | curve2 | - The second curve. |
[out] | result1 | - Parameters of the points of crossing for the first curve. |
[out] | result2 | - Parameters of the points of crossing for the second curve. |
bool PointProjectionRelativeOuterLoop | ( | const MbSurface & | surface, |
const MbCartPoint3D & | pnt, | ||
bool | byOuterRectOnly, | ||
MbCartPoint & | result | ||
) |
Find the projection of a point on a surface relative to the outer contour of the surface.
Calculate the projection of a space point on a surface as a two-dimensional point on the surface. relative to the outer contour of the surface.
[in] | surface | - A surface. |
[in] | pnt | - A space point. |
[in] | byOuterRectOnly | - Whether to classify the projection relative to the outer bounding box only. |
[out] | result | - A two-dimensional parametric point on the surface. |
bool IsMultipleProjection | ( | const MbSurface & | surface, |
const MbCartPoint3D & | result | ||
) |
Determine whether the point projection is multiple-valued.
Determine whether the point projection is multiple-valued while projecting inside the surface domain.
[in] | surface | - A surface. |
[in] | result | - A space point. |
bool TouchIntersectionPoints | ( | const MbSurface & | surf1, |
bool | ext1, | ||
const MbSurface & | surf2, | ||
bool | ext2, | ||
std::vector< MbCartPoint > & | uv1arr, | ||
std::vector< MbCartPoint > & | uv2arr | ||
) |
Calculate the touch points of two surfaces.
Calculate the parameters of touch points of two surfaces.
[in] | surf1 | - A first surface. |
[in] | ext1 | - Use the first surface extension. |
[in] | surf2 | - A second surface. |
[in] | ext2 | - Use the second surface extension. |
[in] | uv1arr | - Parameters of touch points of first surface. |
[in] | uv2arr | - Parameters of touch points of second surface. |
bool PointsRelativeShell | ( | const std::vector< MbCartPoint3D > & | points, |
const MbFaceShell & | shell, | ||
std::vector< MbeItemLocation > & | pLocs | ||
) |
Determine the position of points relative to the shell.
Determine the position of points relative to the shell.
[in] | points | - Points. |
[in] | shell | - Shell. |
[out] | pLocs | - The position of points relative to the shell. |