OCC.Core.CSLib module

CSLib module, see official documentation at https://www.opencascade.com/doc/occt-7.4.0/refman/html/package_cslib.html

class CSLib_Class2d(*args)

Bases: object

  • Constructs the 2D-polygon. thePnts2d is the set of the vertices (closed polygon will always be created inside of this constructor; consequently, there is no point in repeating first and last point in thePnts2d). theTolu and theTolv are tolerances. theUmin, theVmin, theUmax, theVmax are UV-bounds of the polygon.
    param thePnts2d

    type thePnts2d

    TColgp_Array1OfPnt2d

    param theTolU

    type theTolU

    float

    param theTolV

    type theTolV

    float

    param theUMin

    type theUMin

    float

    param theVMin

    type theVMin

    float

    param theUMax

    type theUMax

    float

    param theVMax

    type theVMax

    float

    rtype

    None* Constructs the 2D-polygon. thePnts2d is the set of the vertices (closed polygon will always be created inside of this constructor; consequently, there is no point in repeating first and last point in thePnts2d). theTolu and theTolv are tolerances. theUmin, theVmin, theUmax, theVmax are UV-bounds of the polygon.

    param thePnts2d

    type thePnts2d

    TColgp_SequenceOfPnt2d

    param theTolU

    type theTolU

    float

    param theTolV

    type theTolV

    float

    param theUMin

    type theUMin

    float

    param theVMin

    type theVMin

    float

    param theUMax

    type theUMax

    float

    param theVMax

    type theVMax

    float

    rtype

    None

InternalSiDans()
Parameters

X

type X

float

param Y

type Y

float

rtype

int

InternalSiDansOuOn()
Parameters

X

type X

float

param Y

type Y

float

rtype

int

SiDans()
Parameters

P

type P

gp_Pnt2d

rtype

int

SiDans_OnMode()
Parameters

P

type P

gp_Pnt2d

param Tol

type Tol

float

rtype

int

property thisown

The membership flag

class CSLib_NormalPolyDef(*args)

Bases: OCC.Core.math.math_FunctionWithDerivative

Parameters

k0

type k0

int

param li

type li

TColStd_Array1OfReal

rtype

None

property thisown

The membership flag

class SwigPyIterator(*args, **kwargs)

Bases: object

advance()
copy()
decr()
distance()
equal()
incr()
next()
previous()
property thisown

The membership flag

value()
class cslib

Bases: object

static DNNUV()
  • – Computes the derivative of order Nu in the – direction U and Nv in the direction V of the not – normalized normal vector at the point P(U,V) The array DerSurf contain the derivative (i,j) of the surface for i=0,Nu+1 ; j=0,Nv+1
    param Nu

    type Nu

    int

    param Nv

    type Nv

    int

    param DerSurf

    type DerSurf

    TColgp_Array2OfVec

    rtype

    gp_Vec* Computes the derivatives of order Nu in the direction Nu and Nv in the direction Nv of the not normalized vector N(u,v) = dS1/du * dS2/dv (cases where we use an osculating surface) DerSurf1 are the derivatives of S1

    param Nu

    type Nu

    int

    param Nv

    type Nv

    int

    param DerSurf1

    type DerSurf1

    TColgp_Array2OfVec

    param DerSurf2

    type DerSurf2

    TColgp_Array2OfVec

    rtype

    gp_Vec

static DNNormal()
  • – Computes the derivative of order Nu in the – direction U and Nv in the direction V of the normalized normal vector at the point P(U,V) array DerNUV contain the derivative (i+Iduref,j+Idvref) of D1U ^ D1V for i=0,Nu ; j=0,Nv Iduref and Idvref correspond to a derivative of D1U ^ D1V which can be used to compute the normalized normal vector. In the regular cases , Iduref=Idvref=0.
    param Nu

    type Nu

    int

    param Nv

    type Nv

    int

    param DerNUV

    type DerNUV

    TColgp_Array2OfVec

    param Iduref

    default value is 0

    type Iduref

    int

    param Idvref

    default value is 0

    type Idvref

    int

    rtype

    gp_Vec

