OCC.Core.GeomLib module

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

class GeomLib_Array1OfMat(*args)

Bases: object

Assign()
ChangeFirst()
ChangeLast()
ChangeValue()
First()
Init()
IsAllocated()
IsDeletable()
IsEmpty()
Last()
Length()
Lower()
Move()
Resize()
Set()
SetValue()
Size()
Upper()
Value()
begin()
cbegin()
cend()
end()
next()
property thisown

The membership flag

class GeomLib_Check2dBSplineCurve(*args)

Bases: object

Parameters

Curve

type Curve

Geom2d_BSplineCurve

param Tolerance

type Tolerance

float

param AngularTolerance

type AngularTolerance

float

rtype

None

FixTangent()
Parameters

FirstFlag

type FirstFlag

bool

param LastFlag

type LastFlag

bool

rtype

None

FixedTangent()
  • modifies the curve by fixing the first or the last tangencies //! if Index3D not in the Range [1,Nb3dSpaces] if the Approx is not Done
    param FirstFlag

    type FirstFlag

    bool

    param LastFlag

    type LastFlag

    bool

    rtype

    opencascade::handle<Geom2d_BSplineCurve>

IsDone()
Return type

bool

NeedTangentFix()
Parameters

FirstFlag

type FirstFlag

bool

param SecondFlag

type SecondFlag

bool

rtype

None

property thisown

The membership flag

class GeomLib_CheckBSplineCurve(*args)

Bases: object

Parameters

Curve

type Curve

Geom_BSplineCurve

param Tolerance

type Tolerance

float

param AngularTolerance

type AngularTolerance

float

rtype

None

FixTangent()
Parameters

FirstFlag

type FirstFlag

bool

param LastFlag

type LastFlag

bool

rtype

None

FixedTangent()
  • modifies the curve by fixing the first or the last tangencies //! if Index3D not in the Range [1,Nb3dSpaces] if the Approx is not Done
    param FirstFlag

    type FirstFlag

    bool

    param LastFlag

    type LastFlag

    bool

    rtype

    opencascade::handle<Geom_BSplineCurve>

IsDone()
Return type

bool

NeedTangentFix()
Parameters

FirstFlag

type FirstFlag

bool

param SecondFlag

type SecondFlag

bool

rtype

None

property thisown

The membership flag

class GeomLib_CheckCurveOnSurface(*args)

Bases: object

  • Default contructor

    :param : :type : void :rtype: None* Contructor :param theCurve: :type theCurve: Geom_Curve :param theSurface: :type theSurface: Geom_Surface :param theFirst: :type theFirst: float :param theLast: :type theLast: float :param theTolRange: default value is Precision::Confusion() :type theTolRange: float :rtype: None

Curve()
  • Returns my3DCurve
    rtype

    opencascade::handle<Geom_Curve>

ErrorStatus()
  • Returns error status The possible values are: 0 - OK; 1 - null curve or surface or 2d curve; 2 - invalid parametric range; 3 - error in calculations.
    rtype

    int

Init()
  • Sets the data for the algorithm
    param theCurve

    type theCurve

    Geom_Curve

    param theSurface

    type theSurface

    Geom_Surface

    param theFirst

    type theFirst

    float

    param theLast

    type theLast

    float

    param theTolRange

    default value is Precision::Confusion()

    type theTolRange

    float

    rtype

    None* Initializes all members by dafault values

    rtype

    None

IsDone()
  • Returns true if the max distance has been found
    rtype

    bool

MaxDistance()
  • Returns max distance
    rtype

    float

MaxParameter()
  • Returns parameter in which the distance is maximal
    rtype

    float

Perform()
  • Computes the max distance for the 3d curve <myCurve> and 2d curve <thePCurve> If isTheMultyTheadDisabled == True then computation will be made without any parallelization.
    param thePCurve

    type thePCurve

    Geom2d_Curve

    param isTheMultyTheradDisabled

    default value is Standard_False

    type isTheMultyTheradDisabled

    bool

    rtype

    None

Range()
  • Returns first and last parameter of the curves (2D- and 3D-curves are considered to have same range)
    param theFirst

    type theFirst

    float

    param theLast

    type theLast

    float

    rtype

    None

Surface()
  • Returns mySurface
    rtype

    opencascade::handle<Geom_Surface>

property thisown

The membership flag

class GeomLib_DenominatorMultiplier(*args)

Bases: object

  • if the surface is rational this will define the evaluator of a real function of 2 variables a(u,v) such that if we define a new surface bya(u,v) * N(u,v) NewF(u,v) = —————- a(u,v) * D(u,v)
    param Surface

    type Surface

    Geom_BSplineSurface

    param KnotVector

    type KnotVector

    TColStd_Array1OfReal

    rtype

    None

Value()
  • Returns the value of a(UParameter,VParameter)= //! H0(UParameter)/Denominator(Umin,Vparameter) //! D Denominator(Umin,Vparameter) - ——————————[H1(u)]/(Denominator(Umin,Vparameter)^2) D U //! + H3(UParameter)/Denominator(Umax,Vparameter) //! D Denominator(Umax,Vparameter) - ——————————[H2(u)]/(Denominator(Umax,Vparameter)^2) D U
    param UParameter

    type UParameter

    float

    param VParameter

    type VParameter

    float

    rtype

    float

property thisown

The membership flag

class GeomLib_Interpolate(*args)

Bases: object

Parameters

Degree

type Degree

int

param NumPoints

type NumPoints

int

param Points

type Points

TColgp_Array1OfPnt

param Parameters

type Parameters

TColStd_Array1OfReal

rtype

None

Curve()
  • returns the interpolated curve of the requested degree
    rtype

    opencascade::handle<Geom_BSplineCurve>

Error()
  • returns the error type if any
    rtype

    GeomLib_InterpolationErrors

IsDone()
  • returns if everything went OK
    rtype

    bool

property thisown

The membership flag

class GeomLib_IsPlanarSurface(*args)

Bases: object

Parameters

S

type S

Geom_Surface

param Tol

default value is 1.0e-7

type Tol

float

rtype

None

IsPlanar()
  • Return if the Surface is a plan
    rtype

    bool

Plan()
  • Return the plan definition
    rtype

    gp_Pln

property thisown

The membership flag

class GeomLib_LogSample(*args)

Bases: OCC.Core.math.math_FunctionSample

Parameters

A

type A

float

param B

type B

float

param N

type N

int

rtype

None

property thisown

The membership flag

class GeomLib_MakeCurvefromApprox(*args)

Bases: object

Parameters

Approx

type Approx

AdvApprox_ApproxAFunction

rtype

None

Curve()
  • returns a polynomial curve whose poles correspond to the Index3D 3D space if Index3D not in the Range [1,Nb3dSpaces] if the Approx is not Done
    param Index3d

    type Index3d

    int

    rtype

    opencascade::handle<Geom_BSplineCurve>* returns a rational curve whose poles correspond to the index3D of the 3D space and whose weights correspond to the index1d 1D space. if Index1D not in the Range [1,Nb1dSpaces] if Index3D not in the Range [1,Nb3dSpaces] if the Approx is not Done

    param Index1D

    type Index1D

    int

    param Index3D

    type Index3D

    int

    rtype

    opencascade::handle<Geom_BSplineCurve>

Curve2d()
  • returns a polynomial curve whose poles correspond to the Index2d 2D space if Index2d not in the Range [1,Nb2dSpaces] if the Approx is not Done
    param Index2d

    type Index2d

    int

    rtype

    opencascade::handle<Geom2d_BSplineCurve>* returns a rational curve whose poles correspond to the index2d of the 2D space and whose weights correspond to one dimensional space of index 1d if Index1d not in the Range [1,Nb1dSpaces] if Index2d not in the Range [1,Nb2dSpaces] if the Approx is not Done

    param Index1d

    type Index1d

    int

    param Index2d

    type Index2d

    int

    rtype

    opencascade::handle<Geom2d_BSplineCurve>

Curve2dFromTwo1d()
  • returns a 2D curve building it from the 1D curve in x at Index1d and y at Index2d amongst the 1D curves if Index1d not in the Range [1,Nb1dSpaces] if Index2d not in the Range [1,Nb1dSpaces] if the Approx is not Done
    param Index1d

    type Index1d

    int

    param Index2d

    type Index2d

    int

    rtype

    opencascade::handle<Geom2d_BSplineCurve>

IsDone()
Return type

bool

Nb1DSpaces()
  • returns the number of 1D spaces of the Approx
    rtype

    int

Nb2DSpaces()
  • returns the number of 3D spaces of the Approx
    rtype

    int

Nb3DSpaces()
  • returns the number of 3D spaces of the Approx
    rtype

    int

property thisown

The membership flag

class GeomLib_PolyFunc(*args)

Bases: OCC.Core.math.math_FunctionWithDerivative

Parameters

Coeffs

type Coeffs

math_Vector

rtype

None

property thisown

The membership flag

class GeomLib_Tool

Bases: object

static Parameter()
  • Extracts the parameter of a 3D point lying on a 3D curve or at a distance less than the MaxDist value.
    param Curve

    type Curve

    Geom_Curve

    param Point

    type Point

    gp_Pnt

    param MaxDist

    type MaxDist

    float

    param U

    type U

    float

    rtype

    bool* Extracts the parameter of a 2D point lying on a 2D curve or at a distance less than the MaxDist value.

    param Curve

    type Curve

    Geom2d_Curve

    param Point

    type Point

    gp_Pnt2d

    param MaxDist

    type MaxDist

    float

    param U

    type U

    float

    rtype

    bool

static Parameters()
  • Extracts the parameter of a 3D point lying on a surface or at a distance less than the MaxDist value.
    param Surface

    type Surface

    Geom_Surface

    param Point

    type Point

    gp_Pnt

    param MaxDist

    type MaxDist

    float

    param U

    type U

    float

    param V

    type V

    float

    rtype

    bool

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 geomlib

Bases: object

static AdjustExtremity()
Parameters

Curve

type Curve

Geom_BoundedCurve

param P1

type P1

gp_Pnt

param P2

type P2

gp_Pnt

param T1

type T1

gp_Vec

param T2

type T2

gp_Vec

rtype

void

static AxeOfInertia()
  • Compute axes of inertia, of some points – – – <Axe>.Location() is the BaryCentre – – – – – <Axe>.XDirection is the axe of upper inertia – – – – <Axe>.Direction is the Normal to the average plane – – – IsSingular is True if points are on line – Tol is used to determine singular cases.
    param Points

    type Points

    TColgp_Array1OfPnt

    param Axe

    type Axe

    gp_Ax2

    param IsSingular

    type IsSingular

    bool

    param Tol

    default value is 1.0e-7

    type Tol

    float

    rtype

    void

static BuildCurve3d()
Parameters

Tolerance

type Tolerance

float

param CurvePtr

type CurvePtr

Adaptor3d_CurveOnSurface

param FirstParameter

type FirstParameter

float

param LastParameter

type LastParameter

float

param NewCurvePtr

type NewCurvePtr

Geom_Curve

param MaxDeviation

type MaxDeviation

float

param AverageDeviation

type AverageDeviation

float

param Continuity

default value is GeomAbs_C1

type Continuity

GeomAbs_Shape

param MaxDegree

default value is 14

type MaxDegree

int

param MaxSegment

default value is 30

type MaxSegment

int

rtype

void

static CancelDenominatorDerivative()
  • Cancel,on the boudaries,the denominator first derivative in the directions wished by the user and set its value to 1.
    param BSurf

    type BSurf

    Geom_BSplineSurface

    param UDirection

    type UDirection

    bool

    param VDirection

    type VDirection

    bool

    rtype

    void

static DensifyArray1OfReal()
  • this makes sure that there is at least MinNumPoints in OutParameters taking into account the parameters in the InParameters array provided those are in order, that is the sequence of real in the InParameter is strictly non decreasing
    param MinNumPoints

    type MinNumPoints

    int

    param InParameters

    type InParameters

    TColStd_Array1OfReal

    param OutParameters

    type OutParameters

    TColStd_HArray1OfReal

    rtype

    void

