Open CASCADE Technology  7.7.0.dev
Public Member Functions

GCPnts_UniformDeflection Class Reference

Provides an algorithm to compute a distribution of points on a 'C2' continuous curve. The algorithm respects a criterion of maximum deflection between the curve and the polygon that results from the computed points. Note: This algorithm is relatively time consuming. A GCPnts_QuasiUniformDeflection algorithm is quicker; it can also work with non-'C2' continuous curves, but it generates more points in the distribution. More...

#include <GCPnts_UniformDeflection.hxx>

Public Member Functions

 GCPnts_UniformDeflection ()
 Constructs an empty algorithm. To define the problem to be solved, use the function Initialize. More...
 
 GCPnts_UniformDeflection (const Adaptor3d_Curve &theC, const Standard_Real theDeflection, const Standard_Boolean theWithControl=Standard_True)
 Computes a uniform Deflection distribution of points on the curve. More...
 
 GCPnts_UniformDeflection (const Adaptor2d_Curve2d &theC, const Standard_Real theDeflection, const Standard_Boolean theWithControl=Standard_True)
 Computes a uniform Deflection distribution of points on the curve. More...
 
 GCPnts_UniformDeflection (const Adaptor3d_Curve &theC, const Standard_Real theDeflection, const Standard_Real theU1, const Standard_Real theU2, const Standard_Boolean theWithControl=Standard_True)
 Computes a Uniform Deflection distribution of points on a part of the curve. More...
 
 GCPnts_UniformDeflection (const Adaptor2d_Curve2d &theC, const Standard_Real theDeflection, const Standard_Real theU1, const Standard_Real theU2, const Standard_Boolean theWithControl=Standard_True)
 Computes a Uniform Deflection distribution of points on a part of the curve. More...
 
void Initialize (const Adaptor3d_Curve &theC, const Standard_Real theDeflection, const Standard_Boolean theWithControl=Standard_True)
 Initialize the algorithms with 3D curve and deflection. More...
 
void Initialize (const Adaptor2d_Curve2d &theC, const Standard_Real theDeflection, const Standard_Boolean theWithControl=Standard_True)
 Initialize the algorithms with 2D curve and deflection. More...
 
void Initialize (const Adaptor3d_Curve &theC, const Standard_Real theDeflection, const Standard_Real theU1, const Standard_Real theU2, const Standard_Boolean theWithControl=Standard_True)
 Initialize the algorithms with 3D curve, deflection, parameter range. More...
 
void Initialize (const Adaptor2d_Curve2d &theC, const Standard_Real theDeflection, const Standard_Real theU1, const Standard_Real theU2, const Standard_Boolean theWithControl=Standard_True)
 Initialize the algorithms with curve, deflection, parameter range. This and the above methods initialize (or reinitialize) this algorithm and compute a distribution of points: More...
 
Standard_Boolean IsDone () const
 Returns true if the computation was successful. IsDone is a protection against: More...
 
Standard_Integer NbPoints () const
 Returns the number of points of the distribution computed by this algorithm. Exceptions StdFail_NotDone if this algorithm has not been initialized, or if the computation was not successful. More...
 
Standard_Real Parameter (const Standard_Integer Index) const
 Returns the parameter of the point of index Index in the distribution computed by this algorithm. Warning Index must be greater than or equal to 1, and less than or equal to the number of points of the distribution. However, pay particular attention as this condition is not checked by this function. Exceptions StdFail_NotDone if this algorithm has not been initialized, or if the computation was not successful. More...
 
gp_Pnt Value (const Standard_Integer Index) const
 Returns the point of index Index in the distribution computed by this algorithm. Warning Index must be greater than or equal to 1, and less than or equal to the number of points of the distribution. However, pay particular attention as this condition is not checked by this function. Exceptions StdFAil_NotDone if this algorithm has not been initialized, or if the computation was not successful. More...
 
Standard_Real Deflection () const
 Returns the deflection between the curve and the polygon resulting from the points of the distribution computed by this algorithm. This value is the one given to the algorithm at the time of construction (or initialization). Exceptions StdFail_NotDone if this algorithm has not been initialized, or if the computation was not successful. More...
 

Detailed Description

Provides an algorithm to compute a distribution of points on a 'C2' continuous curve. The algorithm respects a criterion of maximum deflection between the curve and the polygon that results from the computed points. Note: This algorithm is relatively time consuming. A GCPnts_QuasiUniformDeflection algorithm is quicker; it can also work with non-'C2' continuous curves, but it generates more points in the distribution.

Constructor & Destructor Documentation

◆ GCPnts_UniformDeflection() [1/5]

GCPnts_UniformDeflection::GCPnts_UniformDeflection ( )

Constructs an empty algorithm. To define the problem to be solved, use the function Initialize.

◆ GCPnts_UniformDeflection() [2/5]

GCPnts_UniformDeflection::GCPnts_UniformDeflection ( const Adaptor3d_Curve theC,
const Standard_Real  theDeflection,
const Standard_Boolean  theWithControl = Standard_True 
)

Computes a uniform Deflection distribution of points on the curve.

Parameters
theC[in] input 3D curve
theDeflection[in] target deflection
theWithControl[in] when TRUE, the algorithm controls the estimate deflection

◆ GCPnts_UniformDeflection() [3/5]

GCPnts_UniformDeflection::GCPnts_UniformDeflection ( const Adaptor2d_Curve2d theC,
const Standard_Real  theDeflection,
const Standard_Boolean  theWithControl = Standard_True 
)

Computes a uniform Deflection distribution of points on the curve.

Parameters
theC[in] input 2D curve
theDeflection[in] target deflection
theWithControl[in] when TRUE, the algorithm controls the estimate deflection

