C3D Toolkit
Kernel - 117950, Vision - 2.7.5.29
|
Classes | |
struct | MbDistance |
Distance between curves. More... | |
class | DiskreteLengthData |
Data for support of discrete length/radius/distance. More... | |
class | MpVertex |
Vertex. More... | |
class | MpEdge |
Edge. More... | |
class | MpLoop |
Loop. More... | |
class | MpGraph |
Contours construction graph. More... | |
class | MbBreaksPart |
Part of break. More... | |
class | MbBreak |
Break. More... | |
class | MbTri |
Triangle. More... | |
class | MbPlanarGrid |
Triangulation of a two-dimensional region. More... | |
struct | StMLTipParams |
Tip parameters structure. More... | |
struct | StVertexOfMultilineInfo |
Information about a vertex. More... | |
class | MbBreaksRebuild |
Class for breaks rebuilding. More... | |
Enumerations | |
enum | MbeIntLoopsResult { ilr_error = -1 , ilr_notIntersect = 0 , ilr_firstCurve = 1 , ilr_secondCurve = 2 , ilr_success = 3 } |
The curves intersection result. More... | |
enum | EnMLVertexTracingType { mvt_ShearType , mvt_FilletType , mvt_SpecFilletType } |
Type of traverse of corners. More... | |
enum | EnMLInnerTipType { mit_UndefTip , mit_VerticesTip , mit_LinearTip , mit_ArcTip } |
Type of inner tip. More... | |
enum | EnMLTipType { mtt_UndefTip , mtt_LinearTip , mtt_ArcTip , mtt_PolylineTip , mtt_ObliqueTip } |
Type of tip. More... | |
Functions | |
bool | ChangeFirstPoint (MbCurve *segment, const MbCartPoint &p) |
Correct the start point. More... | |
bool | ChangeLastPoint (MbCurve *segment, const MbCartPoint &p) |
Correct the last point. More... | |
MbeItemLocation | SecondContourLocation (const MbContour &contour1, const MbContour &contour2, double xEpsilon, double yEpsilon) |
Classify the position of the second contour relative to the first one. More... | |
bool | IsSpaceNear (const MbCurve &curve1, const MbCurve &curve2, double xEpsilon, double yEpsilon, double devSag=5.0 *Math::deviateSag) |
Determine whether the first curve is close to the second curve. More... | |
double | c3d::CalcAngle0X (double dx, double dy) |
Calculate angle between line and 0X-axis. More... | |
long double | c3d::CalcAngle0X (long double dx, long double dy) |
Calculate the angle between a line and 0X-axis. More... | |
double | c3d::CalcAngle0X (const MbCartPoint &p1, const MbCartPoint &p2) |
Calculate the angle between a line and 0X-axis. More... | |
void | c3d::AngleToParam (double dir, bool left, double &t) |
Transform a circle angle to the curve parameter. More... | |
double | c3d::CalcAngle3Points (const MbCartPoint &p1, const MbCartPoint ¢re, const MbCartPoint &p3) |
Calculate the minimal angle between lines. More... | |
MbCartPoint | c3d::LineSegDivide (const MbCartPoint &p1, const MbCartPoint &p2) |
Split segment by the middle. More... | |
MbeState | DeleteCurvePart (List< MbCurve > &curveList, const MbCartPoint &pnt, MbCurve *curve, MbCurve *&part2) |
Delete the piece of a curve. More... | |
MbeState | DeleteCurvePart (const MbCartPoint &p1, const MbCartPoint &p2, const MbCartPoint &p3, MbCurve *curve, MbCurve *&part2) |
Delete the piece of a curve. More... | |
MbeState | TrimmCurvePart (List< MbCurve > &curveList, const MbCartPoint &pnt, MbCurve *curve, MbCurve *&part2) |
Keep the piece of a curve. More... | |
MbeState | TrimmCurvePart (const MbCartPoint &p1, const MbCartPoint &p2, const MbCartPoint &p3, MbCurve *curve, MbCurve *&part2) |
Keep the piece of a curve. More... | |
MbeState | JustifyCurve (MbCurve *curve, const MbCurve *limitCurve, const MbCartPoint &pnt, MbCurve *&part2) |
Justify the curve. More... | |
MbeLocation | PointLocation (const RPArray< const MbCurve > &limits, const MbCartPoint &pnt) |
The position of the point. More... | |
MbeState | BreakByClosedCurves (MbCurve &curve, const RPArray< const MbCurve > &limits, bool inside, PArray< MbCurve > &part2, SArray< MbCrossPoint > *cross=nullptr, bool *isEqualCurve=nullptr, bool cutOnCurve=false) |
Exclude the piece of a curve. More... | |
MbeState | BreakByCurvesArr (MbCurve &curve, const RPArray< const MbCurve > &limits, PArray< MbCurve > &part2) |
Exclude the piece of a curve. More... | |
MbeState | BreakCurve (MbCurve &curve, const MbCartPoint &p1, const MbCartPoint &p2, PArray< MbCurve > &part2) |
Split the curve. More... | |
MbeState | BreakCurveNParts (MbCurve &curve, ptrdiff_t partsCount, const MbCartPoint &p1, PArray< MbCurve > &part2) |
Split the curve. More... | |
MbeState | ExtendCurveToCurve (MbCurve *curve, const MbCurve *limitCurve, const MbCartPoint &pnt) |
Extend the curve. More... | |
int | Circle2PointsRadius (const MbCartPoint &p1, const MbCartPoint &p2, double radius, MbTempCircle *circle) |
Calculate a circle center. More... | |
bool | CircleCentre3Points (const MbCartPoint &p1, const MbCartPoint &p2, const MbCartPoint &p3, MbCartPoint ¢re) |
Calculate center and radius of a circle. More... | |
bool | DistanceCurveCurve (const MbCurve &curve1, const MbCurve &curve2, MbDistance &dmin) |
Calculate distance. More... | |
void | CalculateUV (const MbCurve &curve1, const MbCurve &curve2, double &u, double &v) |
Calculate parameters of curves. More... | |
bool | PointsOnCurve (ptrdiff_t count, const MbCartPoint &on, const MbCurve &curve, SArray< MbCartPoint > &points, SArray< double > &pars) |
Put points on a curve. More... | |
MbCurve * | FatArcContour (const MbCurve &curve, double eps, double maxRadius, bool mate, VERSION version=Math::DefaultMathVersion()) |
Approximation of a curve by arcs and segments. More... | |
bool | BeginEnvelopeContour (const MbCartPoint &insidePnt, const MbCurve *selectCurve, SArray< MbCrossPoint > &cross, MbContour &contour, SArray< MbCrossPoint > &crossRight) |
Find the first segment of a contour. More... | |
MbCurve * | FindNearestCurve (List< MbCurve > &curveList, const MbCartPoint &pnt) |
Find the nearest curve. More... | |
void | IntersectWithAll (const MbCurve *selectCurve, LIterator< MbCurve > &fromCurve, SArray< MbCrossPoint > &cross, bool self) |
Find intersection points. More... | |
void | SortCrossPoints (double tProj, const MbCurve *selectCurve, SArray< MbCrossPoint > &cross, SArray< MbCrossPoint > &crossLeft, SArray< MbCrossPoint > &crossRight) |
Sort intersection points. More... | |
void | RemoveEquPoints (double tProj, SArray< MbCrossPoint > &cross) |
Delete coincident points. More... | |
void | Equid (const MbCurve *curve, double radLeft, double radRight, int side, bool arcMode, bool degState, PArray< MbCurve > &equLeft, PArray< MbCurve > &equRight) |
Construction of offset curves to a curve. More... | |
void | MakeHatchingArea (const PArray< MbCurve > &contour, double witdh, PArray< MbCurve > &borders) |
Construction of curves hatching region. More... | |
bool | Fillet (MbCurve *curve1, const MbCartPoint &pnt1, bool trim1, MbCurve *curve2, const MbCartPoint &pnt2, bool trim2, double rad, MbeState &state1, MbeState &state2, MbArc *&arc) |
Construct fillet between curves. More... | |
bool | Chamfer (MbCurve *curve1, const MbCartPoint &pnt1, bool trim1, MbCurve *curve2, const MbCartPoint &pnt2, bool trim2, double len, double angle, bool type, MbeState &state1, MbeState &state2, MbLineSegment *&lineseg) |
Construct a chamfer. More... | |
MbeState | FilletPolyContour (MbCurve *mc, double rad, bool nodeFlag, const MbCartPoint &pnt, MbContour *&contour) |
Construct a fillet. More... | |
bool | ChamferPolyContour (MbCurve *mc, double l1, double par, bool chamferTypeFlag, bool nodeFlag, const MbCartPoint &pnt) |
Construct a chamfer. More... | |
bool | Corner (MbCurve *crv1, MbCurve *crv2, const MbCartPoint &p1, const MbCartPoint &p2) |
Extend curves. More... | |
void | HatchIntersectLine (double y, const MbCurve *curve, SArray< MbCartPoint > &crossPnt, bool skipTouchPoints=false) |
Find intersection with horizontal line. More... | |
void | HatchIntersectCircle (const MbCurve *circle, const MbCurve *curve, SArray< MbCartPoint > &crossPnt) |
Find intersection with a circle. More... | |
double | CurveRelative (const MbCurve &curve, const MbCartPoint &p1, const MbCartPoint &p2) |
The location of a curve relative to axis points. More... | |
double | ContourRelative (const MbCurve &curve, const MbCartPoint &p1, const MbCartPoint &p2, double sag) |
A sign of area of a curve's shadow on a segment. More... | |
DEPRECATE_DECLARE MbeIntLoopsResult | BooleanIntLoops (const MbCurve &loop1, bool bOrient1, const MbCurve &loop2, bool bOrient2, RPArray< MbCurve > &intLoops) |
Calculate two curves intersection. More... | |
bool | RemoveContourGaps (MbContour &contour, double accuracy, bool canInsert, bool canReplace) |
Remove contour gaps. More... | |
MpGraph * | EncloseContoursBuilder (const RPArray< MbCurve > &curveList, const MbCartPoint &p, PArray< MbCurve > &usedCurves, PArray< MbContour > &contourArray, double accuracy, bool strict, VERSION version, IProgressIndicator *progInd=nullptr) |
Create contours around the given point. More... | |
MpGraph * | EncloseContoursBuilder (const c3d::PlaneCurvesSPtrVector &curveList, const MbCartPoint &p, c3d::PlaneCurvesSPtrVector &usedCurves, c3d::PlaneContoursSPtrVector &contourArray, double accuracy, bool strict, VERSION version, IProgressIndicator *progInd=nullptr) |
Create contours around the given point. More... | |
MpGraph * | OuterContoursBuilder (const RPArray< MbCurve > &curveList, PArray< MbContour > &contourArray, double accuracy, bool strict, VERSION version, IProgressIndicator *progInd=nullptr) |
Construct enclosing contours on the basis of the given curves. More... | |
MpGraph * | OuterContoursBuilder (const c3d::PlaneCurvesSPtrVector &curveList, c3d::PlaneContoursSPtrVector &contourArray, double accuracy, bool strict, VERSION version, IProgressIndicator *progInd=nullptr) |
Construct enclosing contours on the basis of the given curves. More... | |
MpGraph * | ContoursReconstructor (const RPArray< MbCurve > &curveList, MpGraph *graph, PArray< MbContour > &contourArray, double accuracy, bool strict, VERSION version, IProgressIndicator *progInd=nullptr) |
Reconstruct contours constructed around the point before. More... | |
MpGraph * | ContoursReconstructor (const c3d::PlaneCurvesSPtrVector &curveList, MpGraph *graph, c3d::PlaneContoursSPtrVector contourArray, double accuracy, bool strict, VERSION version, IProgressIndicator *progInd=nullptr) |
Reconstruct contours constructed around the point before. More... | |
void | NearPointProjections (const MbContour &contour, const MbCartPoint &pnt, SArray< double > &tProjs, bool isNear, double mEps=METRIC_REGION) |
Nearest projections on the contour. More... | |
MbeNewtonResult | NearestPoints (const MbCurve &curve1, bool ext1, const MbCurve &curve2, bool ext2, double xEpsilon, double yEpsilon, double &t1, double &t2, double &dmin, VERSION version=Math::DefaultMathVersion()) |
Calculate parameters of the nearest points of two curves. More... | |
double | AreaSign (const MbCurve &curve, double sag, bool close) |
An area and orientation of a closed curve. More... | |
template<class Point > | |
bool | c3d::EqualPoints (const Point &p1, const Point &p2, double xEpsilon, double yEpsilon) |
Check points for equality. More... | |
template<class Vector > | |
bool | c3d::EqualVectors (const Vector &p1, const Vector &p2, double xEpsilon, double yEpsilon) |
Check equality of vectors with given tolerance. More... | |
bool | c3d::EqualLengths (double lx, double ly, double minLen=METRIC_EPSILON, double minDev=LENGTH_EPSILON) |
Check lengths for equality. More... | |
bool | FilletMultiline (MbMultiline &multiline, double rad, bool nodeFlag, MbCartPoint &pnt, const StVertexOfMultilineInfo &vertInfo) |
Construct a fillet of multiline. More... | |
bool | ChamferMultiline (MbMultiline &multiline, double len, double par, bool type, bool nodeFlag, MbCartPoint &pnt, const StVertexOfMultilineInfo &vertInfo) |
Construct a chamfer of multiline. More... | |
void | ToTakeIntoCurvesCrvRadii (MbCurve &curve, double angle, double &minPos, double &maxNeg) |
Out-of-class functions for curvature radii calculation/consideration (implementation in MltLine.cpp) More... | |
void | GetContoursCrvRadii (MbContour &contour, double angle, double &minPos, double &maxNeg) |
Get the contour curvatures radii. More... | |
bool | SmoothJointSuccessiveCurves (MbCurve &curve1, MbCurve &curve2) |
Join two curves. More... | |
bool | BreakMultiline (const MbMultiline &multiline, const MbCartPoint &p1, const MbCartPoint &p2, PArray< MbMultiline > &parts) |
Split multiline. More... | |
bool | BreakMultilineNParts (const MbMultiline &multiline, size_t partsCount, const MbCartPoint &point, PArray< MbMultiline > &parts) |
Split multiline. More... | |
void | GetCorrectRegions (const RPArray< MbContour > &contours, bool sameContours, RPArray< MbRegion > ®ions) |
Get a set of regions. More... | |
void | MakeRegions (RPArray< MbContour > &contours, bool useSelfIntCntrs, bool sameContours, RPArray< MbRegion > ®ions) |
Divide a set of regions into groups and construct regions. More... | |
bool | CreateBooleanResultRegions (RPArray< MbContour > &contours1, RPArray< MbContour > &contours2, const MbRegionBooleanParams &operParams, RPArray< MbRegion > ®ions, MbResultType *resInfo=nullptr) |
Perform boolean operation with regions. More... | |
bool | CreateBooleanResultRegions (MbRegion ®ion1, MbRegion ®ion2, const MbRegionBooleanParams &operParams, RPArray< MbRegion > ®ions, MbResultType *resInfo=nullptr) |
Perform boolean operation with regions. More... | |
bool | MakeUnionRegions (RPArray< MbRegion > ®ions, bool allowSelfTouch=true, bool mergeCurves=true) |
Perform union of regions. More... | |
enum MbeIntLoopsResult |
The curves intersection result.
The result of two curves' regions intersection.
enum EnMLInnerTipType |
enum EnMLTipType |
bool ChangeFirstPoint | ( | MbCurve * | segment, |
const MbCartPoint & | p | ||
) |
Correct the start point.
Change the start point of curve with a new one.
Changes the start point for curves of types:
pt_Nurbs, pt_Hermit, pt_Polyline, pt_Bezier, pt_CubicSpline, pt_LineSegment, pt_ReparamCurve,
or for contour pt_Contour if its first segment is of one of the listed types.
[in] | segment | - The modified curve. |
[in] | p | - A new start point. |
bool ChangeLastPoint | ( | MbCurve * | segment, |
const MbCartPoint & | p | ||
) |
Correct the last point.
Change the end point of curve with a new one.
Changes the end point for curves of types:
pt_Nurbs, pt_Hermit, pt_Polyline, pt_Bezier, pt_CubicSpline, pt_LineSegment, pt_ReparamCurve,
or for contour pt_Contour if its last segment is of one of the listed types.
[in] | segment | - The modified curve. |
[in] | p | - A new start point. |
MbeItemLocation SecondContourLocation | ( | const MbContour & | contour1, |
const MbContour & | contour2, | ||
double | xEpsilon, | ||
double | yEpsilon | ||
) |
Classify the position of the second contour relative to the first one.
Classify the position of the second contour relative to the first one:
iloc_OutOfItem - outside,
iloc_OnItem - intersects,
iloc_InItem - inside.
[in] | contour1 | - The first contour. |
[in] | contour2 | - The second contour. |
[in] | xEpsilon | - Tolerance in x direction. |
[in] | yEpsilon | - Tolerance in y direction. |
bool IsSpaceNear | ( | const MbCurve & | curve1, |
const MbCurve & | curve2, | ||
double | xEpsilon, | ||
double | yEpsilon, | ||
double | devSag = 5.0 *Math::deviateSag |
||
) |
Determine whether the first curve is close to the second curve.
Determine whether curve 'curve1' is close to curve 'curve2' within the given precision.
The proximity is defined by the closeness of points of the first curve obtained by sampling
with the given turning angle to the second curve.
[in] | curve1 | - The first curve. |
[in] | curve2 | - The second curve. |
[in] | xEpsilon | - Proximity tolerance in x direction. |
[in] | yEpsilon | - Proximity tolerance in y direction. |
[in] | devSag | - The maximal turning angle for sampling the curve. |
|
inline |
Calculate angle between line and 0X-axis.
Line is set by dx and dy increments. Angle is in range [0, 2*M_PI).
[in] | dx | - Increment along X. |
[in] | dy | - Increment along Y. |
|
inline |
Calculate the angle between a line and 0X-axis.
A line is defined by dx and dy increments. The angle is in range [0, 2*M_PI).
[in] | dx | - Increment along X. |
[in] | dy | - Increment along Y. |
|
inline |
Calculate the angle between a line and 0X-axis.
Line is defined by two points. The angle is in range [0, 2*M_PI].
[in] | p1 | - The first point. |
[in] | p2 | - The second point |
|
inline |
Transform a circle angle to the curve parameter.
[in] | dir | - Angle between X-axes of a circle and of the coordinate system. |
[in] | left | - If true, then the coordinate system is left, otherwise it is right. |
[out] | t | - Parameter to transform. |
|
inline |
Calculate the minimal angle between lines.
Lines are specified as follows: l1( centre, p1 ) and l2( centre, p3 ).
[in] | p1 | - A point on the first line. |
[in] | centre | - The common point of two lines. |
[in] | p3 | - A point on the second line. |
|
inline |
Split segment by the middle.
[in] | p1 | - Coordinates of the segment's start point. |
[in] | p2 | - Coordinates of the segment's end point. |
MbeState DeleteCurvePart | ( | List< MbCurve > & | curveList, |
const MbCartPoint & | pnt, | ||
MbCurve * | curve, | ||
MbCurve *& | part2 | ||
) |
Delete the piece of a curve.
Delete a piece of a curve by the point.
Delete the piece bounded by two successive parameters of intersection of the curve with the curves from the given list and the nearest to the projection of the given point.
[in] | curveList | - The list of curves for intersection. |
[in] | pnt | - The point indicating the piece of a curve to be deleted. |
[in,out] | curve | - The curve to be modified. |
[out] | part2 | - The finite piece of the modified curve if the curve is split into two pieces. |
MbeState DeleteCurvePart | ( | const MbCartPoint & | p1, |
const MbCartPoint & | p2, | ||
const MbCartPoint & | p3, | ||
MbCurve * | curve, | ||
MbCurve *& | part2 | ||
) |
Delete the piece of a curve.
Delete the piece of a curve by two points.
The third point is additionally specified for closed curves, it indicates the piece of a curve to be deleted.
[in] | p1 | - The point indicating the first boundary of the piece to be deleted. |
[in] | p2 | - The point indicating the second boundary of the piece to be deleted. |
[in] | p3 | - The point indicating the piece of a closed curve to be deleted. |
[in,out] | curve | - The curve to be modified. |
[out] | part2 | - The finite piece of the modified curve if the curve is split into two pieces. |
MbeState TrimmCurvePart | ( | List< MbCurve > & | curveList, |
const MbCartPoint & | pnt, | ||
MbCurve * | curve, | ||
MbCurve *& | part2 | ||
) |
Keep the piece of a curve.
Keep the piece of a curve by the point. Keep the curve piece bounded by two successive parameters of intersection of the initial curve with the curves from the given list and the nearest to the projection of the given point.
[in] | curveList | - The list of curves for intersection. |
[in] | pnt | - The point indicating the piece of a curve to be kept. |
[in,out] | curve | - The curve to be modified. |
[in,out] | part2 | - This value is always nullptr. |
MbeState TrimmCurvePart | ( | const MbCartPoint & | p1, |
const MbCartPoint & | p2, | ||
const MbCartPoint & | p3, | ||
MbCurve * | curve, | ||
MbCurve *& | part2 | ||
) |
Keep the piece of a curve.
Keep the piece of a curve by two points.
The third point is additionally specified for closed curves, it indicates the piece of a curve to be kept.
[in] | p1 | - The point indicating the first boundary of the piece to be deleted. |
[in] | p2 | - The point indicating the second boundary of the piece to be deleted. |
[in] | p3 | - The point indicating the piece of a closed curve to be kept |
[in,out] | curve | - The curve to be modified. |
[in,out] | part2 | - This value is always nullptr. |
MbeState JustifyCurve | ( | MbCurve * | curve, |
const MbCurve * | limitCurve, | ||
const MbCartPoint & | pnt, | ||
MbCurve *& | part2 | ||
) |
Justify the curve.
Justify the curve relative to the given curve and a point on the curve.
The curve is truncated by the point of its intersection with the boundary curve, which is the nearest to the given point. Only the piece of a curve at the side of the given point is kept.
[in,out] | curve | - The modified curve. |
[in] | limitCurve | - Boundary curve for justification. |
[in] | pnt | - The point for selecting the piece of a curve. |
[in,out] | part2 | - This value is always nullptr. |
MbeLocation PointLocation | ( | const RPArray< const MbCurve > & | limits, |
const MbCartPoint & | pnt | ||
) |
The position of the point.
The position of the point relative to closed borders.
[in] | limits | - The set of curves that defines boundaries. These curves should be closed boundaries in the aggregate. |
[in] | pnt | - The point for the position definition. |
MbeState BreakByClosedCurves | ( | MbCurve & | curve, |
const RPArray< const MbCurve > & | limits, | ||
bool | inside, | ||
PArray< MbCurve > & | part2, | ||
SArray< MbCrossPoint > * | cross = nullptr , |
||
bool * | isEqualCurve = nullptr , |
||
bool | cutOnCurve = false |
||
) |
Exclude the piece of a curve.
Exclude curve pieces from closed boundaries.
[in] | curve | - The bounded curve. |
[in] | limits | - The array of closed curves-boundaries. |
[in] | inside | - The attribute of deletion inside boundaries. |
[out] | part2 | - The array of remaining curve pieces. |
[out] | cross | - The curve and boundaries intersection point. |
[out] | isEqualCurve | - The attribute of coincidence between the broken curve with one of the given array of boundaries. It is worthwhile if the result is dp_NoChanged. |
[in] | cutOnCurve | - If it equals to false, then the pieces of a curve coincident with pieces of the boundary are not to be deleted. |
MbeState BreakByCurvesArr | ( | MbCurve & | curve, |
const RPArray< const MbCurve > & | limits, | ||
PArray< MbCurve > & | part2 | ||
) |
Exclude the piece of a curve.
Exclude pieces of a curve by coincidence with curves from a set.
[in] | curve | - The bounded curve. |
[in] | limits | - The array of curves for the hit testing. |
[out] | part2 | - The array of remaining curve pieces. |
MbeState BreakCurve | ( | MbCurve & | curve, |
const MbCartPoint & | p1, | ||
const MbCartPoint & | p2, | ||
PArray< MbCurve > & | part2 | ||
) |
Split the curve.
Split the curve into two pieces. In result the curve is split into pieces. The first piece remains, the other pieces are added to the array part2.
[in,out] | curve | - The curve for splitting. |
[in] | p1 | - The first point of splitting. |
[in] | p2 | - The second point of splitting. |
[out] | part2 | - The array of curve pieces. |
MbeState BreakCurveNParts | ( | MbCurve & | curve, |
ptrdiff_t | partsCount, | ||
const MbCartPoint & | p1, | ||
PArray< MbCurve > & | part2 | ||
) |
Split the curve.
Split the curve by several equal pieces.
[in,out] | curve | - The curve for splitting. |
[in] | partsCount | - The count of pieces. |
[in] | p1 | - One of splitting points. |
[out] | part2 | - The array of curve pieces. |
MbeState ExtendCurveToCurve | ( | MbCurve * | curve, |
const MbCurve * | limitCurve, | ||
const MbCartPoint & | pnt | ||
) |
Extend the curve.
Extend the curve to the given curve-boundary limitCurve from the end nearest to the given point pnt.
[in,out] | curve | - The modified curve. |
[in] | limitCurve | - The curve-boundary |
[in] | pnt | - The point indicating the extended end of a curve. |
int Circle2PointsRadius | ( | const MbCartPoint & | p1, |
const MbCartPoint & | p2, | ||
double | radius, | ||
MbTempCircle * | circle | ||
) |
Calculate a circle center.
Calculate a circle center by two points and radius.
[in] | p1 | - The first point. |
[in] | p2 | - The second point. |
[in] | radius | - Radius. |
[out] | circle | - The result - the array of temporary circles. |
bool CircleCentre3Points | ( | const MbCartPoint & | p1, |
const MbCartPoint & | p2, | ||
const MbCartPoint & | p3, | ||
MbCartPoint & | centre | ||
) |
Calculate center and radius of a circle.
Calculate center and radius of a circle by three points.
[in] | p1 | - The first point. |
[in] | p2 | - The second point. |
[in] | p3 | - The third point. |
[out] | centre | - The result - the circle center. |
bool DistanceCurveCurve | ( | const MbCurve & | curve1, |
const MbCurve & | curve2, | ||
MbDistance & | dmin | ||
) |
Calculate distance.
Calculate distance between two curves.
[in] | curve1 | - The first curve. |
[in] | curve2 | - The second curve. |
[out] | dmin | - The result - the distance between curves. |
Calculate parameters of curves.
Calculate curves parameters for the minimal distance.
[in] | curve1 | - The first curve. |
[in] | curve2 | - The second curve. |
[out] | u | - Parameter on the first curve. |
[out] | v | - Parameter on the second curve. |
bool PointsOnCurve | ( | ptrdiff_t | count, |
const MbCartPoint & | on, | ||
const MbCurve & | curve, | ||
SArray< MbCartPoint > & | points, | ||
SArray< double > & | pars | ||
) |
Put points on a curve.
Put a given number of points on curve.
Points may be put only on a bounded curve.
[in] | count | - The number of points. |
[in] | on | - Projection of this point will be added in the result in a case of closed curve. |
[in] | curve | - The curve. |
[out] | points | - Points on the curve. |
[out] | pars | - Parameters on the curve. |
MbCurve* FatArcContour | ( | const MbCurve & | curve, |
double | eps, | ||
double | maxRadius, | ||
bool | mate, | ||
VERSION | version = Math::DefaultMathVersion() |
||
) |
Approximation of a curve by arcs and segments.
Approximation of a curve by arcs and segments.
[in] | curve | - The curve for approximation. |
[in] | eps | - The metric tolerance. |
[in] | maxRadius | - The maximal approximation radius. |
[in] | mate | - The approximation flag with consideration of conjugations. |
[in] | version | - The version of construction. |
bool BeginEnvelopeContour | ( | const MbCartPoint & | insidePnt, |
const MbCurve * | selectCurve, | ||
SArray< MbCrossPoint > & | cross, | ||
MbContour & | contour, | ||
SArray< MbCrossPoint > & | crossRight | ||
) |
Find the first segment of a contour.
Find the first segment of a contour.
A piece of the curve "selectCurve" between intersection parameters is added in contour, the parameters are the nearest to the projection of the point "insidePoint".
[in] | insidePnt | - The point around which to create the contour. |
[in] | selectCurve | - The nearest curve. |
[in] | cross | - The array of points of intersection with the nearest curve. |
[out] | contour | - The contour for adding the segment to. |
[out] | crossRight | - The node - the array of intersection points in the side of contour extension. |
MbCurve* FindNearestCurve | ( | List< MbCurve > & | curveList, |
const MbCartPoint & | pnt | ||
) |
Find the nearest curve.
Find the curve nearest to a point.
[in] | curveList | - The list of curves. |
[in] | pnt | - The point. |
void IntersectWithAll | ( | const MbCurve * | selectCurve, |
LIterator< MbCurve > & | fromCurve, | ||
SArray< MbCrossPoint > & | cross, | ||
bool | self | ||
) |
Find intersection points.
Find intersection points of the chosen curve with the other curves from the list.
[in] | selectCurve | - The curve. |
[in] | fromCurve | - The iterator of the curves list. |
[out] | cross | - Intersection points. |
[in] | self | - Flag of self-intersections search. |
void SortCrossPoints | ( | double | tProj, |
const MbCurve * | selectCurve, | ||
SArray< MbCrossPoint > & | cross, | ||
SArray< MbCrossPoint > & | crossLeft, | ||
SArray< MbCrossPoint > & | crossRight | ||
) |
Sort intersection points.
Sort intersection points relative to the projection point of the chosen curve.
[in] | tProj | - Parameter of the projection on the curve. |
[in] | selectCurve | - The curve. |
[in,out] | cross | - The array of intersection points for sorting. |
[out] | crossLeft | - The node of intersection points on the left of the projection. |
[out] | crossRight | - The node of intersection points on the right of the projection. |
void RemoveEquPoints | ( | double | tProj, |
SArray< MbCrossPoint > & | cross | ||
) |
Delete coincident points.
Delete points from the array which are coincident with the projection point specified by the parameter.
If all the points are coincident with the projection point, then they will not be deleted.
[in] | tProj | - The projection parameter. |
[in,out] | cross | - The array of intersection points. |
void Equid | ( | const MbCurve * | curve, |
double | radLeft, | ||
double | radRight, | ||
int | side, | ||
bool | arcMode, | ||
bool | degState, | ||
PArray< MbCurve > & | equLeft, | ||
PArray< MbCurve > & | equRight | ||
) |
Construction of offset curves to a curve.
Construction of equidistant curves to arbitrary curve on the right and on the left. A name of every offset contour matches with the name of the initial one.
[in] | curve | - The initial curve |
[in] | radLeft | - The equidistance radius on the left by direction. |
[in] | radRight | - The equidistance radius on the right by direction. |
[in] | side | - Attribute defining the side to construct: 0 - on the left by direction, 1 - on the right by direction, 2 - on the both sides. |
[in] | arcMode | - The way of traverse of angles: true - by arc, false - by section. |
[in] | degState | - Attribute of degenerate segments allowance: 0 - degenerate segments are forbidden, 1 - degenerate segments are allowed. |
[out] | equLeft | - The array of contours on the left side. |
[out] | equRight | - The array of contours on the right side. |
void MakeHatchingArea | ( | const PArray< MbCurve > & | contour, |
double | witdh, | ||
PArray< MbCurve > & | borders | ||
) |
Construction of curves hatching region.
Construction of hatching with a given width inside or near curves.
[in] | contour | - Initial curves |
[in] | witdh | - The hatching width. |
[out] | borders | - The array of hatching lines and hatching boundaries. |
bool Fillet | ( | MbCurve * | curve1, |
const MbCartPoint & | pnt1, | ||
bool | trim1, | ||
MbCurve * | curve2, | ||
const MbCartPoint & | pnt2, | ||
bool | trim2, | ||
double | rad, | ||
MbeState & | state1, | ||
MbeState & | state2, | ||
MbArc *& | arc | ||
) |
Construct fillet between curves.
Construct fillet with a constant radius between two curves.
[in] | curve1 | - The first curve. |
[in] | pnt1 | - The point near the first curve. |
[in] | trim1 | - The attribute of trimming of the first curve. |
[in] | curve2 | - The second curve. |
[in] | pnt2 | - The point near the second curve. |
[in] | trim2 | - The attribute of trimming of the second curve. |
[in] | rad | - The radius of fillet. |
[out] | state1 | - The state of the first curve. |
[out] | state2 | - The state of the second curve. |
[out] | arc | - The arc of fillet. |
bool Chamfer | ( | MbCurve * | curve1, |
const MbCartPoint & | pnt1, | ||
bool | trim1, | ||
MbCurve * | curve2, | ||
const MbCartPoint & | pnt2, | ||
bool | trim2, | ||
double | len, | ||
double | angle, | ||
bool | type, | ||
MbeState & | state1, | ||
MbeState & | state2, | ||
MbLineSegment *& | lineseg | ||
) |
Construct a chamfer.
Construct a chamfer between two curves.
[in] | curve1 | - The first curve. |
[in] | pnt1 | - The point near the first curve. |
[in] | trim1 | - The attribute of trimming of the first curve. |
[in] | curve2 | - The second curve. |
[in] | pnt2 | - The point near the second curve. |
[in] | trim2 | - The attribute of trimming of the second curve. |
[in] | len | - The size of the chamfer on the first curve. |
[in] | angle | - The angle of the chamfer or the size of the chamfer on the second curve according to the type of construction. |
[in] | type | - The type of chamfer construction: true - size + angle, false - size + size. |
[out] | state1 | - The state of the first curve. |
[out] | state2 | - The state of the second curve. |
[out] | lineseg | - The segment of the chamfer. |
MbeState FilletPolyContour | ( | MbCurve * | mc, |
double | rad, | ||
bool | nodeFlag, | ||
const MbCartPoint & | pnt, | ||
MbContour *& | contour | ||
) |
Construct a fillet.
Construct a fillet of polyline or contour.
The curve "mc" being modified should be a polyline or a contour.
[in] | mc | - The modified curve. |
[in] | rad | - The radius of fillet. |
[in] | nodeFlag | - The flag of selection of fillet nodes. true - fillet at all nodes, false - fillet of the nearest node. |
[in] | pnt | - The point of choosing of the nearest node. |
[out] | contour | - Contour constructed by a polyline. |
bool ChamferPolyContour | ( | MbCurve * | mc, |
double | l1, | ||
double | par, | ||
bool | chamferTypeFlag, | ||
bool | nodeFlag, | ||
const MbCartPoint & | pnt | ||
) |
Construct a chamfer.
Construct a chamfer of polyline or contour.
The curve "mc" being modified should be a polyline or a contour.
[in] | mc | - The modified curve. |
[in] | l1 | - The size of a chamfer. |
[in] | par | - The angle of a chamfer or the size of a chamfer on the second curve according to the type of construction. |
[in] | chamferTypeFlag | - The type of chamfer construction: true - size + angle, false - size + size. |
[in] | nodeFlag | - The flag of selection of fillet nodes. true - fillet at all nodes, false - fillet of the nearest node. |
[in] | pnt | - The point of choosing of the nearest node. |
bool Corner | ( | MbCurve * | crv1, |
MbCurve * | crv2, | ||
const MbCartPoint & | p1, | ||
const MbCartPoint & | p2 | ||
) |
Extend curves.
Extend two curves to the point of intersection.
[in,out] | crv1 | - The first curve. |
[in,out] | crv2 | - The second curve. |
[in] | p1 | - The point for selection of intersection location. |
[in] | p2 | - The point for selection of intersection location. |
void HatchIntersectLine | ( | double | y, |
const MbCurve * | curve, | ||
SArray< MbCartPoint > & | crossPnt, | ||
bool | skipTouchPoints = false |
||
) |
Find intersection with horizontal line.
Find intersection of a curve with horizontal line. For hatching.
[in] | y | - The coordinate of a horizontal line. |
[in] | curve | - The curve. |
[out] | crossPnt | - Intersection points. |
[in] | skipTouchPoints | - Skip touch points. true - skip touch points, false - old function behavior. |
void HatchIntersectCircle | ( | const MbCurve * | circle, |
const MbCurve * | curve, | ||
SArray< MbCartPoint > & | crossPnt | ||
) |
Find intersection with a circle.
Find intersection with a circle.
For hatching.
[in] | circle | - The circle. |
[in] | curve | - The curve. |
[out] | crossPnt | - Intersection points. |
double CurveRelative | ( | const MbCurve & | curve, |
const MbCartPoint & | p1, | ||
const MbCartPoint & | p2 | ||
) |
The location of a curve relative to axis points.
For the definition of the rotation axis direction.
[in] | curve | - The initial curve. |
[in] | p1 | - The first point of an axis. |
[in] | p2 | - The second point of an axis. |
double ContourRelative | ( | const MbCurve & | curve, |
const MbCartPoint & | p1, | ||
const MbCartPoint & | p2, | ||
double | sag | ||
) |
A sign of area of a curve's shadow on a segment.
This is required for the definition of the sweep contour direction. If a curve is not closed then it becomes closed through an axis.
[in] | curve | - The initial curve. |
[in] | p1 | - The first point of a segment. |
[in] | p2 | - The second point of a segment. |
[in] | sag | - The deviation angle. Used for calculation of the step by a curve. |
DEPRECATE_DECLARE MbeIntLoopsResult BooleanIntLoops | ( | const MbCurve & | loop1, |
bool | bOrient1, | ||
const MbCurve & | loop2, | ||
bool | bOrient2, | ||
RPArray< MbCurve > & | intLoops | ||
) |
Calculate two curves intersection.
Calculate two closed curves' regions intersection.
[in] | iCheck | - Attribute of check of curves for vertices tangency. |
[in] | loop1 | - The first closed curve. |
[in] | bOrient1 | - The first closed curve orientation: true - interior is considered to be the curve's region, false - exterior is the curve's region. |
[in] | loop2 | - The second closed curve. |
[in] | bOrient2 | - The second closed curve orientation: true - interior is considered to be the curve's region, false - exterior is the curve's region. |
[out] | intLoops | - Intersection curve array. |
bool RemoveContourGaps | ( | MbContour & | contour, |
double | accuracy, | ||
bool | canInsert, | ||
bool | canReplace | ||
) |
Remove contour gaps.
Remove contour gaps.
[in] | contour | - A contour. |
[in] | accuracy | - Upper gap size. |
[in] | canInsert | - Allow insert segments. |
[in] | canReplace | - Allow replace segments. |
MpGraph* EncloseContoursBuilder | ( | const RPArray< MbCurve > & | curveList, |
const MbCartPoint & | p, | ||
PArray< MbCurve > & | usedCurves, | ||
PArray< MbContour > & | contourArray, | ||
double | accuracy, | ||
bool | strict, | ||
VERSION | version, | ||
IProgressIndicator * | progInd = nullptr |
||
) |
Create contours around the given point.
Create contours around the given point. One outer and several inner loops are constructed with single nesting level. Do not send composite curves (contours, polylines, polygons and etc) as input curves. Break them down into on the components.
[in] | curveList | - List of curves for construction. |
[in] | p | - A point the contours are constructed around. |
[out] | usedCurves | - Used curves. |
[out] | contourArray | - The result of construction is a set of contours. |
[in] | accuracy | - The accuracy of determining the intersection of curves and proximity. |
[in] | strict | - If false, the construction is performed roughly. |
[in] | version | - The version of construction. The last version Math::DefaultMathVersion(). |
[in] | progInd | - Execution progress indicator. |
MpGraph* EncloseContoursBuilder | ( | const c3d::PlaneCurvesSPtrVector & | curveList, |
const MbCartPoint & | p, | ||
c3d::PlaneCurvesSPtrVector & | usedCurves, | ||
c3d::PlaneContoursSPtrVector & | contourArray, | ||
double | accuracy, | ||
bool | strict, | ||
VERSION | version, | ||
IProgressIndicator * | progInd = nullptr |
||
) |
Create contours around the given point.
Create contours around the given point. One outer and several inner loops are constructed with single nesting level. Do not send composite curves (contours, polylines, polygons and etc) as input curves. Break them down into on the components.
[in] | curveList | - List of curves for construction. |
[in] | p | - A point the contours are constructed around. |
[out] | usedCurves | - Used curves. |
[out] | contourArray | - The result of construction is a set of contours. |
[in] | accuracy | - The accuracy of determining the intersection of curves and proximity. |
[in] | strict | - If false, the construction is performed roughly. |
[in] | version | - The version of construction. The last version Math::DefaultMathVersion(). |
[in] | progInd | - Execution progress indicator. |
MpGraph* OuterContoursBuilder | ( | const RPArray< MbCurve > & | curveList, |
PArray< MbContour > & | contourArray, | ||
double | accuracy, | ||
bool | strict, | ||
VERSION | version, | ||
IProgressIndicator * | progInd = nullptr |
||
) |
Construct enclosing contours on the basis of the given curves.
Construct enclosing contours on the basis of the given curves. Outer and inner loops are constructed with an arbitrary level of inclusion. Do not send composite curves (contours, polylines, polygons and etc) as input curves. Break them down into on the components.
[in] | curveList | - List of curves for construction. |
[out] | contourArray | - The result of construction is a set of contours. |
[in] | accuracy | - The accuracy of determining the intersection of curves and proximity. |
[in] | strict | - If false, the construction is performed roughly. |
[in] | version | - The version of construction. The last version Math::DefaultMathVersion(). |
[in] | progInd | - Execution progress indicator. |
MpGraph* OuterContoursBuilder | ( | const c3d::PlaneCurvesSPtrVector & | curveList, |
c3d::PlaneContoursSPtrVector & | contourArray, | ||
double | accuracy, | ||
bool | strict, | ||
VERSION | version, | ||
IProgressIndicator * | progInd = nullptr |
||
) |
Construct enclosing contours on the basis of the given curves.
Construct enclosing contours on the basis of the given curves. Outer and inner loops are constructed with an arbitrary level of inclusion. Do not send composite curves (contours, polylines, polygons and etc) as input curves. Break them down into on the components.
[in] | curveList | - List of curves for construction. |
[out] | contourArray | - The result of construction is a set of contours. |
[in] | accuracy | - The accuracy of determining the intersection of curves and proximity. |
[in] | strict | - If false, the construction is performed roughly. |
[in] | version | - The version of construction. The last version Math::DefaultMathVersion(). |
[in] | progInd | - Execution progress indicator. |
MpGraph* ContoursReconstructor | ( | const RPArray< MbCurve > & | curveList, |
MpGraph * | graph, | ||
PArray< MbContour > & | contourArray, | ||
double | accuracy, | ||
bool | strict, | ||
VERSION | version, | ||
IProgressIndicator * | progInd = nullptr |
||
) |
Reconstruct contours constructed around the point before.
Reconstruct contours constructed around the point before. The function reconstructs the graph constructed by EncloseContoursBuilder function.
[in] | curveList | - List of curves for construction. |
[in] | graph | - A graph to reconstruct. |
[out] | contourArray | - The result of construction is a set of contours. |
[in] | accuracy | - The accuracy of determining the intersection of curves and proximity. |
[in] | strict | - If false, the construction is performed roughly. |
[in] | version | - The version of construction. The last version Math::DefaultMathVersion(). |
[in] | progInd | - Execution progress indicator. |
MpGraph* ContoursReconstructor | ( | const c3d::PlaneCurvesSPtrVector & | curveList, |
MpGraph * | graph, | ||
c3d::PlaneContoursSPtrVector | contourArray, | ||
double | accuracy, | ||
bool | strict, | ||
VERSION | version, | ||
IProgressIndicator * | progInd = nullptr |
||
) |
Reconstruct contours constructed around the point before.
Reconstruct contours constructed around the point before. The function reconstructs the graph constructed by EncloseContoursBuilder function.
[in] | curveList | - List of curves for construction. |
[in] | graph | - A graph to reconstruct. |
[out] | contourArray | - The result of construction is a set of contours. |
[in] | accuracy | - The accuracy of determining the intersection of curves and proximity. |
[in] | strict | - If false, the construction is performed roughly. |
[in] | version | - The version of construction. The last version Math::DefaultMathVersion(). |
[in] | progInd | - Execution progress indicator. |
void NearPointProjections | ( | const MbContour & | contour, |
const MbCartPoint & | pnt, | ||
SArray< double > & | tProjs, | ||
bool | isNear, | ||
double | mEps = METRIC_REGION |
||
) |
Nearest projections on the contour.
Nearest projections of point on the contour.
[in] | contour | - A contour. |
[in] | pnt | - Projecting point. |
[out] | tProjs | - Parameters of nearest projections. |
[in] | isNear | - Select only the projections which are located from projecting point within a given tolerance. |
[in] | mEps | - A tolerance of nearest points selection. |
MbeNewtonResult NearestPoints | ( | const MbCurve & | curve1, |
bool | ext1, | ||
const MbCurve & | curve2, | ||
bool | ext2, | ||
double | xEpsilon, | ||
double | yEpsilon, | ||
double & | t1, | ||
double & | t2, | ||
double & | dmin, | ||
VERSION | version = Math::DefaultMathVersion() |
||
) |
Calculate parameters of the nearest points of two curves.
Calculate parameters of the nearest points of two curves and the distance between these points.
[in] | curve1 | - Curve 1. |
[in] | ext1 | - An attribute of search on the extension of the curve 1. |
[in] | curve2 | - Curve 2. |
[in] | ext2 | - An attribute of search on the extension of the curve 2. |
[in] | xEpsilon | - Tolerance in X direction. |
[in] | yEpsilon | - Tolerance in Y direction. |
[out] | t1 | - A point parameter of curve 1. |
[out] | t2 | - A point parameter of curve 2. |
[out] | dmin | - The distance between points of curves. |
[in] | version | - Version. |
double AreaSign | ( | const MbCurve & | curve, |
double | sag, | ||
bool | close | ||
) |
An area and orientation of a closed curve.
Calculate an area of a closed curve. Orientation of a closed curve is defined by the sign of an area. If the area is positive then the closed curve is directed counterclockwise.
If the curve is not closed, but the flag of closedness is set, then an area will be calculated for the curve which is closed by a section connecting bounds.
[in] | curve | - The initial curve. |
[in] | sag | - An angular deviation of a tangent curve at the neighbor integration points, is it used for the calculation of the step by a curve. |
[in] | close | - A flag of closedness. |
bool c3d::EqualPoints | ( | const Point & | p1, |
const Point & | p2, | ||
double | xEpsilon, | ||
double | yEpsilon | ||
) |
Check points for equality.
[in] | p1 | - The first cartesian point. |
[in] | p2 | - The second cartesian point. |
[in] | xEpsilon | - The metric tolerance of points coincidence along the X axis. |
[in] | yEpsilon | - The metric tolerance of points coincidence along the Y axis. |
bool c3d::EqualVectors | ( | const Vector & | p1, |
const Vector & | p2, | ||
double | xEpsilon, | ||
double | yEpsilon | ||
) |
Check equality of vectors with given tolerance.
Check equality of vectors with given tolerance. Vectors are equal if their coordinates differs less than given tolerance.
[in] | p1 | - The first vector. |
[in] | p2 | - The second vector. |
[in] | xEpsilon | - The metric tolerance of points coincidence along the X axis. |
[in] | yEpsilon | - The metric tolerance of points coincidence along the Y axis. |
|
inline |
Check lengths for equality.
[in] | lx,ly | - Compared lengths. |
[in] | minLen | - A minimum possible length. |
[in] | minDev | - A metric accuracy of lengths equality. |
bool FilletMultiline | ( | MbMultiline & | multiline, |
double | rad, | ||
bool | nodeFlag, | ||
MbCartPoint & | pnt, | ||
const StVertexOfMultilineInfo & | vertInfo | ||
) |
Construct a fillet of multiline.
Construct a fillet of the base curve of multiline.
[in] | multiline | - A multiline to be modified. |
[in] | rad | - The radius of fillet. |
[in] | nodeFlag | - Flag of selection of vertices to fillet: true - fillet of all vertices of multiline, false - fillet of the vertex nearest to 'pnt' point. |
[in] | pnt | - Point for indication the required vertex. |
[in] | vertInfo | - Information for new vertices of a multiline. |
bool ChamferMultiline | ( | MbMultiline & | multiline, |
double | len, | ||
double | par, | ||
bool | type, | ||
bool | nodeFlag, | ||
MbCartPoint & | pnt, | ||
const StVertexOfMultilineInfo & | vertInfo | ||
) |
Construct a chamfer of multiline.
Construct a chamfer of the base curve of multiline.
[in] | multiline | - A multiline to be modified. |
[in] | len | - Length of chamfer. |
[in] | par | - Parameter depending on 'type' type: if type = true, par is a corner, if type = false, par is a size. |
[in] | type | - The type of a chamfer specification: true - chamfer specified as size + angle, false - chamfer specified as size + size. |
[in] | nodeFlag | - Flag of selection of vertices to process: true - chamfer between each two neighboring segments of multiline, false - chamfer between two neighboring multiline segments joining at the vertex nearest to 'pnt' point. |
[in] | pnt | - Point for indication the required pair of segments. |
[in] | vertInfo | - Information for new vertices of a multiline. |
void ToTakeIntoCurvesCrvRadii | ( | MbCurve & | curve, |
double | angle, | ||
double & | minPos, | ||
double & | maxNeg | ||
) |
Out-of-class functions for curvature radii calculation/consideration (implementation in MltLine.cpp)
Consider the curve curvature radii.
Consider the curve curvature minimum positive and maximum negative radii.
For internal use only.
[in] | curve | - A curve of multiline. |
[in] | angle | - An angular tolerance. |
[in,out] | minPos | - Curve radius if it is less than current value of 'minPos' variable. |
[in,out] | maxNeg | - Curve radius if it is greater than current value of 'minPos' variable. |
void GetContoursCrvRadii | ( | MbContour & | contour, |
double | angle, | ||
double & | minPos, | ||
double & | maxNeg | ||
) |
Get the contour curvatures radii.
Get the contour curvature minimum positive and maximum negative radii.
For internal use only.
[in] | contour | - A contour. |
[in] | angle | - An angular tolerance. |
[out] | minPos | - Minimal contour segment radius. |
[out] | maxNeg | - Maximal contour segment radius. |
Join two curves.
Smoothly join two consecutive curves.
For internal use only.
[in] | curve1 | - The first curve. |
[in] | curve2 | - The second curve. |
bool BreakMultiline | ( | const MbMultiline & | multiline, |
const MbCartPoint & | p1, | ||
const MbCartPoint & | p2, | ||
PArray< MbMultiline > & | parts | ||
) |
Split multiline.
Split multiline into two pieces.
[in] | multiline | - A multiline to be split. |
[in] | p1 | - Splitting point or start point of a new multiline if the multiline is closed. |
[in] | p2 | - End point of a new multiline if the multiline is closed. |
[out] | parts | - The array of obtained pieces (two elements). |
bool BreakMultilineNParts | ( | const MbMultiline & | multiline, |
size_t | partsCount, | ||
const MbCartPoint & | point, | ||
PArray< MbMultiline > & | parts | ||
) |
Split multiline.
Split multiline into N equal pieces.
[in] | multiline | - A multiline to be split. |
[in] | partsCount | - The count of pieces. |
[in] | point | - Bounding point for closed multiline. |
[out] | parts | - The array of obtained pieces (partsCount elements). |
void GetCorrectRegions | ( | const RPArray< MbContour > & | contours, |
bool | sameContours, | ||
RPArray< MbRegion > & | regions | ||
) |
Get a set of regions.
Get a set of correct regions from arbitrary set of regions.
From sent contours there are selected such contours which are suitable for construction of region - closed, without self-intersections and discontinuities.
[in] | contours | - A set of contours. |
[in] | sameContours | - A flag of using of contours originals when creating regions. |
[out] | regions | - The result is a set of points. |
void MakeRegions | ( | RPArray< MbContour > & | contours, |
bool | useSelfIntCntrs, | ||
bool | sameContours, | ||
RPArray< MbRegion > & | regions | ||
) |
Divide a set of regions into groups and construct regions.
Divide arbitrary set of contours into connected groups of contours and construct regions.
For any contour belonging to connected group, this group contain all contours:
1) which coincide with the given contour
2) which intersect the given contour
3) which contain the given contour
4) which are contained in the given contour
Groups are returned in regions form (perhaps, incorrect).
[in] | contours | - A set of contours for dividing into groups. |
[in] | useSelfIntCntrs | - If true then self-intersected contours form separate groups (incorrect regions), otherwise - such contours are not used at all. |
[in] | sameContours | - A flag of using of contours originals when creating regions. |
[out] | regions | - The result is a set of points. |
bool CreateBooleanResultRegions | ( | RPArray< MbContour > & | contours1, |
RPArray< MbContour > & | contours2, | ||
const MbRegionBooleanParams & | operParams, | ||
RPArray< MbRegion > & | regions, | ||
MbResultType * | resInfo = nullptr |
||
) |
Perform boolean operation with regions.
Perform boolean operation with two regions, which are set by the contours array.
Polyline is undesirable as a contour segment. It needs to be converted to a set of segments.
[in] | contours1 | - First set of contours. |
[in] | contours2 | - Second set of contours. |
[in] | operParams | - A Boolean operation parameters. |
[out] | regions | - The result is a set of points. |
[out] | resInfo | - Operation result code. |
bool CreateBooleanResultRegions | ( | MbRegion & | region1, |
MbRegion & | region2, | ||
const MbRegionBooleanParams & | operParams, | ||
RPArray< MbRegion > & | regions, | ||
MbResultType * | resInfo = nullptr |
||
) |
Perform boolean operation with regions.
Perform boolean operation with two regions.
[in] | region1 | - First region. |
[in] | region2 | - Second region. |
[in] | operParams | - A Boolean operation parameters. |
[out] | regions | - The result is a set of points. |
[out] | resInfo | - Operation result code. |
bool MakeUnionRegions | ( | RPArray< MbRegion > & | regions, |
bool | allowSelfTouch = true , |
||
bool | mergeCurves = true |
||
) |
Perform union of regions.
Perform union of regions.
[in,out] | regions | - Initial and resulting regions. |
[in] | allowSelfTouch | - Admissibility of self-touches as a result. |
[in] | mergeCurves | - Merge similar segments of curves. |