static Normal()
  • The following functions computes the normal to a surface inherits FunctionWithDerivative from math //! Computes the normal direction of a surface as the cross product between D1U and D1V. If D1U has null length or D1V has null length or D1U and D1V are parallel the normal is undefined. To check that D1U and D1V are colinear the sinus of the angle between D1U and D1V is computed and compared with SinTol. The normal is computed if theStatus == Done else the theStatus gives the reason why the computation has failed.
    param D1U

    type D1U

    gp_Vec

    param D1V

    type D1V

    gp_Vec

    param SinTol

    type SinTol

    float

    param theStatus

    type theStatus

    CSLib_DerivativeStatus

    param Normal

    type Normal

    gp_Dir

    rtype

    void* If there is a singularity on the surface the previous method cannot compute the local normal. This method computes an approched normal direction of a surface. It does a limited development and needs the second derivatives on the surface as input data. It computes the normal as follow : N(u, v) = D1U ^ D1V N(u0+du,v0+dv) = N0 + DN/du(u0,v0) * du + DN/dv(u0,v0) * dv + Eps with Eps->0 so we can have the equivalence N ~ dN/du + dN/dv. DNu = ||DN/du|| and DNv = ||DN/dv|| //! . if DNu IsNull (DNu <= Resolution from gp) the answer Done = True the normal direction is given by DN/dv . if DNv IsNull (DNv <= Resolution from gp) the answer Done = True the normal direction is given by DN/du . if the two directions DN/du and DN/dv are parallel Done = True the normal direction is given either by DN/du or DN/dv. To check that the two directions are colinear the sinus of the angle between these directions is computed and compared with SinTol. . if DNu/DNv or DNv/DNu is lower or equal than Real Epsilon Done = False, the normal is undefined . if DNu IsNull and DNv is Null Done = False, there is an indetermination and we should do a limited developpement at order 2 (it means that we cannot omit Eps). . if DNu Is not Null and DNv Is not Null Done = False, there are an infinity of normals at the considered point on the surface.

    param D1U

    type D1U

    gp_Vec

    param D1V

    type D1V

    gp_Vec

    param D2U

    type D2U

    gp_Vec

    param D2V

    type D2V

    gp_Vec

    param D2UV

    type D2UV

    gp_Vec

    param SinTol

    type SinTol

    float

    param Done

    type Done

    bool

    param theStatus

    type theStatus

    CSLib_NormalStatus

    param Normal

    type Normal

    gp_Dir

    rtype

    void* Computes the normal direction of a surface as the cross product between D1U and D1V.

    param D1U

    type D1U

    gp_Vec

    param D1V

    type D1V

    gp_Vec

    param MagTol

    type MagTol

    float

    param theStatus

    type theStatus

    CSLib_NormalStatus

    param Normal

    type Normal

    gp_Dir

    rtype

    void* find the first order k0 of deriviative of NUV where: foreach order < k0 all the derivatives of NUV are null all the derivatives of NUV corresponding to the order k0 are collinear and have the same sens. In this case, normal at U,V is unique.

    param MaxOrder

    type MaxOrder

    int

    param DerNUV

    type DerNUV

    TColgp_Array2OfVec

    param MagTol

    type MagTol

    float

    param U

    type U

    float

    param V

    type V

    float

    param Umin

    type Umin

    float

    param Umax

    type Umax

    float

    param Vmin

    type Vmin

    float

    param Vmax

    type Vmax

    float

    param theStatus

    type theStatus

    CSLib_NormalStatus

    param Normal

    type Normal

    gp_Dir

    param OrderU

    type OrderU

    int

    param OrderV

    type OrderV

    int

    rtype

    void

property thisown

The membership flag