Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions
ShapeAnalysis_Curve Class Reference

Analyzing tool for 2d or 3d curve. Computes parameters of projected point onto a curve. More...

#include <ShapeAnalysis_Curve.hxx>

Public Member Functions

double Project (const occ::handle< Geom_Curve > &C3D, const gp_Pnt &P3D, const double preci, gp_Pnt &proj, double &param, const bool AdjustToEnds=true) const
 Projects a Point on a Curve. Computes the projected point and its parameter on the curve. <preci> is used as 3d precision (hence, 0 will produce reject unless exact confusion). The number of iterations is limited. If AdjustToEnds is True, point will be adjusted to the end of the curve if distance is less than <preci>
 
double Project (const Adaptor3d_Curve &C3D, const gp_Pnt &P3D, const double preci, gp_Pnt &proj, double &param, const bool AdjustToEnds=true) const
 Projects a Point on a Curve. Computes the projected point and its parameter on the curve. <preci> is used as 3d precision (hence, 0 will produce reject unless exact confusion). The number of iterations is limited.
 
double Project (const occ::handle< Geom_Curve > &C3D, const gp_Pnt &P3D, const double preci, gp_Pnt &proj, double &param, const double cf, const double cl, const bool AdjustToEnds=true) const
 Projects a Point on a Curve, but parameters are limited between <cf> and <cl>. The range [cf, cl] is extended with help of Adaptor3d on the basis of 3d precision <preci>. If AdjustToEnds is True, point will be adjusted to the end of the curve if distance is less than <preci>
 
double ProjectAct (const Adaptor3d_Curve &C3D, const gp_Pnt &P3D, const double preci, gp_Pnt &proj, double &param) const
 
double NextProject (const double paramPrev, const occ::handle< Geom_Curve > &C3D, const gp_Pnt &P3D, const double preci, gp_Pnt &proj, double &param, const double cf, const double cl, const bool AdjustToEnds=true) const
 Projects a Point on a Curve using Newton method. <paramPrev> is taken as the first approximation of solution. If Newton algorithm fails the method Project() is used. If AdjustToEnds is True, point will be adjusted to the end of the curve if distance is less than <preci>
 
double NextProject (const double paramPrev, const Adaptor3d_Curve &C3D, const gp_Pnt &P3D, const double preci, gp_Pnt &proj, double &param) const
 Projects a Point on a Curve using Newton method. <paramPrev> is taken as the first approximation of solution. If Newton algorithm fails the method Project() is used.
 
bool ValidateRange (const occ::handle< Geom_Curve > &Crv, double &First, double &Last, const double prec) const
 Validate parameters First and Last for the given curve in order to make them valid for creation of edge. This includes:
 
void FillBndBox (const occ::handle< Geom2d_Curve > &C2d, const double First, const double Last, const int NPoints, const bool Exact, Bnd_Box2d &Box) const
 Computes a boundary box on segment of curve C2d from First to Last. This is done by taking NPoints points from the curve and, if Exact is True, by searching for exact extrema. All these points are added to Box.
 
int SelectForwardSeam (const occ::handle< Geom2d_Curve > &C1, const occ::handle< Geom2d_Curve > &C2) const
 Defines which pcurve (C1 or C2) should be chosen for FORWARD seam edge.
 

Static Public Member Functions

static bool IsPlanar (const NCollection_Array1< gp_Pnt > &pnts, gp_XYZ &Normal, const double preci=0)
 Checks if points are planar with given preci. If Normal has not zero modulus, checks with given normal.
 
static bool IsPlanar (const occ::handle< Geom_Curve > &curve, gp_XYZ &Normal, const double preci=0)
 Checks if curve is planar with given preci. If Normal has not zero modulus, checks with given normal.
 
static bool GetSamplePoints (const occ::handle< Geom2d_Curve > &curve, const double first, const double last, NCollection_Sequence< gp_Pnt2d > &seq)
 Returns sample points which will serve as linearisation of the2d curve in range (first, last) The distribution of sample points is consystent with what is used by BRepTopAdaptor_FClass2d.
 
static bool GetSamplePoints (const occ::handle< Geom_Curve > &curve, const double first, const double last, NCollection_Sequence< gp_Pnt > &seq)
 Returns sample points which will serve as linearisation of the curve in range (first, last)
 
static bool IsClosed (const occ::handle< Geom_Curve > &curve, const double preci=-1)
 Tells if the Curve is closed with given precision. If <preci> < 0 then Precision::Confusion is used.
 
static bool IsPeriodic (const occ::handle< Geom_Curve > &curve)
 This method was implemented as fix for changes in trimmed curve behaviour. For the moment trimmed curve returns false anyway. So it is necessary to adapt all Data exchange tools for this behaviour. Current implementation takes into account that curve may be offset.
 
static bool IsPeriodic (const occ::handle< Geom2d_Curve > &curve)
 The same as for Curve3d.
 

Detailed Description

Analyzing tool for 2d or 3d curve. Computes parameters of projected point onto a curve.

Member Function Documentation

◆ FillBndBox()

void ShapeAnalysis_Curve::FillBndBox ( const occ::handle< Geom2d_Curve > & C2d,
const double First,
const double Last,
const int NPoints,
const bool Exact,
Bnd_Box2d & Box ) const

Computes a boundary box on segment of curve C2d from First to Last. This is done by taking NPoints points from the curve and, if Exact is True, by searching for exact extrema. All these points are added to Box.

◆ GetSamplePoints() [1/2]

static bool ShapeAnalysis_Curve::GetSamplePoints ( const occ::handle< Geom2d_Curve > & curve,
const double first,
const double last,
NCollection_Sequence< gp_Pnt2d > & seq )
static

