OCC.Core.PLib module

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

class PLib_Base(*args, **kwargs)

Bases: OCC.Core.Standard.Standard_Transient

  • Empty constructor

Return type

None* Copy constructor – does nothing

Parameters

& (Standard_Transient) –

Return type

None

D0()
  • Compute the values of the basis functions in u
    param U

    type U

    float

    param BasisValue

    type BasisValue

    TColStd_Array1OfReal

    rtype

    void

D1()
  • Compute the values and the derivatives values of the basis functions in u
    param U

    type U

    float

    param BasisValue

    type BasisValue

    TColStd_Array1OfReal

    param BasisD1

    type BasisD1

    TColStd_Array1OfReal

    rtype

    void

D2()
  • Compute the values and the derivatives values of the basis functions in u
    param U

    type U

    float

    param BasisValue

    type BasisValue

    TColStd_Array1OfReal

    param BasisD1

    type BasisD1

    TColStd_Array1OfReal

    param BasisD2

    type BasisD2

    TColStd_Array1OfReal

    rtype

    void

D3()
  • Compute the values and the derivatives values of the basis functions in u
    param U

    type U

    float

    param BasisValue

    type BasisValue

    TColStd_Array1OfReal

    param BasisD1

    type BasisD1

    TColStd_Array1OfReal

    param BasisD2

    type BasisD2

    TColStd_Array1OfReal

    param BasisD3

    type BasisD3

    TColStd_Array1OfReal

    rtype

    void

static DownCast(t)
ReduceDegree()
  • Compute NewDegree <= MaxDegree so that MaxError is lower than Tol. MaxError can be greater than Tol if it is not possible to find a NewDegree <= MaxDegree. In this case NewDegree = MaxDegree
    param Dimension

    type Dimension

    int

    param MaxDegree

    type MaxDegree

    int

    param Tol

    type Tol

    float

    param BaseCoeff

    type BaseCoeff

    float

    param NewDegree

    type NewDegree

    int

    param MaxError

    type MaxError

    float

    rtype

    void

ToCoefficients()
  • Convert the polynomial P(t) in the canonical base.
    param Dimension

    type Dimension

    int

    param Degree

    type Degree

    int

    param CoeffinBase

    type CoeffinBase

    TColStd_Array1OfReal

    param Coefficients

    type Coefficients

    TColStd_Array1OfReal

    rtype

    void

WorkDegree()
  • returns WorkDegree
    rtype

    int

property thisown

The membership flag

class PLib_DoubleJacobiPolynomial(*args)

Bases: object

Return type

None:param JacPolU: :type JacPolU: PLib_JacobiPolynomial :param JacPolV: :type JacPolV: PLib_JacobiPolynomial :rtype: None

AverageError()
Parameters

Dimension

type Dimension

int

param DegreeU

type DegreeU

int

param DegreeV

type DegreeV

int

param dJacCoeff

type dJacCoeff

int

param JacCoeff

type JacCoeff

TColStd_Array1OfReal

rtype

float

MaxError()
Parameters

Dimension

type Dimension

int

param MinDegreeU

type MinDegreeU

int

param MaxDegreeU

type MaxDegreeU

int

param MinDegreeV

type MinDegreeV

int

param MaxDegreeV

type MaxDegreeV

int

param dJacCoeff

type dJacCoeff

int

param JacCoeff

type JacCoeff

TColStd_Array1OfReal

param Error

type Error

float

rtype

float

MaxErrorU()
Parameters

Dimension

type Dimension

int

param DegreeU

type DegreeU

int

param DegreeV

type DegreeV

int

param dJacCoeff

type dJacCoeff

int

param JacCoeff

type JacCoeff

TColStd_Array1OfReal

rtype

float

MaxErrorV()
Parameters

Dimension

type Dimension

int

param DegreeU

type DegreeU

int

param DegreeV

type DegreeV

int

param dJacCoeff

type dJacCoeff

int

param JacCoeff

type JacCoeff

TColStd_Array1OfReal

rtype

float

ReduceDegree()
Parameters

Dimension

type Dimension

int

param MinDegreeU

type MinDegreeU

int

param MaxDegreeU

type MaxDegreeU

int

param MinDegreeV

type MinDegreeV

int

param MaxDegreeV

type MaxDegreeV

int

param dJacCoeff

type dJacCoeff

int

param JacCoeff

type JacCoeff

TColStd_Array1OfReal

param EpmsCut

type EpmsCut

float

param MaxError

type MaxError

float

param NewDegreeU

type NewDegreeU

int

param NewDegreeV

type NewDegreeV

int

rtype

None

TabMaxU()
  • returns myTabMaxU;
    rtype

    opencascade::handle<TColStd_HArray1OfReal>

TabMaxV()
  • returns myTabMaxV;
    rtype

    opencascade::handle<TColStd_HArray1OfReal>

U()
  • returns myJacPolU;
    rtype

    opencascade::handle<PLib_JacobiPolynomial>

V()
  • returns myJacPolV;
    rtype

    opencascade::handle<PLib_JacobiPolynomial>

WDoubleJacobiToCoefficients()
Parameters

Dimension

type Dimension

int

param DegreeU

type DegreeU

int

param DegreeV

type DegreeV

int

param JacCoeff

type JacCoeff

TColStd_Array1OfReal

param Coefficients

type Coefficients

TColStd_Array1OfReal

rtype

None

property thisown

The membership flag

class PLib_HermitJacobi(*args)

Bases: OCC.Core.PLib.PLib_Base

  • Initialize the polynomial class Degree has to be <= 30 ConstraintOrder has to be GeomAbs_C0 GeomAbs_C1 GeomAbs_C2
    param WorkDegree

    type WorkDegree

    int

    param ConstraintOrder

    type ConstraintOrder

    GeomAbs_Shape

    rtype

    None

AverageError()
Parameters

Dimension

type Dimension

int

param HermJacCoeff

type HermJacCoeff

float

param NewDegree

type NewDegree

int

rtype

float

static DownCast(t)
MaxError()
  • This method computes the maximum error on the polynomial W(t) Q(t) obtained by missing the coefficients of JacCoeff from NewDegree +1 to Degree
    param Dimension

    type Dimension

    int

    param HermJacCoeff

    type HermJacCoeff

    float

    param NewDegree

    type NewDegree

    int

    rtype

    float

NivConstr()
  • returns NivConstr
    rtype

    int

property thisown

The membership flag

class PLib_JacobiPolynomial(*args)

Bases: OCC.Core.PLib.PLib_Base

  • Initialize the polynomial class Degree has to be <= 30 ConstraintOrder has to be GeomAbs_C0 GeomAbs_C1 GeomAbs_C2
    param WorkDegree

    type WorkDegree

    int

    param ConstraintOrder

    type ConstraintOrder

    GeomAbs_Shape

    rtype

    None

AverageError()
Parameters

Dimension

type Dimension

int

param JacCoeff

type JacCoeff

float

param NewDegree

type NewDegree

int

rtype

float

static DownCast(t)
MaxError()
  • This method computes the maximum error on the polynomial W(t) Q(t) obtained by missing the coefficients of JacCoeff from NewDegree +1 to Degree
    param Dimension

    type Dimension

    int

    param JacCoeff

    type JacCoeff

    float

    param NewDegree

    type NewDegree

    int

    rtype

    float

MaxValue()
  • this method loads for k=0,q the maximum value of abs ( W(t)*Jk(t) )for t bellonging to [-1,1] This values are loaded is the array TabMax(0,myWorkDegree-2*(myNivConst+1)) MaxValue ( me ; TabMaxPointerin out Real );
    param TabMax

    type TabMax

    TColStd_Array1OfReal

    rtype

    None

NivConstr()
  • returns NivConstr
    rtype

    int

Points()
  • returns the Jacobi Points for Gauss integration ie the positive values of the Legendre roots by increasing values NbGaussPoints is the number of points choosen for the integral computation. TabPoints (0,NbGaussPoints/2) TabPoints (0) is loaded only for the odd values of NbGaussPoints The possible values for NbGaussPoints are8, 10, 15, 20, 25, 30, 35, 40, 50, 61 NbGaussPoints must be greater than Degree
    param NbGaussPoints

    type NbGaussPoints

    int

    param TabPoints

    type TabPoints

    TColStd_Array1OfReal

    rtype

    None

