Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
ExtremaPC_BSplineCurve Class Reference

Point-BSplineCurve extrema computation using grid-based approach. More...

#include <ExtremaPC_BSplineCurve.hxx>

Public Member Functions

 ExtremaPC_BSplineCurve (const occ::handle< Geom_BSplineCurve > &theCurve)
 Constructor with BSpline curve (uses full curve domain). Grid is built eagerly at construction time.
 
 ExtremaPC_BSplineCurve (const occ::handle< Geom_BSplineCurve > &theCurve, const ExtremaPC::Domain1D &theDomain)
 Constructor with BSpline curve and parameter domain. Grid is built eagerly at construction time for the specified domain.
 
 ExtremaPC_BSplineCurve (const ExtremaPC_BSplineCurve &)=delete
 Copy constructor is deleted.
 
ExtremaPC_BSplineCurveoperator= (const ExtremaPC_BSplineCurve &)=delete
 Copy assignment operator is deleted.
 
 ExtremaPC_BSplineCurve (ExtremaPC_BSplineCurve &&)=default
 Move constructor.
 
ExtremaPC_BSplineCurveoperator= (ExtremaPC_BSplineCurve &&)=default
 Move assignment operator.
 
gp_Pnt Value (double theU) const
 Evaluates point on curve at parameter.
 
bool IsBounded () const
 Returns true if domain is bounded (subset of curve domain).
 
const ExtremaPC::Domain1DDomain () const
 Returns the domain.
 
const ExtremaPC::ResultPerform (const gp_Pnt &theP, double theTol, ExtremaPC::SearchMode theMode=ExtremaPC::SearchMode::MinMax) const
 Compute extrema between point P and the curve. Uses domain specified at construction time.
 
const ExtremaPC::ResultPerformWithEndpoints (const gp_Pnt &theP, double theTol, ExtremaPC::SearchMode theMode=ExtremaPC::SearchMode::MinMax) const
 Compute extrema between point P and the curve including endpoints. Uses domain specified at construction time.
 
const occ::handle< Geom_BSplineCurve > & Curve () const
 Returns the BSpline curve.
 

Detailed Description

Point-BSplineCurve extrema computation using grid-based approach.

Computes the extrema between a 3D point and a BSpline curve using a grid-based approach with Newton refinement.

The grid is cached for efficiency when performing multiple queries with the same parameter domain.

The algorithm:

  1. Build knot-aware grid with 2*(degree + 1) samples per knot span using GeomGridEval
  2. Linear scan of grid to find candidate intervals (sign changes in F(u))
  3. Newton refinement on each candidate interval

This approach is simpler and more stable than BVH-based methods, with comparable accuracy for typical BSpline curves.

The domain is fixed at construction time and the grid is built eagerly for optimal performance with multiple queries.

Constructor & Destructor Documentation

◆ ExtremaPC_BSplineCurve() [1/4]

ExtremaPC_BSplineCurve::ExtremaPC_BSplineCurve ( const occ::handle< Geom_BSplineCurve > & theCurve)
explicit

Constructor with BSpline curve (uses full curve domain). Grid is built eagerly at construction time.

Parameters
[in]theCurveBSpline curve handle

◆ ExtremaPC_BSplineCurve() [2/4]

ExtremaPC_BSplineCurve::ExtremaPC_BSplineCurve ( const occ::handle< Geom_BSplineCurve > & theCurve,
const ExtremaPC::Domain1D & theDomain )

Constructor with BSpline curve and parameter domain. Grid is built eagerly at construction time for the specified domain.

Parameters
[in]theCurveBSpline curve handle
[in]theDomainparameter domain (fixed for all queries)

◆ ExtremaPC_BSplineCurve() [3/4]

ExtremaPC_BSplineCurve::ExtremaPC_BSplineCurve ( const ExtremaPC_BSplineCurve & )
delete

Copy constructor is deleted.

◆ ExtremaPC_BSplineCurve() [4/4]

ExtremaPC_BSplineCurve::ExtremaPC_BSplineCurve ( ExtremaPC_BSplineCurve && )
default

Move constructor.

Member Function Documentation

◆ Curve()

const occ::handle< Geom_BSplineCurve > & ExtremaPC_BSplineCurve::Curve ( ) const
inline

Returns the BSpline curve.

◆ Domain()

const ExtremaPC::Domain1D & ExtremaPC_BSplineCurve::Domain ( ) const
inline

Returns the domain.

◆ IsBounded()

bool ExtremaPC_BSplineCurve::IsBounded ( ) const
inline

Returns true if domain is bounded (subset of curve domain).

◆ operator=() [1/2]

ExtremaPC_BSplineCurve & ExtremaPC_BSplineCurve::operator= ( const ExtremaPC_BSplineCurve & )
delete

Copy assignment operator is deleted.

◆ operator=() [2/2]

ExtremaPC_BSplineCurve & ExtremaPC_BSplineCurve::operator= ( ExtremaPC_BSplineCurve && )
default

Move assignment operator.

◆ Perform()

const ExtremaPC::Result & ExtremaPC_BSplineCurve::Perform ( const gp_Pnt & theP,
double theTol,
ExtremaPC::SearchMode theMode = ExtremaPC::SearchMode::MinMax ) const

Compute extrema between point P and the curve. Uses domain specified at construction time.

Parameters
thePquery point
theToltolerance for root finding
theModesearch mode (MinMax, Min, or Max)
Returns
const reference to result containing extrema

◆ PerformWithEndpoints()

const ExtremaPC::Result & ExtremaPC_BSplineCurve::PerformWithEndpoints ( const gp_Pnt & theP,
double theTol,
ExtremaPC::SearchMode theMode = ExtremaPC::SearchMode::MinMax ) const

Compute extrema between point P and the curve including endpoints. Uses domain specified at construction time.

Parameters
thePquery point
theToltolerance for root finding
theModesearch mode (MinMax, Min, or Max)
Returns
const reference to result containing interior + endpoint extrema

◆ Value()

gp_Pnt ExtremaPC_BSplineCurve::Value ( double theU) const

Evaluates point on curve at parameter.

Parameters
theUparameter
Returns
point on curve

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