C3D Toolkit
Kernel - 117969, Vision - 2.8.1.4
|
Surface in three-dimensional space. More...
#include <surface.h>
Public Member Functions | |
virtual | ~MbSurface () |
Destructor. | |
virtual void | Accept (Visitor &visitor) |
Implementation of a function initializing a visit of an object. | |
MbeSpaceType | Type () const override |
Get the group object type. | |
MbeSpaceType | Family () const override |
Get family of objects. | |
double | DistanceToPoint (const MbCartPoint3D &) const override |
Determine the distance to the point. More... | |
void | AddYourGabaritTo (MbCube &c) const override |
Expand sent bounding box (a.k.a. gabarit), so that it included the object. More... | |
void | Refresh () override |
Translate all the time (mutable) data objects in an inconsistent (initial) state. | |
virtual void | PrepareIntegralData (const bool forced) const |
Calculate temporary (mutable) data of an object. More... | |
void | CalculateMesh (const MbStepData &stepData, const MbFormNote ¬e, MbMesh &mesh) const override |
Build polygonal copy mesh. More... | |
MbProperty & | CreateProperty (MbePrompt name) const override |
Create your own property with the name. | |
void | GetBasisPoints (MbControlData3D &) const override |
Get control points of object. | |
void | SetBasisPoints (const MbControlData3D &) override |
Change the object by control points. | |
size_t | size () const |
Number of objects if object is interpreted as vector of objects. | |
const MbSurface * | operator[] (size_t) const |
An access operator. | |
Functions for surface domain description. | |
virtual double | GetUMin () const =0 |
Get the minimum value of u. | |
virtual double | GetVMin () const =0 |
Get the minimum value of v. | |
virtual double | GetUMax () const =0 |
Get the maximum value of u. | |
virtual double | GetVMax () const =0 |
Get the maximum value of v. | |
virtual bool | IsUClosed () const =0 |
Determine whether a surface is closed in u-parameter direction. More... | |
virtual bool | IsVClosed () const =0 |
Determine whether a surface is closed in v-parameter direction. More... | |
virtual bool | IsUTouch () const |
Determine whether a surface is closed in u-parameter direction regardless of the smoothness of the closure. More... | |
virtual bool | IsVTouch () const |
Determine whether a surface is closed in v-parameter direction regardless of the smoothness of the closure. More... | |
virtual bool | IsUPeriodic () const |
Determine whether a surface is closed in u-parameter direction. More... | |
virtual bool | IsVPeriodic () const |
Determine whether a surface is closed in v-parameter direction. More... | |
virtual double | GetUPeriod () const |
Return period for smoothly closed surface or 0. | |
virtual double | GetVPeriod () const |
Return period for smoothly closed surface or 0. | |
virtual double | GetPeriod (ptrdiff_t i) const |
Return period. More... | |
virtual size_t | Periodicity () const |
Determine periodicity. More... | |
virtual bool | GetPoleUMin () const |
Whether a pole exists on parametric region boundary. | |
virtual bool | GetPoleUMax () const |
Whether a pole exists on parametric region boundary. | |
virtual bool | GetPoleVMin () const |
Whether a pole exists on parametric region boundary. | |
virtual bool | GetPoleVMax () const |
Whether a pole exists on parametric region boundary. | |
virtual bool | IsPole (double u, double v, double paramPrecision=PARAM_PRECISION) const |
Whether the point is a pole. | |
bool | IsPole (const MbCartPoint &uv, double paramPrecision=PARAM_PRECISION) const |
Whether the point is a pole. | |
Functions for working at surface domain | |
Functions PointOn, Derive... correct parameters when getting out of rectangular domain bounds.
| |
virtual void | PointOn (double &u, double &v, MbCartPoint3D &p) const =0 |
Calculate a point on the surface. More... | |
virtual void | DeriveU (double &u, double &v, MbVector3D &) const =0 |
Calculate first derivative with respect to u. | |
virtual void | DeriveV (double &u, double &v, MbVector3D &) const =0 |
Calculate first derivative with respect to v. | |
virtual void | DeriveUU (double &u, double &v, MbVector3D &) const =0 |
Calculate second derivative with respect to u. | |
virtual void | DeriveVV (double &u, double &v, MbVector3D &) const =0 |
Calculate second derivative with respect to v. | |
virtual void | DeriveUV (double &u, double &v, MbVector3D &) const =0 |
Calculate second derivative. | |
virtual void | DeriveUUU (double &u, double &v, MbVector3D &) const =0 |
Calculate third derivative. | |
virtual void | DeriveUUV (double &u, double &v, MbVector3D &) const =0 |
Calculate third derivative. | |
virtual void | DeriveUVV (double &u, double &v, MbVector3D &) const =0 |
Calculate third derivative. | |
virtual void | DeriveVVV (double &u, double &v, MbVector3D &) const =0 |
Calculate third derivative. | |
virtual void | TangentU (double &u, double &v, MbVector3D &) const |
Calculate tangent vector in u. | |
virtual void | TangentV (double &u, double &v, MbVector3D &) const |
Calculate tangent vector in v. | |
virtual void | Normal (double &u, double &v, MbVector3D &) const |
Calculate normal. | |
virtual void | NormalU (double &u, double &v, MbVector3D &) const |
Calculate derivative of normal with respect to U. | |
virtual void | NormalV (double &u, double &v, MbVector3D &) const |
Calculate derivative of normal with respect to V. | |
virtual void | Explore (double &u, double &v, MbCartPoint3D &pnt, MbVector3D &uDer, MbVector3D &vDer) const |
Calculate point and first derivatives with respect to u and with respect to v. More... | |
Functions for working inside and outside the surface domain. | |
functions _PointOn, _Derive... of surfaces don't correct parameters when getting out of rectangular domain bounds. | |
virtual void | _PointOn (double u, double v, MbCartPoint3D &p) const |
Calculate a point on the surface. More... | |
virtual void | _DeriveU (double u, double v, MbVector3D &) const |
Calculate first derivative with respect to u on extended surface. | |
virtual void | _DeriveV (double u, double v, MbVector3D &) const |
Calculate first derivative with respect to v on extended surface. | |
virtual void | _DeriveUU (double u, double v, MbVector3D &) const |
Calculate second derivative with respect to u on extended surface. | |
virtual void | _DeriveVV (double u, double v, MbVector3D &) const |
Calculate second derivative with respect to v on extended surface. | |
virtual void | _DeriveUV (double u, double v, MbVector3D &) const |
Calculate second derivative on extended surface. | |
virtual void | _DeriveUUU (double u, double v, MbVector3D &) const |
Calculate third derivative on extended surface. | |
virtual void | _DeriveUUV (double u, double v, MbVector3D &) const |
Calculate third derivative on extended surface. | |
virtual void | _DeriveUVV (double u, double v, MbVector3D &) const |
Calculate third derivative on extended surface. | |
virtual void | _DeriveVVV (double u, double v, MbVector3D &) const |
Calculate third derivative on extended surface. | |
virtual void | _TangentU (double u, double v, MbVector3D &) const |
Calculate tangent vector in u direction on extended surface. | |
virtual void | _TangentV (double u, double v, MbVector3D &) const |
Calculate tangent vector in v direction on extended surface. | |
virtual void | _Normal (double u, double v, MbVector3D &) const |
Calculate a normal on extended surface. | |
virtual void | _NormalU (double u, double v, MbVector3D &) const |
Calculate derivative of normal vector on extended surface. | |
virtual void | _NormalV (double u, double v, MbVector3D &) const |
Calculate derivative of normal vector on extended surface. | |
virtual void | _NormalUU (double u, double v, MbVector3D &) const |
Calculate second derivative of normal vector on extended surface. | |
virtual void | _NormalUV (double u, double v, MbVector3D &) const |
Calculate second derivative of normal vector on extended surface. | |
virtual void | _NormalVV (double u, double v, MbVector3D &) const |
Calculate second derivative of normal vector on extended surface. | |
virtual void | _NormalD (double u, double v, double du, double dv, MbVector3D &der) const |
Calculate derivative of normal vector at the point with the given parameters u and v along the line with the given direction (du,dv). | |
virtual void | _NormalDD (double u, double v, double du, double dv, MbVector3D &der) const |
Calculate second derivative of normal vector at the point with the given parameters u and v along the line with the given direction (du,dv). | |
virtual void | Explore (double &u, double &v, bool ext, MbCartPoint3D &pnt, MbVector3D &uDer, MbVector3D &vDer, MbVector3D *uuDer, MbVector3D *vvDer, MbVector3D *uvDer, MbVector3D *nor) const |
Calculate point and derivatives of object for given parameters. More... | |
virtual void | _PointNormal (double u, double v, MbCartPoint3D &pnt, MbVector3D &deru, MbVector3D &derv, MbVector3D &norm, MbVector3D &noru, MbVector3D &norv, MbVector3D &deruu, MbVector3D &dervv, MbVector3D &deruv) const |
Calculate all derivatives at point. More... | |
Functions of moving on surface | |
virtual double | StepU (double u, double v, double sag) const |
Calculate parameter step. More... | |
virtual double | StepV (double u, double v, double sag) const |
Calculate parameter step. More... | |
virtual double | DeviationStepU (double u, double v, double angle) const |
Calculate parameter step. More... | |
virtual double | DeviationStepV (double u, double v, double angle) const |
Calculate parameter step. More... | |
virtual double | MetricStepU (double u, double v, double length) const |
Calculate parameter step. More... | |
virtual double | MetricStepV (double u, double v, double length) const |
Calculate parameter step. More... | |
double | SurfaceStep (const double &u, const double &v, bool alongU, const MbStepData &stepData) const |
Calculate parameter step. More... | |
virtual size_t | GetUCount () const |
The number of splittings by u-parameter for a check of events. | |
virtual size_t | GetVCount () const |
The number of splittings by v-parameter for a check of events. | |
Common functions of surface. | |
virtual const MbSurface & | GetSurface () const |
Get itself (it is overloaded only in CurveBoundedSurface). | |
virtual const MbSurface & | GetBasisSurface () const |
Get the base surface if exists or itself. | |
virtual MbSurface & | SetSurface () |
Get itself (it is overloaded only in CurveBoundedSurface). | |
virtual MbSurface & | SetBasisSurface () |
Get the base surface if exists or itself. | |
virtual void | GetLimitPoint (ptrdiff_t number, MbCartPoint3D &pnt) const |
Calculate the boundary point. More... | |
virtual void | GetLimitPoint (ptrdiff_t number, MbCartPoint &pnt) const |
Calculate the boundary two-dimensional point. More... | |
MbCartPoint3D | GetLimitPoint (ptrdiff_t number) const |
Calculate the boundary point. More... | |
virtual double | CurvatureU (double u, double v) const |
Calculate line curvature along the direction of u. More... | |
virtual double | CurvatureV (double u, double v) const |
Calculate line curvature along the direction of v. More... | |
double | NormalCurvatureU (double u, double v) const |
Calculate a normal curvature of line along the direction of u. More... | |
double | NormalCurvatureV (double u, double v) const |
Calculate a normal curvature of line along the direction of v. More... | |
double | NormalCurvature (double u, double v, double du, double dv) const |
Calculate a normal curvature of surface. More... | |
bool | MeanGaussCurvature (double u, double v, double &mean, double &gauss) const |
Calculate the mean and the Gaussian curvature. More... | |
bool | MainCurvatures (double u, double v, double &c1, double &c2, double &du, double &dv) const |
Calculate the mean and the Gaussian curvature. More... | |
virtual bool | IsSameBase (const MbSurface &) const |
Whether a base surface is a copy of the base surface of the given object. | |
virtual bool | IsPlanar (double accuracy=METRIC_EPSILON) const |
Whether a surface is planar. | |
virtual double | GetRadius () const |
Get the physical radius of the object or null if it impossible. More... | |
virtual double | GetFilletRadius (const MbCartPoint3D &p, double accuracy=METRIC_REGION) const |
Get fillet radius if the surface is a fillet surface with the set accuracy. More... | |
virtual MbeParamDir | GetFilletDirection (double accuracy=METRIC_REGION) const |
Direction of fillet surface with accuracy. More... | |
virtual bool | GetCylinderAxis (MbAxis3D &) const |
Get rotation axis of a surface. | |
virtual bool | GetCentre (MbCartPoint3D &c) const |
Give the center of sphere surface. | |
virtual bool | GetCenterLines (std::vector< MbCurve3D * > &clCurves) const |
Get center lines of a surface. | |
virtual void | ChangeCarrier (const MbSpaceItem &item, MbSpaceItem &init) |
Changing of carrier. More... | |
virtual bool | ChangeCarrierBorne (const MbSurface &item, MbSurface &init, const MbMatrix &matr) |
Changing of carrier elements. More... | |
virtual bool | IsSpinePeriodic () const |
Periodicity of the guide. More... | |
MbSplineSurface * | NurbsSurface (bool bmatch=false) const |
Construct a NURBS copy of a surface. More... | |
virtual MbSplineSurface * | NurbsSurface (double u1, double u2, double v1, double v2, bool bmatch=false) const |
Construct a NURBS copy of trimmed surface. More... | |
virtual MbSurface * | NurbsSurface (const MbNurbsParameters &uParam, const MbNurbsParameters &vParam) const |
Construct a NURBS copy of a surface. More... | |
bool | NurbsParam (const MbNurbsParameters &tParam, bool uParam, double op1, double op2, bool &isClosedNurbs, double &epsilon, SArray< double > ¶ms) const |
Prepare parameters for the transformation to NURBS surface. More... | |
void | CheckApproxPointParamsOpen (bool isU, double par, size_t degree, size_t pCount, SArray< double > &tList, SArray< double > &aKnots) const |
Chose points for approximation along the parameter. More... | |
void | CheckApproxPointParamsClosed (bool isU, double par, size_t degree, size_t pCount, SArray< double > &tList, SArray< double > &aKnots) const |
Chose points for approximation along the parameter. More... | |
virtual MbSurface * | Offset (double d, bool same) const |
Create an offset surface. More... | |
virtual MbCurve3D * | CurveU (double v, MbRect1D *pRgn, bool bApprox=true) const |
Construct spatial copy of the line v = const. More... | |
virtual MbCurve3D * | CurveV (double u, MbRect1D *pRgn, bool bApprox=true) const |
Construct spatial copy of the line u = const. More... | |
virtual MbCurve3D * | CurveUV (const MbLineSegment &segm, bool bApprox=true) const |
Construct spatial copy of line by parametric line. More... | |
virtual MbeItemLocation | PointRelative (const MbCartPoint3D &pnt, double eps=ANGLE_REGION) const |
Get point location relative to the surface. More... | |
virtual MbeItemLocation | PointClassification (const MbCartPoint &pnt, bool ignoreClosed=false) const |
A point is located inside the region on a surface. More... | |
virtual double | DistanceToBorder (const MbCartPoint &point, double &epsilon) const |
Calculate the parametric distance to the nearest boundary. More... | |
virtual size_t | CurveClassification (const MbCurve &curve, SArray< double > &tcurv, SArray< MbVector > &dir) const |
Determine points of intersections between the curve and the surface contours. More... | |
size_t | SurfaceBorderIntersection (const MbCurve &curve, SArray< double > &tcurv, SArray< MbVector > &dir) const |
Determine points of intersections between the curve and the surface contours. More... | |
virtual MbeNewtonResult | PointProjectionNewton (const MbCartPoint3D &p, size_t iterLimit, double &u, double &v, bool ext) const |
Finding of point projection on surface. For internal use only. | |
virtual bool | NearPointProjection (const MbCartPoint3D &pnt, double &u, double &v, bool ext, MbRect2D *uvRange=nullptr) const |
Find the projection of a point onto the surface. More... | |
virtual MbeNewtonResult | DirectPointProjectionNewton (const MbCartPoint3D &p, const MbVector3D &vect, size_t iterLimit, double &u, double &v, double &w, bool ext) const |
Finding of point projections to the surface in direction of the vector. For internal use only. | |
virtual void | DirectPointProjection (const MbCartPoint3D &pnt, const MbVector3D &vect, SArray< MbCartPoint > &uv, bool ext, MbRect2D *uvRange=nullptr) const |
Find all a point projection onto the surface along a vector in either of two directions. More... | |
virtual bool | NearDirectPointProjection (const MbCartPoint3D &pnt, const MbVector3D &vect, double &u, double &v, bool ext, MbRect2D *uvRange=nullptr, bool onlyPositiveDirection=false) const |
Find the nearest point projection to the surface in the vector direction. More... | |
virtual MbeNewtonResult | CurveIntersectNewton (const MbCurve3D &curv1, double funcEpsilon, size_t iterLimit, double &u0, double &v0, double &t1, bool ext0, bool ext1) const |
Solution of equation system for determination of intersections between a surface and a curve. For internal use only. | |
virtual MbeNewtonResult | CurveTangentNewton (const MbCurve3D &curv1, double funcEpsilon, size_t iterLimit, double &u0, double &v0, double &t1, bool ext0, bool ext1) const |
Solution of equation system for determination of tangency between a surface and a curve. For internal use only. | |
virtual void | CurveIntersection (const MbCurve3D &curv, SArray< MbCartPoint > &uv, SArray< double > &tt, bool ext0, bool ext, bool touchInclude=false) const |
Determine points of intersection between a surface and a curve. More... | |
virtual MbeNewtonResult | SurfaceIntersectNewton (const MbSurface &surf1, MbeParamDir switchPar, double funcEpsilon, size_t iterLimit, double &u0, double &v0, double &u1, double &v1, bool ext0, bool ext1) const |
Solution of equation system for determination of surfaces intersections. For internal use only. | |
virtual MbeNewtonResult | SurfaceTangentNewton (const MbSurface &surf1, MbeParamDir switchPar, double funcEpsilon, size_t iterLimit, double &u0, double &v0, double &u1, double &v1, bool ext0, bool ext1) const |
Solution of equation system for determination of surfaces tangency. For internal use only. | |
virtual MbeNewtonResult | SilhouetteNewton (const MbVector3D &eye, bool perspective, const MbAxis3D *axis, MbeParamDir switchPar, double funcEpsilon, size_t iterLimit, double &u, double &v, bool ext) const |
Solution of equation system for determination of surface silhouette points. For internal use only. | |
virtual bool | IsSimilarToSurface (const MbSurface &surf, VERSION version, double precision=METRIC_PRECISION) const |
Define whether the surfaces are similar for merge. More... | |
virtual bool | IsSpecialSimilarToSurface (const MbSurface &surf, VERSION version, double precision=METRIC_PRECISION) const |
Whether the surfaces are similar to merge. Special case. For internal use only. | |
virtual bool | ProjectCurveOnSimilarSurface (const MbCurve3D &spaceCurve, const MbCurve &curve, const MbSurface &surfNew, MbCurve *&curveNew) const |
Construction of projection of a surface curve on coincident surface. More... | |
bool | ProjectCurveOnSimilarSurface (const MbCurve3D &spaceCurve, const MbCurve &curve, const MbSurface &surfNew, SPtr< MbCurve > &curveNew) const |
Construction of projection of a surface curve on coincident surface. More... | |
virtual bool | GetMatrixToSurface (const MbSurface &surf, MbMatrix &matr, VERSION version, double precision=METRIC_PRECISION) const |
Get two-dimensional matrix of transformation from its parametric region to the parametric region of 'surf'. More... | |
virtual ThreeStates | Salient () const |
Determine whether the surface is convex. More... | |
virtual double | DistanceToCurve (const MbCurve3D &curve, double &u, double &v, double &t, bool tCalc=false) const |
Calculate the nearest distance to a curve. More... | |
virtual double | DistanceToSurface (const MbSurface &surf1, double &u0, double &v0, double &u1, double &v1) const |
Calculate the nearest distance to a surface. More... | |
virtual bool | CreateNormalPlacements (const MbVector3D &axisZ, double angle, SArray< MbPlacement3D > &places, VERSION version=Math::DefaultMathVersion()) const |
Construct normal placements of constructive planes. | |
virtual bool | CreateTangentPlacements (const MbVector3D &axisZ, SArray< MbPlacement3D > &places) const |
Construct tangent placements of constructive planes. | |
MbeNewtonResult | PlacementNewton (const MbVector3D &vec, double angle, MbeParamDir switchPar, size_t iterLimit, double &u, double &v) const |
Construct tangent placements of constructive planes. For internal use only. | |
bool | CreateVconstPlacements (const MbVector3D &axisZ, double angle, bool normalPlace, SArray< MbPlacement3D > &places) const |
Construct the normal or tangent placements on v-lines. | |
bool | CreateUconstPlacements (const MbVector3D &axisZ, double angle, bool normalPlace, SArray< MbPlacement3D > &places) const |
Construct the normal or tangent placements on u-lines. | |
virtual double | ParamArea () const |
Calculate the area of parameters domain. | |
virtual size_t | GetUPairs (double v, SArray< double > &u) const |
Calculate U-pairs by V. More... | |
virtual size_t | GetVPairs (double u, SArray< double > &v) const |
Calculate V-pairs by U. More... | |
MbeNewtonResult | IsoclinalNewton (const MbVector3D &dir, size_t iterLimit, double &u, double &v) const |
Determination of parameters of a surface isocline point. For internal use only. | |
virtual void | GetIsoclinal (const MbVector3D &nor, SArray< MbCartPoint > &uv) const |
Find all isoclines of a surface. More... | |
virtual void | CalculateGabarit (MbCube &cube) const |
Calculate bounding box of surface. It is recommended to use GetGabarit. | |
void | CalculateLocalGabarit (const MbMatrix3D &into, MbCube &cube) const override |
Calculate bounding box in the local coordinate system. | |
const MbCube & | GetGabarit () const |
Calculate bounding box of surface. | |
const MbCube & | Cube () const |
Return saved bounding box. It should be empty. It is recommended to use GetGabarit. | |
void | SetDirtyGabarit () const |
Make the bounding box empty. For internal use only. | |
void | CopyGabarit (const MbSurface &s, const MbVector3D *to=nullptr) |
Copy the bounding box from the copy. More... | |
double | GetGabDiagonal () const |
Calculate the diagonal of the bounding box. | |
void | CalculateRect (const MbPlacement3D &place, MbRect &rect) const |
Calculate the rectangular bounding box of a surface in the given plane. More... | |
virtual MbContour & | MakeContour (bool sense) const |
Return the bounding two-dimensional contour. More... | |
virtual MbCurve & | MakeSegment (size_t i, bool sense) const |
Return a segment of the bounding two-dimensional contour. More... | |
MbCurve & | MakeCurve (size_t number1, size_t number2) const |
Return a segment of the bounding two-dimensional contour. More... | |
virtual void | SetLimit (double u1, double v1, double u2, double v2) |
Set surface limits. For internal use only. | |
void | SetLimit (const MbRect &) |
Set surface limits. For internal use only. | |
virtual void | SetExtendedParamRegion (double u1, double v1, double u2, double v2) |
Set extended limits of surface. For internal use only. | |
virtual void | IncludePoint (double u, double v) |
Include a point into domain. For internal use only. | |
double | GetMaxParamDeltaU () const |
Get the maximum increment of U-parameter. | |
double | GetMaxParamDeltaV () const |
Get the maximum increment of V-parameter. | |
virtual double | GetParamDelta () const |
Get the maximum increment of parameter. | |
virtual double | GetParamPrice () const |
Get the minimum distinguishable value of parameter. | |
virtual double | GetUParamToUnit () const |
Get increment of u-parameter, corresponding to the unit length in space. | |
virtual double | GetVParamToUnit () const |
Get increment of v-parameter, corresponding to the unit length in space. | |
virtual double | GetUParamToUnit (double u, double v) const |
Get increment of u-parameter, corresponding to the unit length in space. | |
virtual double | GetVParamToUnit (double u, double v) const |
Get increment of v-parameter, corresponding to the unit length in space. | |
double | GetUParamToUnit (const MbCartPoint &uv) const |
Get increment of u-parameter, corresponding to the unit length in space. | |
double | GetVParamToUnit (const MbCartPoint &uv) const |
Get increment of v-parameter, corresponding to the unit length in space. | |
virtual void | GetParamsToUnit (double u, double v, double &uParam, double &vParam) const |
Get increment of parameters, corresponding to the unit length in space. | |
double | GetUEpsilon () const |
Get the minimum distinguishable value of u-parameter. It corresponds to the length Math::metricEpsilon in space. | |
double | GetVEpsilon () const |
Get the minimum distinguishable value of v-parameter. It corresponds to the length Math::metricEpsilon in space. | |
double | GetUEpsilon (double u, double v) const |
Get the minimum distinguishable value of u-parameter. It corresponds to the length Math::metricEpsilon in space. | |
double | GetVEpsilon (double u, double v) const |
Get the minimum distinguishable value of v-parameter. It corresponds to the length Math::metricEpsilon in space. | |
double | GetURegion () const |
Get the minimum distinguishable value of u-parameter. It corresponds to the length Math::metricRegion in space. | |
double | GetVRegion () const |
Get the minimum distinguishable value of v-parameter. It corresponds to the length Math::metricRegion in space. | |
double | GetURegion (double u, double v) const |
Get the minimum distinguishable value of u-parameter. It corresponds to the length Math::metricRegion in space. | |
double | GetVRegion (double u, double v) const |
Get the minimum distinguishable value of v-parameter. It corresponds to the length Math::metricRegion in space. | |
virtual size_t | GetUMeshCount () const |
The the number of splittings in u-direction. | |
virtual size_t | GetVMeshCount () const |
The the number of splittings in v-direction. | |
void | CalculatePolygon (double minPar, double maxPar, double constPar, MbeParamDir dir, const MbStepData &stepData, MbPolygon3D &polygon) const |
Calculate polygon by u or v. More... | |
virtual void | CalculateSurfaceWire (const MbStepData &stepData, size_t beg, MbMesh &mesh, size_t uMeshCount=c3d::WIRE_MAX, size_t vMeshCount=c3d::WIRE_MAX) const |
Calculate mesh. More... | |
virtual void | GetTesselation (const MbStepData &stepData, double u1, double u2, double v1, double v2, SArray< double > &uu, SArray< double > &vv) const |
Determine a splitting of parametric region of a surface by verticals and horizontals. More... | |
void | AddTesselation (const MbStepData &stepData, MbeParamDir dir, double u1, double u2, double v1, double v2, SArray< double > &uu, SArray< double > &vv) const |
Determine splitting of the surface parametric region according to direction. More... | |
virtual void | CalculateSurfaceGrid (const MbStepData &stepData, bool sense, MbGrid &grid) const |
Approximate a surface by triangular plates. More... | |
virtual bool | IsRectangular () const |
Determine whether derivatives with respect to u and v are orthogonal. | |
virtual bool | IsLineU () const |
Check that all derivatives of surface with respect to u which have more than first order are equal to null. | |
virtual bool | IsLineV () const |
Check that all derivatives of surface with respect to v which have more than first order are equal to null. | |
virtual bool | IsShift (const MbSpaceItem &obj, MbVector3D &dir, bool &isSame, double accuracy=LENGTH_EPSILON) const |
Determine whether the object is a translation. More... | |
virtual void | CheckSurfParams (double &u, double &v) const |
Check parameters. Analogue of the global function _CheckParams, optimized for caches usage. More... | |
bool | GetPlacement (MbPlacement3D *place, bool exact=false) const |
Get a local coordinate system of planar surface (or only a possibility of getting it). | |
bool | GetPlanePlacement (MbPlacement3D &place) const |
Get a local coordinate system if a surface is a plane. | |
bool | GetControlPlacement (MbPlacement3D &place, bool sameSense=true) const |
Construct a local coordinate system of a surface with origin at the middle point of base surface parametric limits. More... | |
bool | OrientPlacement (MbPlacement3D &place, bool normalSense=true) const |
Orient an axis X of a placement along the line of its intersection with surface. | |
bool | IsPointOn (const MbCartPoint3D &, double eps=METRIC_PRECISION) const |
Determine whether a point is located on a surface or not. | |
void | PointOn (MbCartPoint &uv, MbCartPoint3D &p) const |
Calculate the point on a surface inside the domain of surface. | |
void | _PointOn (const MbCartPoint &uv, MbCartPoint3D &p) const |
Calculate a point on a surface extension. | |
void | Normal (MbCartPoint &uv, MbVector3D &v) const |
Calculate the normal vector to a surface inside the domain of surface. | |
bool | GetMatrix (double xMin, double xMax, double yMin, double yMax, MbMatrix &matr) const |
Find a matrix of transformation for the curves on a surface when the parameterization is changed. More... | |
double | GetUMid () const |
The middle value of u. | |
double | GetVMid () const |
The middle value of v. | |
double | GetURange () const |
Parametric length by u. | |
double | GetVRange () const |
Parametric length by v. | |
void | GetRect (MbRect &r) const |
Get parametric bounding box. | |
void | GetRect (MbRect2D &r) const |
Get parametric bounding box. | |
![]() | |
virtual | ~MbSpaceItem () |
Destructor. | |
void | PrepareWrite () const |
Register object. More... | |
MbeRefType | RefType () const override |
Get a registration type (for copying, duplication). | |
virtual MbeSpaceType | IsA () const =0 |
Get the type of the object. | |
bool | IsFamilyRegistrable () const override |
Whether the object belongs to a registrable family. | |
virtual MbSpaceItem & | Duplicate (MbRegDuplicate *iReg=nullptr) const =0 |
Create a copy of the object. More... | |
virtual void | Transform (const MbMatrix3D &matr, MbRegTransform *iReg=nullptr)=0 |
Convert the object according to the matrix. More... | |
virtual void | Move (const MbVector3D &to, MbRegTransform *iReg=nullptr)=0 |
Move an object along a vector. More... | |
virtual void | Rotate (const MbAxis3D &axis, double angle, MbRegTransform *iReg=nullptr)=0 |
Rotate an object around an axis at a given angle. More... | |
virtual bool | IsSame (const MbSpaceItem &other, double accuracy=LENGTH_EPSILON) const =0 |
Determine whether an object is equal. More... | |
virtual bool | IsSimilar (const MbSpaceItem &item) const |
Determine whether an object is similar. More... | |
virtual bool | SetEqual (const MbSpaceItem &item)=0 |
Make objects equal if they are similar. More... | |
virtual void | GetProperties (MbProperties &properties)=0 |
Outstanding properties of the object. More... | |
virtual void | SetProperties (const MbProperties &properties)=0 |
Change the properties of an object. More... | |
void | CalculateWire (const MbStepData &stepData, MbMesh &mesh) const |
void | CalculateWire (double sag, MbMesh &mesh) const |
virtual void | GetBasisItems (RPArray< MbSpaceItem > &) |
Outstanding reference objects in a container sent. | |
![]() | |
TapeBase (RegistrableRec regs=noRegistrable) | |
Constructor. | |
TapeBase (const TapeBase &) | |
Copy-constructor. | |
virtual | ~TapeBase () |
Destructor. | |
RegistrableRec | GetRegistrable () const |
Whether the stream class is registrable. | |
void | SetRegistrable (RegistrableRec regs=registrable) const |
Set the state of registration of the stream class. | |
virtual const char * | GetPureName (const VersionContainer &) const |
Get the class name. | |
![]() | |
refcount_t | GetUseCount () const |
Get count of references (get count of owners of an object). | |
refcount_t | AddRef () const |
Increase count of references by one. | |
refcount_t | DecRef () const |
Decrease count of references by one. | |
refcount_t | Release () const |
Decrease count of references by one and if count of references became zero, then remove itself. | |
![]() | |
void | Lock () const |
Switch lock on (locking happens only in parallel region). | |
void | Unlock () const |
Switch lock off if locking has been set. | |
CommonRecursiveMutex * | GetLock () const |
Get a pointer to the mutex object. Return nullptr if no parallelism. For use in ScopedLock. | |
Protected Member Functions | |
MbSurface () | |
Constructor. | |
MbSurface (const MbSurface &) | |
Copy-constructor. | |
void | MoveGabarit (const MbVector3D &v) |
Move bounding box. | |
void | NormalCalculation (const MbVector3D &uDer, const MbVector3D &vDer, double u, double v, bool ext, MbVector3D &nor) const |
Normal calculation by derivatives uDer and vDer on point with parameters u, v. | |
double | StepAlong (double u, double v, double sag, bool alongU, double stepMinCoeff, const MbVector3D &der, const MbVector3D &sec) const |
Step calculation by sag. | |
double | DeviationStepAlong (double u, double v, double angle, bool alongU, const MbVector3D &der, const MbVector3D &sec) const |
Step calculation by normal deviation. | |
![]() | |
MbSpaceItem () | |
Default constructor. | |
![]() | |
MbRefItem () | |
Constructor without parameters. | |
Protected Attributes | |
MbCube | cube |
Bounding box of surface. More... | |
Surface in three-dimensional space.
The parent class for all surfaces in three-dimensional space. A surface is a vector function of two scalar parameters, taking values on the two-dimensional connected region. Surface represents a continuous mapping of two-dimensional connected region to three-dimensional space.
For all surfaces, except MbCurveBoundedSurface, the domain is a rectangle in two-dimensional parameter space.
A surface is used:
for spatial modeling,
for construction of solid faces in special cases.
|
overridevirtual |
Determine the distance to the point.
Determine the distance to the point.
[in] | point | - Point. |
Implements MbSpaceItem.
Expand sent bounding box (a.k.a. gabarit), so that it included the object.
Expand sent bounding box, so that it included the object.
[in,out] | cube | - The bounding box to expand. |
Implements MbSpaceItem.
|
virtual |
Calculate temporary (mutable) data of an object.
Calculate the temporary data of an object depending of the "forced" parameter. Calculate only data that was not calculated earlier if parameter "forced" is equal false. Recalculate all temporary data of an object if parameter "forced" is equal true.
[in] | forced | - Forced recalculation. |
|
overridevirtual |
Build polygonal copy mesh.
Build a polygonal copy of the object that is represented by polygons or/and fasets.
[in] | stepData | - Data for еру step calculation for polygonal object. |
[in] | note | - Way for polygonal object constructing. |
[in,out] | mesh | - The builded polygonal object. |
Implements MbSpaceItem.
|
pure virtual |
Determine whether a surface is closed in u-parameter direction.
Determine whether a surface is closed smoothly in u-parameter direction without regard to the boundary contour. It is always false for MbCurveBoundSurface. It is recommended to use IsUPeriodic.
Implemented in MbTorusSurface, MbSweptSurface, MbSplineSurface, MbSphereSurface, MbSmoothSurface, MbSectionSurface, MbPolySurface, MbPlane, MbOffsetSurface, MbMeshSurface, MbLoftedSurface, MbJoinSurface, MbGridSurface, MbGregorySurface, MbCylinderSurface, MbCurveBoundedSurface, MbCoverSurface, MbCornerSurface, MbCoonsPatchSurface, and MbConeSurface.
|
pure virtual |
Determine whether a surface is closed in v-parameter direction.
Determine whether a surface is closed smoothly in v-parameter direction without regard to the boundary contour. It is always false for MbCurveBoundSurface. It is recommended to use IsVPeriodic.
Implemented in MbTorusSurface, MbSweptSurface, MbSplineSurface, MbSphereSurface, MbSmoothSurface, MbSectionSurface, MbPolySurface, MbPlane, MbOffsetSurface, MbMeshSurface, MbLoftedSurface, MbJoinSurface, MbGridSurface, MbGregorySurface, MbCylinderSurface, MbCurveBoundedSurface, MbCoverSurface, MbCornerSurface, MbCoonsPatchSurface, and MbConeSurface.
|
virtual |
Determine whether a surface is closed in u-parameter direction regardless of the smoothness of the closure.
Determine whether a surface is actually closed in u-parameter direction regardless of the smoothness of the closure.
Reimplemented in MbSweptSurface, MbSplineSurface, MbMeshSurface, MbGregorySurface, and MbCurveBoundedSurface.
|
virtual |
Determine whether a surface is closed in v-parameter direction regardless of the smoothness of the closure.
Determine whether a surface is actually closed in v-parameter direction regardless of the smoothness of the closure.
Reimplemented in MbSplineSurface, MbMeshSurface, MbGregorySurface, and MbCurveBoundedSurface.
|
virtual |
Determine whether a surface is closed in u-parameter direction.
Determine whether a surface is smoothly closed in u-parameter direction.
Reimplemented in MbSplineSurface, MbMeshSurface, MbGregorySurface, and MbCurveBoundedSurface.
|
virtual |
Determine whether a surface is closed in v-parameter direction.
Determine whether a surface is smoothly closed in v-parameter direction.
Reimplemented in MbSplineSurface, MbMeshSurface, MbGregorySurface, and MbCurveBoundedSurface.
|
virtual |
Return period.
Period is calculated for smoothly closed surface in one of its parameters. If a surface is not closed in this parameter then 0 is returned.
[in] | i | - Shows direction: 0 - period in u, 1 - period in v. |
|
virtual |
Determine periodicity.
Whether a surface is periodic.
|
virtual |
Calculate the boundary point.
Calculate one of the points where parameters take the maximum or the minimum values.
[in] | number | - A number of a boundary point. 1 corresponds to the point (umin, vmin) 2 corresponds to the point (umax, vmin) 3 corresponds to the point (umax, vmax) 4 corresponds to the point (umin, vmax) |
[in,out] | pnt | - A calculated point. |
Reimplemented in MbPlane, MbGridSurface, and MbCurveBoundedSurface.
|
virtual |
Calculate the boundary two-dimensional point.
Calculate one of the points where parameters take the maximum or the minimum values.
[in] | number | - A number of a boundary point. 1 corresponds to the point (umin, vmin) 2 corresponds to the point (umax, vmin) 3 corresponds to the point (umax, vmax) 4 corresponds to the point (umin, vmax) |
[in,out] | pnt | - A calculated point. |
Reimplemented in MbPlane, MbGridSurface, and MbCurveBoundedSurface.
MbCartPoint3D MbSurface::GetLimitPoint | ( | ptrdiff_t | number | ) | const |
Calculate the boundary point.
Calculate one of the points where parameters take the maximum or the minimum values.
[in] | number | - A number of a boundary point. 1 corresponds to the point (umin, vmin) 2 corresponds to the point (umax, vmin) 3 corresponds to the point (umax, vmax) 4 corresponds to the point (umin, vmax) |
|
virtual |
Calculate line curvature along the direction of u.
There is calculated a line curvature along the direction of u when v = const.
[in] | u | - Parameter. |
[in] | v | - Parameter. |
Reimplemented in MbTorusSurface, MbSpiralSurface, MbSphereSurface, MbSectionSurface, MbRuledSurface, MbRevolutionSurface, MbPlane, MbOffsetSurface, MbExtrusionSurface, MbExpansionSurface, MbEvolutionSurface, MbCylinderSurface, MbCurveBoundedSurface, and MbConeSurface.
|
virtual |
Calculate line curvature along the direction of v.
There is calculated a line curvature along the direction of v when u = const.
[in] | u | - Parameter. |
[in] | v | - Parameter. |
Reimplemented in MbTorusSurface, MbSphereSurface, MbSectorSurface, MbRuledSurface, MbRevolutionSurface, MbPlane, MbOffsetSurface, MbFilletSurface, MbExtrusionSurface, MbExpansionSurface, MbCylinderSurface, MbCurveBoundedSurface, MbConeSurface, and MbChamferSurface.
double MbSurface::NormalCurvatureU | ( | double | u, |
double | v | ||
) | const |
Calculate a normal curvature of line along the direction of u.
Normal curvature of the coordinate line is calculated along the direction of u.
[in] | u | - Parameter. |
[in] | v | - Parameter. |
double MbSurface::NormalCurvatureV | ( | double | u, |
double | v | ||
) | const |
Calculate a normal curvature of line along the direction of v.
Normal curvature of the coordinate line is calculated along the direction of v.
[in] | u | - Parameter. |
[in] | v | - Parameter. |
double MbSurface::NormalCurvature | ( | double | u, |
double | v, | ||
double | du, | ||
double | dv | ||
) | const |
Calculate a normal curvature of surface.
Normal curvature of surface is calculated along the line (du, dv).
[in] | u | - Parameter. |
[in] | v | - Parameter. |
[in] | du | - Sets the direction of line a normal curvature is calculated along. |
[in] | dv | - Sets the direction of line a normal curvature is calculated along. |
bool MbSurface::MeanGaussCurvature | ( | double | u, |
double | v, | ||
double & | mean, | ||
double & | gauss | ||
) | const |
Calculate the mean and the Gaussian curvature.
The mean and the Gaussian curvature.
[in] | u | - Parameter. |
[in] | v | - Parameter. |
[out] | mean | - Mean curvature. |
[out] | gauss | - Gaussian curvature. |
bool MbSurface::MainCurvatures | ( | double | u, |
double | v, | ||
double & | c1, | ||
double & | c2, | ||
double & | du, | ||
double & | dv | ||
) | const |
Calculate the mean and the Gaussian curvature.
The mean and the Gaussian curvature.
[in] | u | - First surface parameter. |
[in] | v | - Second surface parameter. |
[out] | c1 | - First surface curvature. |
[out] | c2 | - Second surface curvature. |
[out] | du | - du and dv are the components of the curvature vector. |
[out] | dv | - du and dv are the components of the curvature vector. |
|
virtual |
Get the physical radius of the object or null if it impossible.
Method returns maximum physical radius by one of the parametric direction if the corresponding parametric curve is the arc, method returns zero otherwise.
Reimplemented in MbTorusSurface, MbSplineSurface, MbSphereSurface, MbFilletSurface, MbExtrusionSurface, MbCylinderSurface, MbCurveBoundedSurface, and MbConeSurface.
|
virtual |
Get fillet radius if the surface is a fillet surface with the set accuracy.
Get fillet radius if the surface is a fillet surface with the set accuracy. Accuracy is used to compare surface slices to an arc to find rotation axis.
[in] | p | - Point near which the radius is searched. Used when the radius is variable. |
[in] | accuracy | - Accuracy. |
Reimplemented in MbTorusSurface, MbSplineSurface, MbSphereSurface, MbRevolutionSurface, MbFilletSurface, MbExtrusionSurface, MbCylinderSurface, MbCoonsPatchSurface, MbConeSurface, MbChannelSurface, and MbCurveBoundedSurface.
|
virtual |
Direction of fillet surface with accuracy.
Direction of fillet surface with accuracy. Accuracy is used to compare surface slices to an arc to find rotation axis.
[in] | accuracy | - Accuracy. |
Reimplemented in MbSplineSurface, MbSphereSurface, MbRevolutionSurface, MbExtrusionSurface, MbCylinderSurface, MbCurveBoundedSurface, and MbConeSurface.
|
virtual |
Changing of carrier.
It is used for union of coplanar faces.
Reimplemented in MbSpiralSurface, MbSectorSurface, MbSectionSurface, MbRuledSurface, MbRevolutionSurface, MbOffsetSurface, MbMeshSurface, MbLoftedSurface, MbFilletSurface, MbExtrusionSurface, MbExpansionSurface, MbEvolutionSurface, MbElevationSurface, MbCurveBoundedSurface, MbCoverSurface, MbCornerSurface, MbCoonsPatchSurface, and MbChamferSurface.
|
virtual |
Changing of carrier elements.
It is used for union of coplanar faces. The surfaces 'item' and 'init' must be similar.
[in] | item | - Changed surface |
[in] | init | - New surface |
[in] | matr | - Transition matrix from 'item' to 'init' |
Reimplemented in MbOffsetSurface, MbFilletSurface, MbCurveBoundedSurface, and MbChamferSurface.
|
virtual |
Periodicity of the guide.
Reimplemented in MbEvolutionSurface.
MbSplineSurface* MbSurface::NurbsSurface | ( | bool | bmatch = false | ) | const |
Construct a NURBS copy of a surface.
An obtained surface is always unclosed in u and in v. The exception is the NURBS surface itself. If the surface does not require recalculation, then a copy of it is returned.
[in] | bmatch | - true, if it is required to keep one-to-one correspondence of parametric regions in mapping. |
|
virtual |
Construct a NURBS copy of trimmed surface.
An obtained surface is always unclosed in u and in v. The exception is the NURBS surface itself. If the surface does not require recalculation, then a copy of it is returned. Parameters u1, u2, v1 and v2 are the bounds of surface trimming.
[in] | u1 | - Minimum parameter in U. |
[in] | u2 | - Maximum parameter in U. |
[in] | v1 | - Minimum parameter in V. |
[in] | v2 | - Maximum parameter in V. |
[in] | bmatch | - true, if it is required to keep one-to-one correspondence of parametric regions in mapping. |
Reimplemented in MbTorusSurface, MbSpiralSurface, MbSphereSurface, MbSectorSurface, MbSectionSurface, MbRuledSurface, MbRevolutionSurface, MbOffsetSurface, MbLoftedSurface, MbFilletSurface, MbExtrusionSurface, MbExplorationSurface, MbExpansionSurface, MbExactionSurface, MbEvolutionSurface, MbElevationSurface, MbCylinderSurface, MbConeSurface, MbChamferSurface, MbSplineSurface, MbPlane, MbJoinSurface, and MbCurveBoundedSurface.
|
virtual |
Construct a NURBS copy of a surface.
Constructs a NURBS surface which approximates a given surface with the given parameters in each direction. In parameters the degree and the number of knots of a spline and the range of curve's parameters changing may be set. If the flag of accurate approximation is not set in parameters then NURBS without multiple knots is constructed.
[in] | uParam | - Parameters of construction in u direction. |
[in] | vParam | - Parameters of construction in v direction. |
Reimplemented in MbTorusSurface, MbSplineSurface, MbSphereSurface, MbSmoothSurface, MbSectorSurface, MbSectionSurface, MbRuledSurface, MbRevolutionSurface, MbPlane, MbJoinSurface, MbFilletSurface, MbExtrusionSurface, MbExpansionSurface, MbEvolutionSurface, MbCylinderSurface, MbCurveBoundedSurface, and MbConeSurface.
bool MbSurface::NurbsParam | ( | const MbNurbsParameters & | tParam, |
bool | uParam, | ||
double | op1, | ||
double | op2, | ||
bool & | isClosedNurbs, | ||
double & | epsilon, | ||
SArray< double > & | params | ||
) | const |
Prepare parameters for the transformation to NURBS surface.
Prepare parameters for the transformation to NURBS surface. The number of points along the chosen direction if defined by the variable tParam.
[in] | tParam | - Parameters for the transformation of a surface to NURBS with respect to one of parameters. |
[in] | uParam | - Which parameter is considered: true - prepares an approximation with respect to u. false - prepares an approximation with respect to v. |
[in] | op1 | - Minimal value of the second parameter. |
[in] | op2 | - Maximal value of the second parameter. |
[out] | isClosedNurbs | - True - the approximating surface is closed in the chosen direction. |
[out] | epsilon | - At the output - parametric tolerance in the given direction. |
[out] | params | - A filled array of splitting parameters along the chosen direction. |
void MbSurface::CheckApproxPointParamsOpen | ( | bool | isU, |
double | par, | ||
size_t | degree, | ||
size_t | pCount, | ||
SArray< double > & | tList, | ||
SArray< double > & | aKnots | ||
) | const |
Chose points for approximation along the parameter.
Chose points on a surface for NURBS approximation along the parameter in the case of unclosed in the chosen direction surface. If a surface is approximated with the given knot vector, then splitting parameters are checked in order to leave at least one splitting point between the elements of a knot vector. If necessary, the list of splitting points is complemented. If a knot vector is not set (empty), then the knot vector is calculated according to the order, the number of knots and the proposed splitting.
[in] | isU | - Which parameter is considered: true - prepares an approximation with respect to u. false - prepares an approximation with respect to v. |
[in] | par | - A value of second parameter. |
[in] | degree | - An order of NURBS surface by a chosen direction. |
[in] | pCount | - A number of knots of NURBS surface by a chosen direction. |
[in,out] | tList | - A splitting parameters of NURBS surface by a chosen direction. They are calculated in the NurbsParam function. |
[in,out] | aKnots | - A knot vector of NURBS surface. |
void MbSurface::CheckApproxPointParamsClosed | ( | bool | isU, |
double | par, | ||
size_t | degree, | ||
size_t | pCount, | ||
SArray< double > & | tList, | ||
SArray< double > & | aKnots | ||
) | const |
Chose points for approximation along the parameter.
Chose points on a surface for NURBS approximation along the parameter in a case of closed in the chosen direction surface. If a surface is approximated with the given knot vector then splitting parameters are checked in order to leave at least one splitting point between the elements of a knot vector. If necessary, the list of splitting points is complemented. If a knot vector is not set (empty) then the knot vector is calculated according to the order, the number of knots and the proposed splitting.
[in] | isU | - Which parameter is considered: true - prepares an approximation with respect to u. false - prepares an approximation with respect to v. |
[in] | par | - A value of second parameter. |
[in] | degree | - An order of NURBS surface by a chosen direction. |
[in] | pCount | - A number of knots of NURBS surface by a chosen direction. |
[in,out] | tList | - A splitting parameters of NURBS surface by a chosen direction. They are calculated in the NurbsParam function. |
[in,out] | aKnots | - A knot vector of NURBS surface. |
|
virtual |
Create an offset surface.
[in] | d | - Distance by the normal vector from the base surface to the offset surface. |
[in] | same | - A flag showing whether to use the current surface or its copy in offset surface. |
Reimplemented in MbTorusSurface, MbSpiralSurface, MbSphereSurface, MbSectionSurface, MbRuledSurface, MbRevolutionSurface, MbPlane, MbOffsetSurface, MbMeshSurface, MbLoftedSurface, MbJoinSurface, MbFilletSurface, MbExtrusionSurface, MbExplorationSurface, MbExactionSurface, MbEvolutionSurface, MbElevationSurface, MbCylinderSurface, MbCurveBoundedSurface, MbConeSurface, MbChannelSurface, and MbChamferSurface.
|
virtual |
Construct spatial copy of the line v = const.
[in] | v | - Parameter in V direction. |
[in] | pRgn | - A range of u-parameters. |
[in] | bApprox | - If false, then it returns null only in a case when the exact curve has been successfully created. If true, then it returns null in a case when the curve is not degenerate. |
Reimplemented in MbCoverSurface, MbCornerSurface, MbTorusSurface, MbSplineSurface, MbSpiralSurface, MbSphereSurface, MbSectorSurface, MbSectionSurface, MbRuledSurface, MbRevolutionSurface, MbPlane, MbMeshSurface, MbLoftedSurface, MbExtrusionSurface, MbExplorationSurface, MbExpansionSurface, MbExactionSurface, MbEvolutionSurface, MbCylinderSurface, MbCurveBoundedSurface, MbCoonsPatchSurface, and MbConeSurface.
|
virtual |
Construct spatial copy of the line u = const.
[in] | u | - Parameter in U direction. |
[in] | pRgn | - A range of v-parameters. |
[in] | bApprox | - If false, then it returns null only in a case when the exact curve has been successfully created. If true, then it returns null in a case when the curve is not degenerate. |
Reimplemented in MbChamferSurface, MbCoverSurface, MbCornerSurface, MbTorusSurface, MbSplineSurface, MbSpiralSurface, MbSphereSurface, MbSectorSurface, MbSectionSurface, MbRuledSurface, MbRevolutionSurface, MbPlane, MbMeshSurface, MbLoftedSurface, MbFilletSurface, MbExtrusionSurface, MbExplorationSurface, MbExpansionSurface, MbExactionSurface, MbEvolutionSurface, MbElevationSurface, MbCylinderSurface, MbCurveBoundedSurface, MbCoonsPatchSurface, and MbConeSurface.
|
virtual |
Construct spatial copy of line by parametric line.
[in] | segm | - A segment in parametric plane of surface, a spatial copy of which is required to construct. |
[in] | bApprox | - If false, then it returns null only in a case when the exact curve has been successfully created. If true, then it returns null in a case when the curve is not degenerate. |
Reimplemented in MbRuledSurface, MbPlane, MbCylinderSurface, MbCurveBoundedSurface, and MbConeSurface.
|
virtual |
Get point location relative to the surface.
[in] | pnt | - The investigated point. |
[in] | eps | - Tolerance of getting a point onto a surface. |
Reimplemented in MbPlane.
|
virtual |
A point is located inside the region on a surface.
Investigated two-dimensional point in the parametric plane of a surface.
[in] | pnt | - The investigated point. |
[in] | ignoreClosed | - Whether to consider the surface closedness. If true, then the closedness is not considered. |
Reimplemented in MbGridSurface, and MbCurveBoundedSurface.
|
virtual |
Calculate the parametric distance to the nearest boundary.
The calculated distance is positive if the point is inside, and is negative if it is outside.
[in] | point | - The investigated point. |
[in] | epsilon | - Tolerance of getting a point onto a surface. |
Reimplemented in MbGridSurface, and MbCurveBoundedSurface.
|
virtual |
Determine points of intersections between the curve and the surface contours.
Determine points of intersections between the curve and the surface boundaries in order to find parts of the curve inside the surface region and vectors for their translation to the surface region. Translation vector is defined for each intersection point. If it is impossible to find a translation vector, then the vector with null size is saved into the array. It can be non-null if a surface is closed at least in one of directions. In this case the translation vector allows to move a part of a curve by a certain number of periods in such way that the found point of intersection between the curve and the boundary is located inside the surface region and the derivative of a curve at this point is directed inside the surface. Using the translation vector a curve can be moved by a certain number of periods. I.e. metrically the curve will not change.
[in] | curve | - A given curve. |
[in,out] | tcurv | - A set of curve parameters corresponding to the intersection points. |
[in,out] | dir | - A set of translation vectors. |
Reimplemented in MbGridSurface, and MbCurveBoundedSurface.
size_t MbSurface::SurfaceBorderIntersection | ( | const MbCurve & | curve, |
SArray< double > & | tcurv, | ||
SArray< MbVector > & | dir | ||
) | const |
Determine points of intersections between the curve and the surface contours.
Determine points of intersections between the curve and the surface boundaries in order to find parts of a curve inside the surface region and vectors for their translation to the surface region. Translation vector is defined for each intersection point. If it is impossible to find a translation vector then the vector with null size is saved into the array. It can be non-null if a surface is closed at least in one of directions. In this case the translation vector allows to move a part of a curve by a certain number of periods in such way that the found point of intersection between the curve and the boundary is located inside the surface region and the derivative of a curve at this point is directed inside the surface. Using the translation vector a curve can be moved by a certain number of periods. I.e. metrically the curve will not change.
[in] | curve | - A given curve. |
[in,out] | tcurv | - A set of curve parameters corresponding to the intersection points. |
[in,out] | dir | - A set of translation vectors. |
|
virtual |
Find the projection of a point onto the surface.
Find the nearest point projection to the surface or its extension by the given initial approximation. If the range of parameters changing 'uvRange' is set, then it is required to find a projection in the given range. A range of parameters may not belong to the domain of a surface. The Newton method is used.
[in] | pnt | - A given point. |
[in,out] | u | - Input - initial approximation, output - parameter of a surface, corresponding to the nearest projection. |
[in,out] | v | - Input - initial approximation, output - parameter of a surface, corresponding to the nearest projection. |
[in] | ext | - A flag defining whether to seek projection on the extension of the surface. |
[in] | uvRange | - A range of parameters changing in which the solution should be found. |
Reimplemented in MbSplineSurface, MbSpiralSurface, MbMeshSurface, MbLoftedSurface, MbRuledSurface, MbRevolutionSurface, MbOffsetSurface, MbGridSurface, MbFilletSurface, MbExtrusionSurface, MbElementarySurface, and MbCurveBoundedSurface.
|
virtual |
Find all a point projection onto the surface along a vector in either of two directions.
Calculate all points of intersection with the ray outgoing from the given point 'p' by the direction 'vect'. If the range of parameters changing 'uvRange' is set, then it is required to find a projection in the given range. A range of parameters may not belong to the domain of a surface.
[in] | pnt | - A given point. |
[in] | vect | - A direction vector. |
[out] | uv | - A set of projection points in the area of surface definition. |
[in] | ext | - A flag defining whether to seek projection on the extension of the surface. |
[in] | uvRange | - A range of surface parameters changing in which the solution should be found. |
Reimplemented in MbSplineSurface, MbOffsetSurface, MbMeshSurface, MbLoftedSurface, MbTorusSurface, MbSphereSurface, MbRevolutionSurface, MbGridSurface, MbCylinderSurface, MbCurveBoundedSurface, MbConeSurface, and MbPlane.
|
virtual |
Find the nearest point projection to the surface in the vector direction.
Calculate the nearest point of intersection with the ray outgoing from the given point 'p' by the direction 'vect'. If the range of parameters changing 'uvRange' is set, then it is required to find a projection in the given range. A range of parameters may not belong to the domain of a surface.
[in] | pnt | - A given point. |
[in] | vect | - A direction vector. |
[in,out] | u | - Input - initial approximation, output - parameter of a surface, corresponding to the nearest projection. |
[in,out] | v | - Input - initial approximation, output - parameter of a surface, corresponding to the nearest projection. |
[in] | ext | - A flag defining whether to seek projection on the extension of the curve. |
[in] | uvRange | - A range of parameters changing in which the solution should be found. |
Reimplemented in MbPlane.
|
virtual |
Determine points of intersection between a surface and a curve.
Determine points of intersection between a surface and a curve.
[in] | curv | - A given curve. |
[in,out] | uv | - A set of intersection points on the surface. |
[in,out] | tt | - A set of intersection points on the curve. |
[in] | ext0 | - A flag defining whether to seek intersections on extended surface (if it is true, then seek). |
[in] | ext | - A flag defining whether to seek intersections on extended curve (if it is true, then seek). |
[in] | touchInclude | - Whether to consider tangency as intersection. If true, then consider. |
Reimplemented in MbTorusSurface, MbSphereSurface, MbRuledSurface, MbGridSurface, MbExtrusionSurface, MbCylinderSurface, MbCurveBoundedSurface, MbConeSurface, and MbPlane.
|
virtual |
Define whether the surfaces are similar for merge.
Surfaces are similar for merge if they coincide geometrically or one surface transits to another.
[in] | surf | - A given surface. |
[in] | version | - Version of operation. |
[in] | precision | - Precision of calculation. |
Reimplemented in MbTorusSurface, MbSplineSurface, MbSpiralSurface, MbSphereSurface, MbSectionSurface, MbRuledSurface, MbRevolutionSurface, MbPlane, MbOffsetSurface, MbFilletSurface, MbExtrusionSurface, MbExpansionSurface, MbExactionSurface, MbEvolutionSurface, MbCylinderSurface, MbCurveBoundedSurface, MbCoverSurface, MbConeSurface, and MbChamferSurface.
|
virtual |
Construction of projection of a surface curve on coincident surface.
A projection of surface intersection curve is constructed on a given surface. It is implied that the given surface is similar to one of surfaces of the intersection curve but this fact is not checked.
[in] | spaceCurve | - A given intersection curve. |
[in] | curve | - A two-dimensional curve on a surface. |
[in] | surfNew | - New surface. |
[out] | curveNew | - An obtained two-dimensional curve on new surface. |
Reimplemented in MbSphereSurface, and MbCurveBoundedSurface.
bool MbSurface::ProjectCurveOnSimilarSurface | ( | const MbCurve3D & | spaceCurve, |
const MbCurve & | curve, | ||
const MbSurface & | surfNew, | ||
SPtr< MbCurve > & | curveNew | ||
) | const |
Construction of projection of a surface curve on coincident surface.
A projection of surface intersection curve is constructed on a given surface. It is implied that the given surface is similar to one of surfaces of the intersection curve but this fact is not checked.
[in] | spaceCurve | - A given intersection curve. |
[in] | curve | - A two-dimensional curve on a surface. |
[in] | surfNew | - New surface. |
[out] | curveNew | - An obtained two-dimensional curve on new surface. |
|
virtual |
Get two-dimensional matrix of transformation from its parametric region to the parametric region of 'surf'.
Calculation of matrix of transformation from one parametric region to another. it is performed for the surfaces which are similar for merge.
[in] | surf | - A given surface. |
[out] | matr | - A transformation matrix. |
[in] | version | - Version of operation. |
[in] | precision | - Precision of calculation. |
Reimplemented in MbTorusSurface, MbSplineSurface, MbSpiralSurface, MbSphereSurface, MbSectionSurface, MbRuledSurface, MbRevolutionSurface, MbPlane, MbOffsetSurface, MbFilletSurface, MbExtrusionSurface, MbExpansionSurface, MbExactionSurface, MbEvolutionSurface, MbCylinderSurface, MbCurveBoundedSurface, MbCoverSurface, MbConeSurface, and MbChamferSurface.
|
virtual |
Determine whether the surface is convex.
Determine whether the surface is convex.
Determine whether the surface is convex.
Reimplemented in MbTorusSurface, MbSphereSurface, MbSectionSurface, MbRevolutionSurface, MbFilletSurface, MbExtrusionSurface, MbCylinderSurface, MbCurveBoundedSurface, and MbConeSurface.
|
virtual |
Calculate the nearest distance to a curve.
Calculation of the minimum distance between a curve and a surface. Determination of the points on a surface and a curve where the minimum distance is reached.
[in] | curve | - A given curve. |
[out] | u | - Coordinate of the calculated point on surface. |
[out] | v | - Coordinate of the calculated point on surface. |
[in,out] | t | - Input - an initial approximation to the required point on a curve. Output - a parameter of the calculated point on a curve. |
[in] | tCalc | - A flag showing whether to use t as initial approximation. |
|
virtual |
Calculate the nearest distance to a surface.
Calculating of minimum distance between two surfaces. Determination of the points on surfaces where the minimum distance is reached.
[in] | surf1 | - A given surface. |
[out] | u0 | - Coordinate of the calculated point on the current surface. |
[out] | v0 | - Coordinate of the calculated point on the current surface. |
[out] | u1 | - Coordinate of the calculated point on the given surface. |
[out] | v1 | - Coordinate of the calculated point on the given surface. |
|
virtual |
Calculate U-pairs by V.
Calculate significant u-parameters of a surface with the given parameter v. In a case of general form - minimal and maximal values of u-parameter.
[in] | v | - Given parameters. |
[out] | u | - A set of values of u. |
Reimplemented in MbGridSurface, and MbCurveBoundedSurface.
|
virtual |
Calculate V-pairs by U.
Calculate significant v-parameters of a surface with the given parameter u. In case of a surface of general form - minimal and maximal values of v-parameter.
[in] | u | - Given parameters. |
[out] | v | - A set of values of v. |
Reimplemented in MbGridSurface, and MbCurveBoundedSurface.
|
virtual |
Find all isoclines of a surface.
Find the points on a surface where the tangent plane is parallel to a plane having a normal nor.
[in] | nor | - A vector which defines a plane. |
[out] | uv | - A set of parameters of points for the required tangent. |
|
inline |
Copy the bounding box from the copy.
Copy from the copy ready estimates which were not calculated in the original.
[in] | s | - A surface-copy. |
void MbSurface::CalculateRect | ( | const MbPlacement3D & | place, |
MbRect & | rect | ||
) | const |
Calculate the rectangular bounding box of a surface in the given plane.
Get the rectangular bounding box of surfaces in the XAOY plane of the placement.
[in] | place | - The given placement. |
[out] | rect | - Calculated rectangle. |
|
virtual |
Return the bounding two-dimensional contour.
The function creates new two-dimensional bounding contour. The object should be deleted after using.
[in] | sense | - Whether the contour direction coincides with the counterclockwise traverse direction. |
Reimplemented in MbGridSurface, and MbCurveBoundedSurface.
|
virtual |
Return a segment of the bounding two-dimensional contour.
The function creates a segment of bounding contour according to the parameter i.
i = 0 - A segment of boundary where v = vmin
i = 1 - A segment of boundary where u = umax
i = 2 - A segment of boundary where v = vmax
i = 3 - A segment of boundary where u = umin
The object should be deleted after using.
[in] | i | - An index of segment. |
[in] | sense | - Whether the contour direction coincides with the counterclockwise traverse direction. |
Reimplemented in MbGridSurface, and MbCurveBoundedSurface.
MbCurve& MbSurface::MakeCurve | ( | size_t | number1, |
size_t | number2 | ||
) | const |
Return a segment of the bounding two-dimensional contour.
The function finds the boundary points of a surface using the function GetLimitPoint and constructs a segment from the point with the number 'number1' to the points with the number 'number2'. The object should be deleted after using.
[in] | number1 | - A number of a boundary surface. |
[in] | number2 | - A number of a boundary surface. |
void MbSurface::CalculatePolygon | ( | double | minPar, |
double | maxPar, | ||
double | constPar, | ||
MbeParamDir | dir, | ||
const MbStepData & | stepData, | ||
MbPolygon3D & | polygon | ||
) | const |
Calculate polygon by u or v.
In the function the surface curve is constructed - a segment along the chosen direction and after that a curve approximating polygon is calculated.
[in] | minPar | - Minimal value of parameter in the chosen direction. |
[in] | maxPar | - Maximal value of parameter in the chosen direction. |
[in] | constPar | - A value of second parameter. |
[in] | dir | - A chosen direction. dir == pd_DirU - calculation is performed by u-parameter, v = const. dir == pd_DirU - calculation is performed by v-parameter, u = const. |
[in] | sag | - A sag value, defining the tolerance of approximation. |
[out] | polygon | - Calculated polygon. |
|
virtual |
Calculate mesh.
In the function the mesh calculation for surface drawing is performed.
[in] | sag | - A sag value, defining the tolerance.. |
[in] | beg | - A number of the the first knot which gets into the mesh by each direction. For the construction of mesh of the whole surface beg == 0. |
[out] | mesh | - A calculated mesh. |
[in] | uMeshCount | - The number of u-mesh lines. |
[in] | vMeshCount | - The number of v-mesh lines. |
Reimplemented in MbGridSurface, MbCurveBoundedSurface, and MbCornerSurface.
|
virtual |
Determine a splitting of parametric region of a surface by verticals and horizontals.
Determine a splitting of parametric region of a surface by verticals and horizontals during triangulation.
[in] | stepData | - Data for step calculation during triangulation. |
[in] | u1 | - Minimal value of u-parameter in the region of surface splitting. |
[in] | u2 | - Maximal value of u-parameter in the region of surface splitting. |
[in] | v1 | - Minimal value of v-parameter in the region of surface splitting. |
[in] | v2 | - Maximal value of v-parameter in the region of surface splitting. |
[out] | uu | - A set of parameters of splitting by u. |
[out] | vv | - A set of parameters of splitting by v. |
Reimplemented in MbTorusSurface, MbSplineSurface, MbSpiralSurface, MbSphereSurface, MbSectorSurface, MbSectionSurface, MbRuledSurface, MbRevolutionSurface, MbPlane, MbOffsetSurface, MbLoftedSurface, MbGridSurface, MbFilletSurface, MbExtrusionSurface, MbExplorationSurface, MbExpansionSurface, MbEvolutionSurface, MbCylinderSurface, MbCurveBoundedSurface, and MbConeSurface.
void MbSurface::AddTesselation | ( | const MbStepData & | stepData, |
MbeParamDir | dir, | ||
double | u1, | ||
double | u2, | ||
double | v1, | ||
double | v2, | ||
SArray< double > & | uu, | ||
SArray< double > & | vv | ||
) | const |
Determine splitting of the surface parametric region according to direction.
Determine a splitting of parametric region of a surface by verticals and horizontals. Add parameters into an array in the direction dir. If the arrays uu and vv are not empty then their elements are deleted. i.e. a clarification of mesh in a given direction is performed.
[in] | stepData | - Data for step calculation during triangulation. |
[in] | dir | - A chosen direction. dir == pd_DirU - calculation is performed by u-parameter, v = const. dir == pd_DirU - calculation is performed by v-parameter, u = const. |
[in] | u1 | - Minimal value of u-parameter in the region of surface splitting. |
[in] | u2 | - Maximal value of u-parameter in the region of surface splitting. |
[in] | v1 | - Minimal value of v-parameter in the region of surface splitting. |
[in] | v2 | - Maximal value of v-parameter in the region of surface splitting. |
[out] | uu | - A set of parameters of splitting by u. |
[out] | vv | - A set of parameters of splitting by v. |
|
virtual |
Approximate a surface by triangular plates.
Approximate a surface by triangular plates.
[in] | stepData | - Data for step calculation during triangulation. |
[in] | sense | - It determines the coincidence of normals of surfaces and triangles. |
[out] | grid | - The result of splitting. |
Reimplemented in MbGridSurface, and MbCurveBoundedSurface.
|
virtual |
Determine whether the object is a translation.
Determine whether the object is a translation of a given object.
[in] | obj | - A pattern object. |
[out] | dir | - A translation vector if the object is translation. |
[out] | isSame | - True at the output if the current surface and the pattern object are identical. |
Reimplemented in MbTorusSurface, MbSphereSurface, MbPlane, MbCylinderSurface, and MbConeSurface.
|
virtual |
Check parameters. Analogue of the global function _CheckParams, optimized for caches usage.
Check parameters and move them inside domain if parameter is out of pole.
[in] | surface | - Surface. |
[in] | u | - First parameter. |
[in] | v | - Second parameter. |
Reimplemented in MbSplineSurface, MbOffsetSurface, MbMeshSurface, and MbLoftedSurface.
bool MbSurface::GetControlPlacement | ( | MbPlacement3D & | place, |
bool | sameSense = true |
||
) | const |
Construct a local coordinate system of a surface with origin at the middle point of base surface parametric limits.
Construct a local coordinate system of a surface with origin at the middle point of surface parametric limits.
[out] | place | - Local coordinate system. |
[in] | sameSense | - Normal's relative orientation. |
bool MbSurface::GetMatrix | ( | double | xMin, |
double | xMax, | ||
double | yMin, | ||
double | yMax, | ||
MbMatrix & | matr | ||
) | const |
Find a matrix of transformation for the curves on a surface when the parameterization is changed.
The new range of parameters is set for a surface. A surface doesn't change geometrically. The function searches a matrix of transformation for the two-dimensional curves on a surface for the transition from old parameterization to new parameterization.
[in] | xMin | - The new minimum value of u. |
[in] | xMax | - The new maximum value of u. |
[in] | yMin | - The new minimum value of v. |
[in] | yMax | - The new maximum value of v. |
[in] | matr | - A transformation matrix. |
|
mutableprotected |
Bounding box of surface.
Bounding box of surface is calculated only at the request. Bounding box of surface is undefined after object constructor and after object modifications.