OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    CSLib Class Reference

    Provides functions for basic geometric computation on curves and surfaces. More...

    #include <CSLib.hxx>

    Static Public Member Functions

    static void Normal (const gp_Vec &theD1U, const gp_Vec &theD1V, double theSinTol, CSLib_DerivativeStatus &theStatus, gp_Dir &theNormal)
     Computes the normal direction of a surface as the cross product D1U ^ D1V.
    static void Normal (const gp_Vec &theD1U, const gp_Vec &theD1V, const gp_Vec &theD2U, const gp_Vec &theD2V, const gp_Vec &theD2UV, double theSinTol, bool &theDone, CSLib_NormalStatus &theStatus, gp_Dir &theNormal)
     Computes an approximate normal direction at a singular point using second derivatives.
    static void Normal (const gp_Vec &theD1U, const gp_Vec &theD1V, double theMagTol, CSLib_NormalStatus &theStatus, gp_Dir &theNormal)
     Computes the normal direction using magnitude tolerance.
    static void Normal (int theMaxOrder, const NCollection_Array2< gp_Vec > &theDerNUV, double theMagTol, double theU, double theV, double theUmin, double theUmax, double theVmin, double theVmax, CSLib_NormalStatus &theStatus, gp_Dir &theNormal, int &theOrderU, int &theOrderV)
     Computes the normal at a singular point using higher-order derivatives.
    static gp_Vec DNNUV (int theNu, int theNv, const NCollection_Array2< gp_Vec > &theDerSurf)
     Computes the derivative of order (theNu, theNv) of the non-normalized normal vector.
    static gp_Vec DNNUV (int theNu, int theNv, const NCollection_Array2< gp_Vec > &theDerSurf1, const NCollection_Array2< gp_Vec > &theDerSurf2)
     Computes the derivative of the non-normalized vector N = dS1/du ^ dS2/dv.
    static gp_Vec DNNormal (int theNu, int theNv, const NCollection_Array2< gp_Vec > &theDerNUV, int theIduref=0, int theIdvref=0)
     Computes the derivative of order (theNu, theNv) of the normalized normal vector.

    Detailed Description

    Provides functions for basic geometric computation on curves and surfaces.

    This package implements functions for computing surface normals and their derivatives at parametric points. The tolerance criteria used are Resolution from gp and RealEpsilon from double.

    Key functionality:

    • Normal computation from surface first derivatives (D1U, D1V)
    • Approximate normal in singular cases using second derivatives
    • Derivatives of the non-normalized and normalized normal vectors

    Member Function Documentation

    ◆ DNNormal()

    gp_Vec CSLib::DNNormal ( int theNu,
    int theNv,
    const NCollection_Array2< gp_Vec > & theDerNUV,
    int theIduref = 0,
    int theIdvref = 0 )
    static

    Computes the derivative of order (theNu, theNv) of the normalized normal vector.

    Parameters
    [in]theNuDerivative order in U direction
    [in]theNvDerivative order in V direction
    [in]theDerNUVArray of derivatives of the non-normalized normal. Contains derivatives d^(i+j)(D1U^D1V)/(du^i * dv^j) for i = theIduref..theNu+theIduref, j = theIdvref..theNv+theIdvref
    [in]theIdurefReference index offset in U (default 0 for regular cases)
    [in]theIdvrefReference index offset in V (default 0 for regular cases)
    Returns
    The derivative of the normalized normal vector

    ◆ DNNUV() [1/2]

    gp_Vec CSLib::DNNUV ( int theNu,
    int theNv,
    const NCollection_Array2< gp_Vec > & theDerSurf )
    static

    Computes the derivative of order (theNu, theNv) of the non-normalized normal vector.

    The non-normalized normal is N = dS/du ^ dS/dv. This function computes d^(Nu+Nv)N / (du^Nu * dv^Nv).

    Parameters
    [in]theNuDerivative order in U direction
    [in]theNvDerivative order in V direction
    [in]theDerSurfSurface derivatives array where theDerSurf(i,j) = d^(i+j)S/(du^i * dv^j) for i = 0..theNu+1, j = 0..theNv+1
    Returns
    The derivative vector d^(Nu+Nv)N / (du^Nu * dv^Nv)

    ◆ DNNUV() [2/2]

    gp_Vec CSLib::DNNUV ( int theNu,
    int theNv,
    const NCollection_Array2< gp_Vec > & theDerSurf1,
    const NCollection_Array2< gp_Vec > & theDerSurf2 )
    static

    Computes the derivative of the non-normalized vector N = dS1/du ^ dS2/dv.

    This variant is used for osculating surfaces where the normal is computed from derivatives of two different surfaces.

    Parameters
    [in]theNuDerivative order in U direction
    [in]theNvDerivative order in V direction
    [in]theDerSurf1Derivatives of the first surface S1
    [in]theDerSurf2Derivatives of the second surface S2
    Returns
    The derivative vector

    ◆ Normal() [1/4]

    void CSLib::Normal ( const gp_Vec & theD1U,
    const gp_Vec & theD1V,
    const gp_Vec & theD2U,
    const gp_Vec & theD2V,
    const gp_Vec & theD2UV,
    double theSinTol,
    bool & theDone,
    CSLib_NormalStatus & theStatus,
    gp_Dir & theNormal )
    static

    Computes an approximate normal direction at a singular point using second derivatives.

    When the standard method cannot compute the normal (D1U ^ D1V is null or too small), this method uses a limited Taylor expansion: N(u0+du, v0+dv) = N0 + dN/du * du + dN/dv * dv + O(du^2, dv^2)

    The normal is approximated from dN/du and dN/dv where N = D1U ^ D1V.

    Parameters
    [in]theD1UFirst derivative in U direction
    [in]theD1VFirst derivative in V direction
    [in]theD2USecond derivative in U direction (d^2S/du^2)
    [in]theD2VSecond derivative in V direction (d^2S/dv^2)
    [in]theD2UVMixed second derivative (d^2S/dudv)
    [in]theSinTolSine tolerance for parallelism check
    [out]theDoneTrue if normal was successfully computed
    [out]theStatusResult status with detailed information
    [out]theNormalComputed normal direction (valid only if theDone is true)

    ◆ Normal() [2/4]

    void CSLib::Normal ( const gp_Vec & theD1U,
    const gp_Vec & theD1V,
    double theMagTol,
    CSLib_NormalStatus & theStatus,
    gp_Dir & theNormal )
    static

    Computes the normal direction using magnitude tolerance.

    A simpler version that checks if the cross product magnitude and derivative magnitudes exceed the given tolerance.

    Parameters
    [in]theD1UFirst derivative in U direction
    [in]theD1VFirst derivative in V direction
    [in]theMagTolMagnitude tolerance for singularity detection
    [out]theStatusResult status (CSLib_Defined or CSLib_Singular)
    [out]theNormalComputed normal direction (valid only if theStatus == CSLib_Defined)

    ◆ Normal() [3/4]

    void CSLib::Normal ( const gp_Vec & theD1U,
    const gp_Vec & theD1V,
    double theSinTol,
    CSLib_DerivativeStatus & theStatus,
    gp_Dir & theNormal )
    static

    Computes the normal direction of a surface as the cross product D1U ^ D1V.

    The normal is undefined if:

    • D1U has null length, or
    • D1V has null length, or
    • D1U and D1V are parallel.

    To check parallelism, the sine of the angle between D1U and D1V is computed and compared with theSinTol.

    Parameters
    [in]theD1UFirst derivative in U direction
    [in]theD1VFirst derivative in V direction
    [in]theSinTolSine tolerance for parallelism check
    [out]theStatusResult status indicating success or failure reason
    [out]theNormalComputed normal direction (valid only if theStatus == CSLib_Done)

    ◆ Normal() [4/4]

    void CSLib::Normal ( int theMaxOrder,
    const NCollection_Array2< gp_Vec > & theDerNUV,
    double theMagTol,
    double theU,
    double theV,
    double theUmin,
    double theUmax,
    double theVmin,
    double theVmax,
    CSLib_NormalStatus & theStatus,
    gp_Dir & theNormal,
    int & theOrderU,
    int & theOrderV )
    static

    Computes the normal at a singular point using higher-order derivatives.

    Finds the first order k0 where the derivatives of N = D1U ^ D1V become non-null and collinear, ensuring a unique normal direction.

    Parameters
    [in]theMaxOrderMaximum derivative order to examine
    [in]theDerNUVArray of derivatives of N (indices correspond to derivative orders)
    [in]theMagTolMagnitude tolerance
    [in]theU,theVCurrent parameter values
    [in]theUmin,theUmax,theVmin,theVmaxParameter bounds
    [out]theStatusResult status
    [out]theNormalComputed normal direction
    [out]theOrderU,theOrderVOrders of the first non-null derivative used

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