Weights()
  • returns the Jacobi weigths for Gauss integration only for the positive values of the Legendre roots in the order they are given by the method Points NbGaussPoints is the number of points choosen for the integral computation. TabWeights (0,NbGaussPoints/2,0,Degree) TabWeights (0,.) are only loaded for the odd values of NbGaussPoints The possible values for NbGaussPoints are8 , 10 , 15 ,20 ,25 , 30, 35 , 40 , 50 , 61 NbGaussPoints must be greater than Degree
    param NbGaussPoints

    type NbGaussPoints

    int

    param TabWeights

    type TabWeights

    TColStd_Array2OfReal

    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 plib

Bases: object

static Bin()
  • Returns the Binomial Cnp. N should be <= BSplCLib::MaxDegree().
    param N

    type N

    int

    param P

    type P

    int

    rtype

    float

static CoefficientsPoles()
Parameters

Coefs

type Coefs

TColgp_Array1OfPnt

param WCoefs

type WCoefs

TColStd_Array1OfReal *

param Poles

type Poles

TColgp_Array1OfPnt

param WPoles

type WPoles

TColStd_Array1OfReal *

rtype

void:param Coefs:

type Coefs

TColgp_Array1OfPnt2d

param WCoefs

type WCoefs

TColStd_Array1OfReal *

param Poles

type Poles

TColgp_Array1OfPnt2d

param WPoles

type WPoles

TColStd_Array1OfReal *

rtype

void:param Coefs:

type Coefs

TColStd_Array1OfReal

param WCoefs

type WCoefs

TColStd_Array1OfReal *

param Poles

type Poles

TColStd_Array1OfReal

param WPoles

type WPoles

TColStd_Array1OfReal *

rtype

void:param dim:

type dim

int

param Coefs

type Coefs

TColStd_Array1OfReal

param WCoefs

type WCoefs

TColStd_Array1OfReal *

param Poles

type Poles

TColStd_Array1OfReal

param WPoles

type WPoles

TColStd_Array1OfReal *

rtype

void:param Coefs:

type Coefs

TColgp_Array2OfPnt

param WCoefs

type WCoefs

TColStd_Array2OfReal *

param Poles

type Poles

TColgp_Array2OfPnt

param WPoles

type WPoles

TColStd_Array2OfReal *

rtype

void

static ConstraintOrder()
  • translates from Integer to GeomAbs_Shape
    param NivConstr

    type NivConstr

    int

    rtype

    GeomAbs_Shape

static EvalCubicHermite()
  • Performs the Cubic Hermite Interpolation of given series of points with given parameters with the requested derivative order. ValueArray stores the value at the first and last parameter. It has the following format[0], [Dimension-1]value at first param [Dimension], [Dimension + Dimension-1]value at last param Derivative array stores the value of the derivatives at the first parameter and at the last parameter in the following format [0], [Dimension-1]derivative at first param [Dimension], [Dimension + Dimension-1]derivative at last param //! ParameterArray stores the first and last parameter in the following format[0]first parameter [1]last parameter //! Results will store things in the following format with d = DerivativeOrder //! [0], [Dimension-1]value [Dimension], [Dimension + Dimension-1]first derivative //! [d *Dimension], [d*Dimension + Dimension-1]: dth derivative
    param U

    type U

    float

    param DerivativeOrder

    type DerivativeOrder

    int

    param Dimension

    type Dimension

    int

    param ValueArray

    type ValueArray

    float

    param DerivativeArray

    type DerivativeArray

    float

    param ParameterArray

    type ParameterArray

    float

    param Results

    type Results

    float

    rtype

    int

static EvalLagrange()
  • Performs the Lagrange Interpolation of given series of points with given parameters with the requested derivative order Results will store things in the following format with d = DerivativeOrder //! [0], [Dimension-1]value [Dimension], [Dimension + Dimension-1]first derivative //! [d *Dimension], [d*Dimension + Dimension-1]: dth derivative
    param U

    type U

    float

    param DerivativeOrder

    type DerivativeOrder

    int

    param Degree

    type Degree

    int

    param Dimension

    type Dimension

    int

    param ValueArray

    type ValueArray

    float

    param ParameterArray

    type ParameterArray

    float

    param Results

    type Results

    float

    rtype

    int

static EvalLength()
Parameters

Degree

type Degree

int

param Dimension

type Dimension

int

param PolynomialCoeff

type PolynomialCoeff

float

param U1

type U1

float

param U2

type U2

float

param Length

type Length

float

rtype

void:param Degree:

type Degree

int

param Dimension

type Dimension

int

param PolynomialCoeff

type PolynomialCoeff

float

param U1

type U1

float

param U2

type U2

float

param Tol

type Tol

float

param Length

type Length

float

param Error

type Error

float

rtype

void

static EvalPoly2Var()
  • Applies EvalPolynomial twice to evaluate the derivative of orders UDerivativeOrder in U, VDerivativeOrder in V at parameters U,V //! PolynomialCoeff are stored in the following fashion c00(1) …. c00(Dimension) c10(1) …. c10(Dimension) …. cm0(1) …. cm0(Dimension) …. c01(1) …. c01(Dimension) c11(1) …. c11(Dimension) …. cm1(1) …. cm1(Dimension) …. c0n(1) …. c0n(Dimension) c1n(1) …. c1n(Dimension) …. cmn(1) …. cmn(Dimension) //! where the polynomial is defined as2 m c00 + c10 U + c20 U + …. + cm0 U 2 m + c01 V + c11 UV + c21 U V + …. + cm1 U V n m n + …. + c0n V + …. + cmn U V //! with m = UDegree and n = VDegree //! Results stores the result in the following format //! f(1) f(2) …. f(Dimension) //! Warning: <Results> and <PolynomialCoeff> must be dimensioned properly
    param U

    type U

    float

    param V

    type V

    float

    param UDerivativeOrder

    type UDerivativeOrder

    int

    param VDerivativeOrder

    type VDerivativeOrder

    int

    param UDegree

    type UDegree

    int

    param VDegree

    type VDegree

    int

    param Dimension

    type Dimension

    int

    param PolynomialCoeff

    type PolynomialCoeff

    float

    param Results

    type Results

    float

    rtype

    void

static EvalPolynomial()
  • Performs Horner method with synthethic division for derivatives parameter <U>, with <Degree> and <Dimension>. PolynomialCoeff are stored in the following fashion c0(1) c0(2) …. c0(Dimension) c1(1) c1(2) …. c1(Dimension) //! cDegree(1) cDegree(2) …. cDegree(Dimension) where the polynomial is defined as//! 2 Degree c0 + c1 X + c2 X + …. cDegree X //! Results stores the result in the following format //! f(1) f(2) …. f(Dimension) (1) (1) (1) f (1) f (2) …. f (Dimension) //! (DerivativeRequest) (DerivativeRequest) f (1) f (Dimension) //! this just evaluates the point at parameter U //! Warning: <Results> and <PolynomialCoeff> must be dimensioned properly
    param U

    type U

    float

    param DerivativeOrder

    type DerivativeOrder

    int

    param Degree

    type Degree

    int

    param Dimension

    type Dimension

    int

    param PolynomialCoeff

    type PolynomialCoeff

    float

    param Results

    type Results

    float

    rtype

    void

static GetPoles()
  • Get from FP the coordinates of the poles.
    param FP

    type FP

    TColStd_Array1OfReal

    param Poles

    type Poles

    TColgp_Array1OfPnt

    rtype

    void* Get from FP the coordinates of the poles.

    param FP

    type FP

    TColStd_Array1OfReal

    param Poles

    type Poles

    TColgp_Array1OfPnt

    param Weights

    type Weights

    TColStd_Array1OfReal

    rtype

    void* Get from FP the coordinates of the poles.

    param FP

    type FP

    TColStd_Array1OfReal

    param Poles

    type Poles

    TColgp_Array1OfPnt2d

    rtype

    void* Get from FP the coordinates of the poles.

    param FP

    type FP

    TColStd_Array1OfReal

    param Poles

    type Poles

    TColgp_Array1OfPnt2d

    param Weights

    type Weights

    TColStd_Array1OfReal

    rtype

    void