Returns sample points which will serve as linearisation of the2d curve in range (first, last) The distribution of sample points is consystent with what is used by BRepTopAdaptor_FClass2d.

◆ GetSamplePoints() [2/2]

static bool ShapeAnalysis_Curve::GetSamplePoints ( const occ::handle< Geom_Curve > & curve,
const double first,
const double last,
NCollection_Sequence< gp_Pnt > & seq )
static

Returns sample points which will serve as linearisation of the curve in range (first, last)

◆ IsClosed()

static bool ShapeAnalysis_Curve::IsClosed ( const occ::handle< Geom_Curve > & curve,
const double preci = -1 )
static

Tells if the Curve is closed with given precision. If <preci> < 0 then Precision::Confusion is used.

◆ IsPeriodic() [1/2]

static bool ShapeAnalysis_Curve::IsPeriodic ( const occ::handle< Geom2d_Curve > & curve)
static

The same as for Curve3d.

◆ IsPeriodic() [2/2]

static bool ShapeAnalysis_Curve::IsPeriodic ( const occ::handle< Geom_Curve > & curve)
static

This method was implemented as fix for changes in trimmed curve behaviour. For the moment trimmed curve returns false anyway. So it is necessary to adapt all Data exchange tools for this behaviour. Current implementation takes into account that curve may be offset.

◆ IsPlanar() [1/2]

static bool ShapeAnalysis_Curve::IsPlanar ( const NCollection_Array1< gp_Pnt > & pnts,
gp_XYZ & Normal,
const double preci = 0 )
static

Checks if points are planar with given preci. If Normal has not zero modulus, checks with given normal.

◆ IsPlanar() [2/2]

static bool ShapeAnalysis_Curve::IsPlanar ( const occ::handle< Geom_Curve > & curve,
gp_XYZ & Normal,
const double preci = 0 )
static

Checks if curve is planar with given preci. If Normal has not zero modulus, checks with given normal.

◆ NextProject() [1/2]

double ShapeAnalysis_Curve::NextProject ( const double paramPrev,
const Adaptor3d_Curve & C3D,
const gp_Pnt & P3D,
const double preci,
gp_Pnt & proj,
double & param ) const

Projects a Point on a Curve using Newton method. <paramPrev> is taken as the first approximation of solution. If Newton algorithm fails the method Project() is used.

◆ NextProject() [2/2]

double ShapeAnalysis_Curve::NextProject ( const double paramPrev,
const occ::handle< Geom_Curve > & C3D,
const gp_Pnt & P3D,
const double preci,
gp_Pnt & proj,
double & param,
const double cf,
const double cl,
const bool AdjustToEnds = true ) const

Projects a Point on a Curve using Newton method. <paramPrev> is taken as the first approximation of solution. If Newton algorithm fails the method Project() is used. If AdjustToEnds is True, point will be adjusted to the end of the curve if distance is less than <preci>

◆ Project() [1/3]

double ShapeAnalysis_Curve::Project ( const Adaptor3d_Curve & C3D,
const gp_Pnt & P3D,
const double preci,
gp_Pnt & proj,
double & param,
const bool AdjustToEnds = true ) const

Projects a Point on a Curve. Computes the projected point and its parameter on the curve. <preci> is used as 3d precision (hence, 0 will produce reject unless exact confusion). The number of iterations is limited.

Returned value is the distance between the given point and computed one.

◆ Project() [2/3]

double ShapeAnalysis_Curve::Project ( const occ::handle< Geom_Curve > & C3D,
const gp_Pnt & P3D,
const double preci,
gp_Pnt & proj,
double & param,
const bool AdjustToEnds = true ) const

Projects a Point on a Curve. Computes the projected point and its parameter on the curve. <preci> is used as 3d precision (hence, 0 will produce reject unless exact confusion). The number of iterations is limited. If AdjustToEnds is True, point will be adjusted to the end of the curve if distance is less than <preci>

Returned value is the distance between the given point and computed one.

◆ Project() [3/3]

double ShapeAnalysis_Curve::Project ( const occ::handle< Geom_Curve > & C3D,
const gp_Pnt & P3D,
const double preci,
gp_Pnt & proj,
double & param,
const double cf,
const double cl,
const bool AdjustToEnds = true ) const

Projects a Point on a Curve, but parameters are limited between <cf> and <cl>. The range [cf, cl] is extended with help of Adaptor3d on the basis of 3d precision <preci>. If AdjustToEnds is True, point will be adjusted to the end of the curve if distance is less than <preci>

◆ ProjectAct()

double ShapeAnalysis_Curve::ProjectAct ( const Adaptor3d_Curve & C3D,
const gp_Pnt & P3D,
const double preci,
gp_Pnt & proj,
double & param ) const

◆ SelectForwardSeam()

int ShapeAnalysis_Curve::SelectForwardSeam ( const occ::handle< Geom2d_Curve > & C1,
const occ::handle< Geom2d_Curve > & C2 ) const

Defines which pcurve (C1 or C2) should be chosen for FORWARD seam edge.

◆ ValidateRange()

bool ShapeAnalysis_Curve::ValidateRange ( const occ::handle< Geom_Curve > & Crv,
double & First,
double & Last,
const double prec ) const

Validate parameters First and Last for the given curve in order to make them valid for creation of edge. This includes:

  • limiting range [First,Last] by range of curve
  • adjusting range [First,Last] for periodic (or closed) curve if Last < First Returns True if parameters are OK or are successfully corrected, or False if parameters cannot be corrected. In the latter case, parameters are reset to range of curve.

The documentation for this class was generated from the following file: