Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Data Structures | Functions
LProp_SurfaceUtils Namespace Reference

Template utility functions for SLProps surface local property computation. Provides access policies (DirectAccess, ToolAccess), surface bounds helpers, and shared algorithms for evaluating derivatives, tangents, normals, and curvatures. More...

Data Structures

struct  DirectAccess
 Direct access policy: calls D0/D1/D2 methods on the surface object. Works with occ::handle<T> and by-value surface types. More...
 
struct  ToolAccess
 Tool-based access policy: delegates to static Tool methods. Used for HLRBRep types where Tool class provides the interface. More...
 

Functions

template<typename T >
T & Deref (T &theObj)
 Dereference by-value or reference types (identity).
 
template<typename T >
T & Deref (occ::handle< T > &theHandle)
 Dereference occ::handle types.
 
template<typename T >
const T & Deref (const occ::handle< T > &theHandle)
 Dereference const occ::handle types.
 
void GetSurfBounds (const Geom_Surface &theSurf, double &theU1, double &theV1, double &theU2, double &theV2)
 Get bounds from Geom_Surface (uses Bounds method with U1, U2, V1, V2 order).
 
void GetSurfBounds (const Adaptor3d_Surface &theSurf, double &theU1, double &theV1, double &theU2, double &theV2)
 Get bounds from Adaptor3d_Surface (uses individual parameter methods). Also works for BRepAdaptor_Surface which inherits from Adaptor3d_Surface.
 
template<typename Access , typename Surface >
void EvalSurfDerivatives (Surface &theSurf, double theU, double theV, int theOrder, gp_Pnt &thePnt, gp_Vec &theD1u, gp_Vec &theD1v, gp_Vec &theD2u, gp_Vec &theD2v, gp_Vec &theDuv)
 Evaluate surface derivatives at parameters (theU, theV) up to specified order.
 
bool FindSurfTangentOrder (const gp_Vec &theD1, const gp_Vec &theD2, int theCN, double theTolSq, int &theOrder, LProp_Status &theStatus)
 Check if the surface tangent is defined for a given derivative direction. Searches for the first non-null derivative in either U or V direction.
 
template<typename Access , typename Surface >
void ComputeSurfTangent (Surface &theSurf, double theU, double theV, const gp_Vec &theFirstDeriv, const gp_Vec &theSecDeriv, int theSigOrder, bool theIsU, gp_Dir &theDir)
 Compute surface tangent direction with sign correction for higher-order derivatives. When the first significant derivative has order > 1, the sign is determined by comparing with the chord direction near the point.
 
bool ComputeSurfNormal (const gp_Vec &theD1u, const gp_Vec &theD1v, double theLinTol, gp_Dir &theNormal)
 Check if surface normal is defined, and compute it via CSLib::Normal.
 
bool ComputeSurfCurvatures (const gp_Vec &theD1u, const gp_Vec &theD1v, const gp_Vec &theD2u, const gp_Vec &theD2v, const gp_Vec &theDuv, const gp_Dir &theNormal, double &theMinCurv, double &theMaxCurv, gp_Dir &theDirMin, gp_Dir &theDirMax, double &theMeanCurv, double &theGausCurv)
 Compute principal curvatures and directions via fundamental forms. Solves the eigenvalue problem for the shape operator using first and second fundamental form coefficients.
 
template<typename Access , typename Surface >
void SetParameters (Surface &theSurf, double theU, double theV, double &theStoredU, double &theStoredV, int theDerOrder, gp_Pnt &thePnt, gp_Vec &theD1u, gp_Vec &theD1v, gp_Vec &theD2u, gp_Vec &theD2v, gp_Vec &theDuv, LProp_Status &theUTanSt, LProp_Status &theVTanSt, LProp_Status &theNormSt, LProp_Status &theCurvSt)
 SetParameters: sets parameters, evaluates derivatives, resets all statuses.
 
template<typename Access , typename Surface >
const gp_VecEnsureSurfDeriv (Surface &theSurf, double theU, double theV, int &theDerOrder, int theRequired, gp_Pnt &thePnt, gp_Vec &theD1u, gp_Vec &theD1v, gp_Vec &theD2u, gp_Vec &theD2v, gp_Vec &theDuv, const gp_Vec &theResult)
 Ensure surface derivatives up to the required order. Returns the specified result field.
 
template<typename Props >
bool IsTangentUDefined (Props &theProps, int theCN, double theLinTol, int &theSigOrder, LProp_Status &theTanStatus)
 IsTangentUDefined: checks U tangent status, then searches via D1U/D2U.
 
template<typename Props >
bool IsTangentVDefined (Props &theProps, int theCN, double theLinTol, int &theSigOrder, LProp_Status &theTanStatus)
 IsTangentVDefined: checks V tangent status, then searches via D1V/D2V.
 
template<typename Access , typename Props , typename Surface >
void TangentU (Props &theProps, Surface &theSurf, double theU, double theV, const gp_Vec &theD1u, const gp_Vec &theD2u, int theSigOrder, gp_Dir &theDir)
 TangentU: checks IsTangentUDefined, then computes U tangent direction.
 
template<typename Access , typename Props , typename Surface >
void TangentV (Props &theProps, Surface &theSurf, double theU, double theV, const gp_Vec &theD1v, const gp_Vec &theD2v, int theSigOrder, gp_Dir &theDir)
 TangentV: checks IsTangentVDefined, then computes V tangent direction.
 
bool IsNormalDefined (const gp_Vec &theD1u, const gp_Vec &theD1v, double theLinTol, gp_Dir &theNormal, LProp_Status &theNormStatus)
 IsNormalDefined: checks normal status, then computes via CSLib.
 
template<typename Props >
const gp_DirNormal (Props &theProps, const gp_Dir &theNormal)
 Normal: checks IsNormalDefined (via theProps), then returns normal.
 
template<typename Props >
bool IsCurvatureDefined (Props &theProps, int theCN, int &theDerOrder, const gp_Vec &theD1u, const gp_Vec &theD1v, const gp_Vec &theD2u, const gp_Vec &theD2v, const gp_Vec &theDuv, const gp_Dir &theNormal, double &theMinCurv, double &theMaxCurv, gp_Dir &theDirMin, gp_Dir &theDirMax, double &theMeanCurv, double &theGausCurv, LProp_Status &theCurvStatus)
 IsCurvatureDefined: full check including continuity, normal, tangents, and curvature computation.
 
template<typename Props >
double RequireCurvature (Props &theProps, double theValue)
 Require curvature to be defined, throw if not. Returns the given value.
 
template<typename Props >
bool IsUmbilic (Props &theProps, double theMaxCurv, double theMinCurv)
 IsUmbilic: checks curvature, then compares min/max.
 
template<typename Props >
void CurvatureDirections (Props &theProps, const gp_Dir &theDirMax, const gp_Dir &theDirMin, gp_Dir &theMax, gp_Dir &theMin)
 CurvatureDirections: checks curvature, then returns max/min directions.
 

Detailed Description

Template utility functions for SLProps surface local property computation. Provides access policies (DirectAccess, ToolAccess), surface bounds helpers, and shared algorithms for evaluating derivatives, tangents, normals, and curvatures.

Function Documentation

◆ ComputeSurfCurvatures()

bool LProp_SurfaceUtils::ComputeSurfCurvatures ( const gp_Vec & theD1u,
const gp_Vec & theD1v,
const gp_Vec & theD2u,
const gp_Vec & theD2v,
const gp_Vec & theDuv,
const gp_Dir & theNormal,
double & theMinCurv,
double & theMaxCurv,
gp_Dir & theDirMin,
gp_Dir & theDirMax,
double & theMeanCurv,
double & theGausCurv )
inline

Compute principal curvatures and directions via fundamental forms. Solves the eigenvalue problem for the shape operator using first and second fundamental form coefficients.

Parameters
[in]theD1ufirst U derivative
[in]theD1vfirst V derivative
[in]theD2usecond U derivative
[in]theD2vsecond V derivative
[in]theDuvmixed UV derivative
[in]theNormalsurface normal direction
[out]theMinCurvminimum principal curvature
[out]theMaxCurvmaximum principal curvature
[out]theDirMindirection of minimum curvature
[out]theDirMaxdirection of maximum curvature
[out]theMeanCurvmean curvature
[out]theGausCurvGaussian curvature
Returns
true if curvatures are successfully computed

◆ ComputeSurfNormal()

bool LProp_SurfaceUtils::ComputeSurfNormal ( const gp_Vec & theD1u,
const gp_Vec & theD1v,
double theLinTol,
gp_Dir & theNormal )
inline

Check if surface normal is defined, and compute it via CSLib::Normal.

Parameters
[in]theD1ufirst U derivative
[in]theD1vfirst V derivative
[in]theLinTollinear tolerance
[out]theNormalcomputed normal direction (if defined)
Returns
true if normal is defined

◆ ComputeSurfTangent()

template<typename Access , typename Surface >
void LProp_SurfaceUtils::ComputeSurfTangent ( Surface & theSurf,
double theU,
double theV,
const gp_Vec & theFirstDeriv,
const gp_Vec & theSecDeriv,
int theSigOrder,
bool theIsU,
gp_Dir & theDir )

Compute surface tangent direction with sign correction for higher-order derivatives. When the first significant derivative has order > 1, the sign is determined by comparing with the chord direction near the point.

Parameters
[in,out]theSurfsurface object
[in]theUcurrent U parameter
[in]theVcurrent V parameter
[in]theFirstDerivfirst derivative in this direction (D1U or D1V)
[in]theSecDerivsecond derivative in this direction (D2U or D2V)
[in]theSigOrderorder of first significant derivative
[in]theIsUtrue for U direction, false for V direction
[out]theDircomputed tangent direction

◆ CurvatureDirections()

template<typename Props >
void LProp_SurfaceUtils::CurvatureDirections ( Props & theProps,
const gp_Dir & theDirMax,
const gp_Dir & theDirMin,
gp_Dir & theMax,
gp_Dir & theMin )

CurvatureDirections: checks curvature, then returns max/min directions.

◆ Deref() [1/3]

template<typename T >
const T & LProp_SurfaceUtils::Deref ( const occ::handle< T > & theHandle)

Dereference const occ::handle types.

◆ Deref() [2/3]

template<typename T >
T & LProp_SurfaceUtils::Deref ( occ::handle< T > & theHandle)

Dereference occ::handle types.

◆ Deref() [3/3]

template<typename T >
T & LProp_SurfaceUtils::Deref ( T & theObj)

Dereference by-value or reference types (identity).

◆ EnsureSurfDeriv()

template<typename Access , typename Surface >
const gp_Vec & LProp_SurfaceUtils::EnsureSurfDeriv ( Surface & theSurf,
double theU,
double theV,
int & theDerOrder,
int theRequired,
gp_Pnt & thePnt,
gp_Vec & theD1u,
gp_Vec & theD1v,
gp_Vec & theD2u,
gp_Vec & theD2v,
gp_Vec & theDuv,
const gp_Vec & theResult )

Ensure surface derivatives up to the required order. Returns the specified result field.

◆ EvalSurfDerivatives()

template<typename Access , typename Surface >
void LProp_SurfaceUtils::EvalSurfDerivatives ( Surface & theSurf,
double theU,
double theV,
int theOrder,
gp_Pnt & thePnt,
gp_Vec & theD1u,
gp_Vec & theD1v,
gp_Vec & theD2u,
gp_Vec & theD2v,
gp_Vec & theDuv )

Evaluate surface derivatives at parameters (theU, theV) up to specified order.

Parameters
[in,out]theSurfsurface object
[in]theUU parameter value
[in]theVV parameter value
[in]theOrdermaximum derivative order (0-2)
[out]thePntevaluated point
[out]theD1ufirst U derivative
[out]theD1vfirst V derivative
[out]theD2usecond U derivative
[out]theD2vsecond V derivative
[out]theDuvmixed UV derivative

◆ FindSurfTangentOrder()

bool LProp_SurfaceUtils::FindSurfTangentOrder ( const gp_Vec & theD1,
const gp_Vec & theD2,
int theCN,
double theTolSq,
int & theOrder,
LProp_Status & theStatus )
inline

Check if the surface tangent is defined for a given derivative direction. Searches for the first non-null derivative in either U or V direction.

Parameters
[in]theD1first derivative (D1U for U direction, D1V for V direction)
[in]theD2second derivative (D2U for U direction, D2V for V direction)
[in]theCNcontinuity order
[in]theTolSqsquared linear tolerance
[out]theOrderorder of first significant derivative
[out]theStatusresulting tangent status
Returns
true if tangent is defined

◆ GetSurfBounds() [1/2]