static HermiteCoefficients()
  • This build the coefficient of Hermite’s polynomes on [FirstParameter, LastParameter] //! if j <= FirstOrder+1 then //! MatrixCoefs[i, j] = ith coefficient of the polynome H0,j-1 //! else //! MatrixCoefs[i, j] = ith coefficient of the polynome H1,k with k = j - FirstOrder - 2 //! return false if - |FirstParameter| > 100 - |LastParameter| > 100 - |FirstParameter| +|LastParameter| < 1/100 - |LastParameter - FirstParameter| / (|FirstParameter| +|LastParameter|) < 1/100
    param FirstParameter

    type FirstParameter

    float

    param LastParameter

    type LastParameter

    float

    param FirstOrder

    type FirstOrder

    int

    param LastOrder

    type LastOrder

    int

    param MatrixCoefs

    type MatrixCoefs

    math_Matrix

    rtype

    bool

static HermiteInterpolate()
  • Compute the coefficients in the canonical base of the polynomial satisfying the given constraints at the given parameters The array FirstContr(i,j) i=1,Dimension j=0,FirstOrder contains the values of the constraint at parameter FirstParameter idem for LastConstr
    param Dimension

    type Dimension

    int

    param FirstParameter

    type FirstParameter

    float

    param LastParameter

    type LastParameter

    float

    param FirstOrder

    type FirstOrder

    int

    param LastOrder

    type LastOrder

    int

    param FirstConstr

    type FirstConstr

    TColStd_Array2OfReal

    param LastConstr

    type LastConstr

    TColStd_Array2OfReal

    param Coefficients

    type Coefficients

    TColStd_Array1OfReal

    rtype

    bool

static JacobiParameters()
  • Compute the number of points used for integral computations (NbGaussPoints) and the degree of Jacobi Polynomial (WorkDegree). ConstraintOrder has to be GeomAbs_C0, GeomAbs_C1 or GeomAbs_C2 Code: Code d’ init. des parametres de discretisation. = -5 = -4 = -3 = -2 = -1 = 1 calcul rapide avec precision moyenne. = 2 calcul rapide avec meilleure precision. = 3 calcul un peu plus lent avec bonne precision. = 4 calcul lent avec la meilleure precision possible.
    param ConstraintOrder

    type ConstraintOrder

    GeomAbs_Shape

    param MaxDegree

    type MaxDegree

    int

    param Code

    type Code

    int

    param NbGaussPoints

    type NbGaussPoints

    int

    param WorkDegree

    type WorkDegree

    int

    rtype

    void

static NivConstr()
  • translates from GeomAbs_Shape to Integer
    param ConstraintOrder

    type ConstraintOrder

    GeomAbs_Shape

    rtype

    int

static NoDerivativeEvalPolynomial()
  • Same as above with DerivativeOrder = 0;
    param U

    type U

    float

    param Degree

    type Degree

    int

    param Dimension

    type Dimension

    int

    param DegreeDimension

    type DegreeDimension

    int

    param PolynomialCoeff

    type PolynomialCoeff

    float

    param Results

    type Results

    float

    rtype

    void

static NoWeights()
  • Used as argument for a non rational functions
    rtype

    inline TColStd_Array1OfReal *

static NoWeights2()
  • Used as argument for a non rational functions
    rtype

    inline TColStd_Array2OfReal *

static RationalDerivative()
  • Computes the derivatives of a ratio at order <N> in dimension <Dimension>. //! <Ders> is an array containing the values of the input derivatives from 0 to Min(<N>,<Degree>). For orders higher than <Degree> the inputcd /s2d1/BMDL/ derivatives are assumed to be 0. //! Content of <Ders>//! x(1),x(2),…,x(Dimension),w x’(1),x’(2),…,x’(Dimension),w’ x’’(1),x’’(2),…,x’’(Dimension),w’’ //! If <All> is false, only the derivative at order <N> is computed. <RDers> is an array of length Dimension which will contain the result//! x(1)/w , x(2)/w , … derivated <N> times //! If <All> is true all the derivatives up to order <N> are computed. <RDers> is an array of length Dimension * (N+1) which will contains//! x(1)/w , x(2)/w , … x(1)/w , x(2)/w , … derivated <1> times x(1)/w , x(2)/w , … derivated <2> times … x(1)/w , x(2)/w , … derivated <N> times //! Warning: <RDers> must be dimensionned properly.
    param Degree

    type Degree

    int

    param N

    type N

    int

    param Dimension

    type Dimension

    int

    param Ders

    type Ders

    float

    param RDers

    type RDers

    float

    param All

    default value is Standard_True

    type All

    bool

    rtype

    void