static EvalMaxDistanceAlongParameter()
  • this will compute the maximum distancef at the parameters given in the Parameters array by projecting from the Curve to the reference curve and taking the minimum distance Than the maximum will be taken on those minimas.
    param Curve

    type Curve

    Adaptor3d_Curve

    param AReferenceCurve

    type AReferenceCurve

    Adaptor3d_Curve

    param Tolerance

    type Tolerance

    float

    param Parameters

    type Parameters

    TColStd_Array1OfReal

    param MaxDistance

    type MaxDistance

    float

    rtype

    void

static EvalMaxParametricDistance()
  • this will compute the maximum distance at the parameters given in the Parameters array by evaluating each parameter the two curves and taking the maximum of the evaluated distance
    param Curve

    type Curve

    Adaptor3d_Curve

    param AReferenceCurve

    type AReferenceCurve

    Adaptor3d_Curve

    param Tolerance

    type Tolerance

    float

    param Parameters

    type Parameters

    TColStd_Array1OfReal

    param MaxDistance

    type MaxDistance

    float

    rtype

    void

static ExtendCurveToPoint()
  • Extends the bounded curve Curve to the point Point. The extension is built: - at the end of the curve if After equals true, or - at the beginning of the curve if After equals false. The extension is performed according to a degree of continuity equal to Cont, which in its turn must be equal to 1, 2 or 3. This function converts the bounded curve Curve into a BSpline curve. Warning - Nothing is done, and Curve is not modified if Cont is not equal to 1, 2 or 3. - It is recommended that the extension should not be too large with respect to the size of the bounded curve Curve: Point must not be located too far from one of the extremities of Curve.
    param Curve

    type Curve

    Geom_BoundedCurve

    param Point

    type Point

    gp_Pnt

    param Cont

    type Cont

    int

    param After

    type After

    bool

    rtype

    void

static ExtendSurfByLength()
  • Extends the bounded surface Surf along one of its boundaries. The chord length of the extension is equal to Length. The direction of the extension is given as: - the u parametric direction of Surf, if InU equals true, or - the v parametric direction of Surf, if InU equals false. In this parametric direction, the extension is built on the side of: - the last parameter of Surf, if After equals true, or - the first parameter of Surf, if After equals false. The extension is performed according to a degree of continuity equal to Cont, which in its turn must be equal to 1, 2 or 3. This function converts the bounded surface Surf into a BSpline surface. Warning - Nothing is done, and Surf is not modified if Cont is not equal to 1, 2 or 3. - It is recommended that Length, the size of the extension should not be too large with respect to the size of the bounded surface Surf. - Surf must not be a periodic BSpline surface in the parametric direction corresponding to the direction of extension.
    param Surf

    type Surf

    Geom_BoundedSurface

    param Length

    type Length

    float

    param Cont

    type Cont

    int

    param InU

    type InU

    bool

    param After

    type After

    bool

    rtype

    void

static FuseIntervals()
Parameters

Interval1

type Interval1

TColStd_Array1OfReal

param Interval2

type Interval2

TColStd_Array1OfReal

param Fusion

type Fusion

TColStd_SequenceOfReal

param Confusion

default value is 1.0e-9

type Confusion

float

rtype

void

static GTransform()
  • Computes the curve 3d from package Geom corresponding to the curve 3d from package Geom, transformed with the transformation <GTrsf> WARNINGthis method may return a null Handle if it’s impossible to compute the transformation of a curve. It’s not implemented when1) the curve is an infinite parabola or hyperbola 2) the curve is an offsetcurve
    param Curve

    type Curve

    Geom2d_Curve

    param GTrsf

    type GTrsf

    gp_GTrsf2d

    rtype

    opencascade::handle<Geom2d_Curve>

