C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2
+ Collaboration diagram for Operations with Points:

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 &centre, 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...
 

Detailed Description

Enumeration Type Documentation

◆ MbeIntersectionType

Types of intersection points.

Types of intersection points.

Enumerator
ipt_Simple 

Ordinary intersection point.

ipt_Tangent 

Tangent of intersection points.

Function Documentation

◆ PointsOnSurface() [1/2]

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.

Parameters
[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.
Returns
Returns operation result code.

◆ PointsOnSurface() [2/2]

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.

Parameters
[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.
Returns
Returns operation result code.

◆ DefinePointsOnSurfaceCounts()

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).

Parameters
[in]surface- The initial surface.
[out]uPntsCnt- The points number in U direction.
[out]vPntsCnt- The points number in V direction.

◆ IntersectionPoint()

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.

Parameters
[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.
Returns
Returns the result code of the intersection point iterative search.

◆ IntersectionPoints()

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.

Parameters
[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.

◆ FastLineLine()

void FastLineLine ( const MbLine line1,
const MbLine line2,
MbCartPoint result 
)
inline

Calculate the point of two lines intersection.

Calculate the intersection point of two exactly intersecting lines without check.

Parameters
[in]line1- The first line.
[in]line2- The second line.
[out]result- The intersection point.

◆ LineLine() [1/2]

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.

Parameters
[in]line1- The first line.
[in]line2- The second line.
[out]result- The intersection point.
Returns
Returns the result of intersection:
1 - The lines intersect at a point.
0 - The lines are parallel or coincident.

◆ LineLine() [2/2]

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.

Parameters
[in]line1- The first line.
[in]line2- The second line.
[out]result- The intersection point.
Returns
Returns the result of intersection:
1 : the curves intersect at a point;
0 : the curves are parallel;
1 : the curves are coincident - the tangent intersection point.

◆ LineLineSeg()

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.

Parameters
[in]line- The line.
[in]lseg- The segment.
[out]result- The intersection point.
Returns
Returns the result of intersection:
1 : the line and the line segment intersect at a point;
0 : the line and a line segment are parallel;
1 : the segment lies on the curve - a tangent intersection point.

◆ LineCircle()

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.

Parameters
[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).
Returns
Returns the number of intersections.

◆ IntersectTwoCurves()

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.

Parameters
[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.
Returns
The number of intersections.
Warning
Used for two-dimensional constructions, the analogue of CurveCurveIntersection.

◆ CurveCurveIntersection() [1/2]

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.

Parameters
[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.
Returns
The number of intersections.
Warning
Used for three-dimensional constructions, the analogue of IntersectTwoCurves.

◆ CurveSelfIntersect()

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.

Parameters
[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.

◆ RemoveAllTouchParams()

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).

Parameters
[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.

◆ CurveCurveIntersection() [2/2]

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.

Parameters
[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.
Returns
The number of intersections.

◆ IsSelfIntersect()

bool IsSelfIntersect ( const MbCurve3D curve,
double  mEps = Math::metricRegion 
)

Determine if the curve has self-intersections.

Determine if the given curve has self-intersections.

Parameters
[in]curve- The curve.
[in]mEps- The tolerance of self-intersections.
Returns
Returns true if the curve has self-intersections.

◆ FilterTouchParams()

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.

Parameters
[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.

◆ CurveCurveCrossing()

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.

Parameters
[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.
Returns
The points of crossing number.

◆ PointProjectionRelativeOuterLoop()

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.

Parameters
[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.
Returns
Returns true if a normal projection of the point on the surface has been calculated.

◆ IsMultipleProjection()

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.

Parameters
[in]surface- A surface.
[in]result- A space point.
Returns
Returns true if the point projection is multiple-valued

◆ TouchIntersectionPoints()

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.

Parameters
[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.
Returns
Returns true if the touch points has be calculate.
Warning
Under development.

◆ PointsRelativeShell()

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.

Parameters
[in]points- Points.
[in]shell- Shell.
[out]pLocs- The position of points relative to the shell.
Returns
Returns false if at least one point position is not defined, otherwise true.