◆ GCPnts_UniformDeflection() [4/5]

GCPnts_UniformDeflection::GCPnts_UniformDeflection ( const Adaptor3d_Curve theC,
const Standard_Real  theDeflection,
const Standard_Real  theU1,
const Standard_Real  theU2,
const Standard_Boolean  theWithControl = Standard_True 
)

Computes a Uniform Deflection distribution of points on a part of the curve.

Parameters
theC[in] input 3D curve
theDeflection[in] target deflection
theU1[in] first parameter on curve
theU2[in] last parameter on curve
theWithControl[in] when TRUE, the algorithm controls the estimate deflection

◆ GCPnts_UniformDeflection() [5/5]

GCPnts_UniformDeflection::GCPnts_UniformDeflection ( const Adaptor2d_Curve2d theC,
const Standard_Real  theDeflection,
const Standard_Real  theU1,
const Standard_Real  theU2,
const Standard_Boolean  theWithControl = Standard_True 
)

Computes a Uniform Deflection distribution of points on a part of the curve.

Parameters
theC[in] input 2D curve
theDeflection[in] target deflection
theU1[in] first parameter on curve
theU2[in] last parameter on curve
theWithControl[in] when TRUE, the algorithm controls the estimate deflection

Member Function Documentation

◆ Deflection()

Standard_Real GCPnts_UniformDeflection::Deflection ( ) const
inline

Returns the deflection between the curve and the polygon resulting from the points of the distribution computed by this algorithm. This value is the one given to the algorithm at the time of construction (or initialization). Exceptions StdFail_NotDone if this algorithm has not been initialized, or if the computation was not successful.

◆ Initialize() [1/4]

void GCPnts_UniformDeflection::Initialize ( const Adaptor2d_Curve2d theC,
const Standard_Real  theDeflection,
const Standard_Boolean  theWithControl = Standard_True 
)

Initialize the algorithms with 2D curve and deflection.

◆ Initialize() [2/4]

void GCPnts_UniformDeflection::Initialize ( const Adaptor2d_Curve2d theC,
const Standard_Real  theDeflection,
const Standard_Real  theU1,
const Standard_Real  theU2,
const Standard_Boolean  theWithControl = Standard_True 
)

Initialize the algorithms with curve, deflection, parameter range. This and the above methods initialize (or reinitialize) this algorithm and compute a distribution of points:

  • on the curve theC, or
  • on the part of curve theC limited by the two parameter values theU1 and theU2, where the maximum distance between theC and the polygon that results from the points of the distribution is not greater than theDeflection. The first point of the distribution is either the origin of curve theC or the point of parameter theU1. The last point of the distribution is either the end point of curve theC or the point of parameter theU2. Intermediate points of the distribution are built using interpolations of segments of the curve limited at the 2nd degree. The construction ensures, in a first step, that the chordal deviation for this interpolation of the curve is less than or equal to theDeflection. However, it does not ensure that the chordal deviation for the curve itself is less than or equal to theDeflection. To do this a check is necessary, which may generate (second step) additional intermediate points. This check is time consuming, and can be avoided by setting theWithControl to false. Note that by default theWithControl is true and check is performed. Use the function IsDone to verify that the computation was successful, the function NbPoints() to obtain the number of points of the computed distribution, and the function Parameter to read the parameter of each point.

Warning

  • theC is necessary, 'C2' continuous. This property is not checked at construction time.
  • The roles of theU1 and theU2 are inverted if theU1 > theU2.

Warning theC is an adapted curve, i.e. an object which is an interface between:

  • the services provided by either a 2D curve from the package Geom2d (in the case of an Adaptor2d_Curve2d curve) or a 3D curve from the package Geom (in the case of an Adaptor3d_Curve curve),
  • and those required on the curve by the computation algorithm.

◆ Initialize() [3/4]

void GCPnts_UniformDeflection::Initialize ( const Adaptor3d_Curve theC,
const Standard_Real  theDeflection,
const Standard_Boolean  theWithControl = Standard_True 
)

Initialize the algorithms with 3D curve and deflection.

◆ Initialize() [4/4]

void GCPnts_UniformDeflection::Initialize ( const Adaptor3d_Curve theC,
const Standard_Real  theDeflection,
const Standard_Real  theU1,
const Standard_Real  theU2,
const Standard_Boolean  theWithControl = Standard_True 
)

Initialize the algorithms with 3D curve, deflection, parameter range.

◆ IsDone()

Standard_Boolean GCPnts_UniformDeflection::IsDone ( ) const
inline

Returns true if the computation was successful. IsDone is a protection against:

  • non-convergence of the algorithm
  • querying the results before computation.

◆ NbPoints()

Standard_Integer GCPnts_UniformDeflection::NbPoints ( ) const
inline

Returns the number of points of the distribution computed by this algorithm. Exceptions StdFail_NotDone if this algorithm has not been initialized, or if the computation was not successful.

◆ Parameter()

Standard_Real GCPnts_UniformDeflection::Parameter ( const Standard_Integer  Index) const
inline

Returns the parameter of the point of index Index in the distribution computed by this algorithm. Warning Index must be greater than or equal to 1, and less than or equal to the number of points of the distribution. However, pay particular attention as this condition is not checked by this function. Exceptions StdFail_NotDone if this algorithm has not been initialized, or if the computation was not successful.

◆ Value()

gp_Pnt GCPnts_UniformDeflection::Value ( const Standard_Integer  Index) const

Returns the point of index Index in the distribution computed by this algorithm. Warning Index must be greater than or equal to 1, and less than or equal to the number of points of the distribution. However, pay particular attention as this condition is not checked by this function. Exceptions StdFAil_NotDone if this algorithm has not been initialized, or if the computation was not successful.


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