void LProp_SurfaceUtils::GetSurfBounds ( const Adaptor3d_Surface & theSurf,
double & theU1,
double & theV1,
double & theU2,
double & theV2 )
inline

Get bounds from Adaptor3d_Surface (uses individual parameter methods). Also works for BRepAdaptor_Surface which inherits from Adaptor3d_Surface.

◆ GetSurfBounds() [2/2]

void LProp_SurfaceUtils::GetSurfBounds ( const Geom_Surface & theSurf,
double & theU1,
double & theV1,
double & theU2,
double & theV2 )
inline

Get bounds from Geom_Surface (uses Bounds method with U1, U2, V1, V2 order).

◆ IsCurvatureDefined()

template<typename Props >
bool LProp_SurfaceUtils::IsCurvatureDefined ( Props & theProps,
int theCN,
int & theDerOrder,
const gp_Vec & theD1u,
const gp_Vec & theD1v,
const gp_Vec & theD2u,
const gp_Vec & theD2v,
const gp_Vec & theDuv,
const gp_Dir & theNormal,
double & theMinCurv,
double & theMaxCurv,
gp_Dir & theDirMin,
gp_Dir & theDirMax,
double & theMeanCurv,
double & theGausCurv,
LProp_Status & theCurvStatus )

IsCurvatureDefined: full check including continuity, normal, tangents, and curvature computation.

◆ IsNormalDefined()

bool LProp_SurfaceUtils::IsNormalDefined ( const gp_Vec & theD1u,
const gp_Vec & theD1v,
double theLinTol,
gp_Dir & theNormal,
LProp_Status & theNormStatus )
inline

IsNormalDefined: checks normal status, then computes via CSLib.

◆ IsTangentUDefined()

template<typename Props >
bool LProp_SurfaceUtils::IsTangentUDefined ( Props & theProps,
int theCN,
double theLinTol,
int & theSigOrder,
LProp_Status & theTanStatus )

IsTangentUDefined: checks U tangent status, then searches via D1U/D2U.

◆ IsTangentVDefined()

template<typename Props >
bool LProp_SurfaceUtils::IsTangentVDefined ( Props & theProps,
int theCN,
double theLinTol,
int & theSigOrder,
LProp_Status & theTanStatus )

IsTangentVDefined: checks V tangent status, then searches via D1V/D2V.

◆ IsUmbilic()

template<typename Props >
bool LProp_SurfaceUtils::IsUmbilic ( Props & theProps,
double theMaxCurv,
double theMinCurv )

IsUmbilic: checks curvature, then compares min/max.

◆ Normal()

template<typename Props >
const gp_Dir & LProp_SurfaceUtils::Normal ( Props & theProps,
const gp_Dir & theNormal )

Normal: checks IsNormalDefined (via theProps), then returns normal.

◆ RequireCurvature()

template<typename Props >
double LProp_SurfaceUtils::RequireCurvature ( Props & theProps,
double theValue )

Require curvature to be defined, throw if not. Returns the given value.

◆ SetParameters()

template<typename Access , typename Surface >
void LProp_SurfaceUtils::SetParameters ( Surface & theSurf,
double theU,
double theV,
double & theStoredU,
double & theStoredV,
int theDerOrder,
gp_Pnt & thePnt,
gp_Vec & theD1u,
gp_Vec & theD1v,
gp_Vec & theD2u,
gp_Vec & theD2v,
gp_Vec & theDuv,
LProp_Status & theUTanSt,
LProp_Status & theVTanSt,
LProp_Status & theNormSt,
LProp_Status & theCurvSt )

SetParameters: sets parameters, evaluates derivatives, resets all statuses.

◆ TangentU()

template<typename Access , typename Props , typename Surface >
void LProp_SurfaceUtils::TangentU ( Props & theProps,
Surface & theSurf,
double theU,
double theV,
const gp_Vec & theD1u,
const gp_Vec & theD2u,
int theSigOrder,
gp_Dir & theDir )

TangentU: checks IsTangentUDefined, then computes U tangent direction.

◆ TangentV()

template<typename Access , typename Props , typename Surface >
void LProp_SurfaceUtils::TangentV ( Props & theProps,
Surface & theSurf,
double theU,
double theV,
const gp_Vec & theD1v,
const gp_Vec & theD2v,
int theSigOrder,
gp_Dir & theDir )

TangentV: checks IsTangentVDefined, then computes V tangent direction.