static RationalDerivatives()
  • Computes DerivativesRequest derivatives of a ratio at of a BSpline function of degree <Degree> dimension <Dimension>. //! <PolesDerivatives> is an array containing the values of the input derivatives from 0 to <DerivativeRequest> For orders higher than <Degree> the input derivatives are assumed to be 0. //! Content of <PoleasDerivatives>//! x(1),x(2),…,x(Dimension) x’(1),x’(2),…,x’(Dimension) x’’(1),x’’(2),…,x’’(Dimension) //! WeightsDerivatives is an array that contains derivatives from 0 to <DerivativeRequest> After returning from the routine the array RationalDerivatives contains the following x(1)/w , x(2)/w , … x(1)/w , x(2)/w , … derivated once x(1)/w , x(2)/w , … twice x(1)/w , x(2)/w , … derivated <DerivativeRequest> times //! The array RationalDerivatives and PolesDerivatives can be same since the overwrite is non destructive within the algorithm //! Warning: <RationalDerivates> must be dimensionned properly.
    param DerivativesRequest

    type DerivativesRequest

    int

    param Dimension

    type Dimension

    int

    param PolesDerivatives

    type PolesDerivatives

    float

    param WeightsDerivatives

    type WeightsDerivatives

    float

    param RationalDerivates

    type RationalDerivates

    float

    rtype

    void

static SetPoles()
  • Copy in FP the coordinates of the poles.
    param Poles

    type Poles

    TColgp_Array1OfPnt

    param FP

    type FP

    TColStd_Array1OfReal

    rtype

    void* Copy in FP the coordinates of the poles.

    param Poles

    type Poles

    TColgp_Array1OfPnt

    param Weights

    type Weights

    TColStd_Array1OfReal

    param FP

    type FP

    TColStd_Array1OfReal

    rtype

    void* Copy in FP the coordinates of the poles.

    param Poles

    type Poles

    TColgp_Array1OfPnt2d

    param FP

    type FP

    TColStd_Array1OfReal

    rtype

    void* Copy in FP the coordinates of the poles.

    param Poles

    type Poles

    TColgp_Array1OfPnt2d

    param Weights

    type Weights

    TColStd_Array1OfReal

    param FP

    type FP

    TColStd_Array1OfReal

    rtype

    void

static Trimming()
Parameters

U1

type U1

float

param U2

type U2

float

param Coeffs

type Coeffs

TColgp_Array1OfPnt

param WCoeffs

type WCoeffs

TColStd_Array1OfReal *

rtype

void:param U1:

type U1

float

param U2

type U2

float

param Coeffs

type Coeffs

TColgp_Array1OfPnt2d

param WCoeffs

type WCoeffs

TColStd_Array1OfReal *

rtype

void:param U1:

type U1

float

param U2

type U2

float

param Coeffs

type Coeffs

TColStd_Array1OfReal

param WCoeffs

type WCoeffs

TColStd_Array1OfReal *

rtype

void:param U1:

type U1

float

param U2

type U2

float

param dim

type dim

int

param Coeffs

type Coeffs

TColStd_Array1OfReal

param WCoeffs

type WCoeffs

TColStd_Array1OfReal *

rtype

void

static UTrimming()
Parameters

U1

type U1

float

param U2

type U2

float

param Coeffs

type Coeffs

TColgp_Array2OfPnt

param WCoeffs

type WCoeffs

TColStd_Array2OfReal *

rtype

void

static VTrimming()
Parameters

V1

type V1

float

param V2

type V2

float

param Coeffs

type Coeffs

TColgp_Array2OfPnt

param WCoeffs

type WCoeffs

TColStd_Array2OfReal *

rtype

void

property thisown

The membership flag