static Inertia()
  • Compute principale axes of inertia, and dispertion value of some points.
    param Points

    type Points

    TColgp_Array1OfPnt

    param Bary

    type Bary

    gp_Pnt

    param XDir

    type XDir

    gp_Dir

    param YDir

    type YDir

    gp_Dir

    param Xgap

    type Xgap

    float

    param YGap

    type YGap

    float

    param ZGap

    type ZGap

    float

    rtype

    void

static IsBSplUClosed()
  • Returns true if the poles of U1 isoline and the poles of U2 isoline of surface are identical according to tolerance criterion. For rational surfaces Weights(i)*Poles(i) are checked.
    param S

    type S

    Geom_BSplineSurface

    param U1

    type U1

    float

    param U2

    type U2

    float

    param Tol

    type Tol

    float

    rtype

    bool

static IsBSplVClosed()
  • Returns true if the poles of V1 isoline and the poles of V2 isoline of surface are identical according to tolerance criterion. For rational surfaces Weights(i)*Poles(i) are checked.
    param S

    type S

    Geom_BSplineSurface

    param V1

    type V1

    float

    param V2

    type V2

    float

    param Tol

    type Tol

    float

    rtype

    bool

static IsBzUClosed()
  • Returns true if the poles of U1 isoline and the poles of U2 isoline of surface are identical according to tolerance criterion.
    param S

    type S

    Geom_BezierSurface

    param U1

    type U1

    float

    param U2

    type U2

    float

    param Tol

    type Tol

    float

    rtype

    bool

static IsBzVClosed()
  • Returns true if the poles of V1 isoline and the poles of V2 isoline of surface are identical according to tolerance criterion.
    param S

    type S

    Geom_BezierSurface

    param V1

    type V1

    float

    param V2

    type V2

    float

    param Tol

    type Tol

    float

    rtype

    bool

static IsClosed()
  • This method defines if opposite boundaries of surface coincide with given tolerance
    param S

    type S

    Geom_Surface

    param Tol

    type Tol

    float

    param isUClosed

    type isUClosed

    bool

    param isVClosed

    type isVClosed

    bool

    rtype

    void

static NormEstim()
Parameters

S

type S

Geom_Surface

param UV

type UV

gp_Pnt2d

param Tol

type Tol

float

param N

type N

gp_Dir

rtype

int

static RemovePointsFromArray()
  • Warning! This assume that the InParameter is an increasing sequence of real number and it will not check for thatUnpredictable result can happen if this is not satisfied. It is the caller responsability to check for that property. //! This method makes uniform NumPoints segments S1,…SNumPoints out of the segment defined by the first parameter and the last parameter ofthe InParameter ; keeps only one point of the InParameters set of parameter in each of the uniform segments taking care of the first and the last parameters. For the ith segment the element of the InParameter is the one that is the first to exceed the midpoint of the segment and to fall before the midpoint of the next segment There will be at the end at most NumPoints + 1 if NumPoints > 2 in the OutParameters Array
    param NumPoints

    type NumPoints

    int

    param InParameters

    type InParameters

    TColStd_Array1OfReal

    param OutParameters

    type OutParameters

    TColStd_HArray1OfReal

    rtype

    void

static SameRange()
  • Make the curve Curve2dPtr have the imposed range First to List the most economic way, that is if it can change the range without changing the nature of the curve it will try to do that. Otherwise it will produce a Bspline curve that has the required range
    param Tolerance

    type Tolerance

    float

    param Curve2dPtr

    type Curve2dPtr

    Geom2d_Curve

    param First

    type First

    float

    param Last

    type Last

    float

    param RequestedFirst

    type RequestedFirst

    float

    param RequestedLast

    type RequestedLast

    float

    param NewCurve2dPtr

    type NewCurve2dPtr

    Geom2d_Curve

    rtype

    void

static To3d()
  • Computes the curve 3d from package Geom corresponding to curve 2d from package Geom2d, on the plan defined with the local coordinate system Position.
    param Position

    type Position

    gp_Ax2

    param Curve2d

    type Curve2d

    Geom2d_Curve

    rtype

    opencascade::handle<Geom_Curve>

property thisown

The membership flag