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

Point-Line extrema computation. More...

#include <ExtremaPC_Line.hxx>

Public Member Functions

 ExtremaPC_Line (const gp_Lin &theLine)
 Constructor with line geometry (unbounded).
 
 ExtremaPC_Line (const gp_Lin &theLine, const ExtremaPC::Domain1D &theDomain)
 Constructor with line geometry and parameter domain.
 
 ExtremaPC_Line (const ExtremaPC_Line &)=delete
 Copy constructor is deleted.
 
ExtremaPC_Lineoperator= (const ExtremaPC_Line &)=delete
 Copy assignment operator is deleted.
 
 ExtremaPC_Line (ExtremaPC_Line &&)=default
 Move constructor.
 
ExtremaPC_Lineoperator= (ExtremaPC_Line &&)=default
 Move assignment operator.
 
gp_Pnt Value (double theU) const
 Evaluates point on line at parameter.
 
bool IsBounded () const
 Returns true if domain is bounded.
 
const ExtremaPC::Domain1DDomain () const
 Returns the domain (only valid if IsBounded() is true).
 
const ExtremaPC::ResultPerform (const gp_Pnt &theP, double theTol, ExtremaPC::SearchMode theMode=ExtremaPC::SearchMode::MinMax) const
 Compute extrema between point P and the line. 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 line segment including endpoints. Uses domain specified at construction time.
 
const gp_LinLine () const
 Returns the line geometry.
 

Detailed Description

Point-Line extrema computation.

Computes the extremum (closest point) between a 3D point and a line. Uses direct analytical projection via dot product.

For a line defined by origin O and direction D, the closest point to P is at parameter u = (P - O) . D, which gives the minimum distance.

The domain is fixed at construction time for optimal performance. For unbounded line, construct without domain or with nullopt.

Note
Lines always have exactly one extremum (minimum) if within bounds.

Constructor & Destructor Documentation

◆ ExtremaPC_Line() [1/4]

ExtremaPC_Line::ExtremaPC_Line ( const gp_Lin & theLine)
inlineexplicit

Constructor with line geometry (unbounded).

Parameters
[in]theLinethe line to compute extrema for

◆ ExtremaPC_Line() [2/4]

ExtremaPC_Line::ExtremaPC_Line ( const gp_Lin & theLine,
const ExtremaPC::Domain1D & theDomain )
inline

Constructor with line geometry and parameter domain.

Parameters
[in]theLinethe line to compute extrema for
[in]theDomainparameter domain (fixed for all queries)

◆ ExtremaPC_Line() [3/4]

ExtremaPC_Line::ExtremaPC_Line ( const ExtremaPC_Line & )
delete

Copy constructor is deleted.

◆ ExtremaPC_Line() [4/4]

ExtremaPC_Line::ExtremaPC_Line ( ExtremaPC_Line && )
default

Move constructor.

Member Function Documentation

◆ Domain()

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

Returns the domain (only valid if IsBounded() is true).

◆ IsBounded()

bool ExtremaPC_Line::IsBounded ( ) const
inline

Returns true if domain is bounded.

◆ Line()

const gp_Lin & ExtremaPC_Line::Line ( ) const
inline

Returns the line geometry.

◆ operator=() [1/2]

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

Copy assignment operator is deleted.

◆ operator=() [2/2]

ExtremaPC_Line & ExtremaPC_Line::operator= ( ExtremaPC_Line && )
default

Move assignment operator.

◆ Perform()

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

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

Parameters
thePquery point
theToltolerance for parameter comparison
theModesearch mode (unused for lines - always returns minimum)
Returns
const reference to result containing the extremum

◆ PerformWithEndpoints()

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

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

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

◆ Value()

gp_Pnt ExtremaPC_Line::Value ( double theU) const
inline

Evaluates point on line at parameter.

Parameters
theUparameter
Returns
point on line

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