OCC.Core.Geom2d module

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

class Geom2d_AxisPlacement(*args)

Bases: OCC.Core.Geom2d.Geom2d_Geometry

  • Constructs an axis by conversion of the gp_Ax2d axis A.
    param A

    type A

    gp_Ax2d

    rtype

    None* Constructs an axis from a given origin P and unit vector V.

    param P

    type P

    gp_Pnt2d

    param V

    type V

    gp_Dir2d

    rtype

    None

Angle()
  • Computes the angle between the ‘Direction’ of two axis placement in radians. The result is comprised between -Pi and Pi.
    param Other

    type Other

    Geom2d_AxisPlacement

    rtype

    float

Ax2d()
  • Converts this axis into a gp_Ax2d axis.
    rtype

    gp_Ax2d

Direction()
  • Returns the ‘Direction’ of <self>. -C++: return const&
    rtype

    gp_Dir2d

static DownCast(t)
Location()
  • Returns the ‘Location’ point (origin) of the axis placement. -C++: return const&
    rtype

    gp_Pnt2d

Reverse()
Return type

None

Reversed()
  • Reverses the unit vector of this axis. Note: - Reverse assigns the result to this axis, while - Reversed creates a new one.
    rtype

    opencascade::handle<Geom2d_AxisPlacement>

SetAxis()
  • Changes the complete definition of the axis placement.
    param A

    type A

    gp_Ax2d

    rtype

    None

SetDirection()
  • Changes the ‘Direction’ of the axis placement.
    param V

    type V

    gp_Dir2d

    rtype

    None

SetLocation()
  • Changes the ‘Location’ point (origin) of the axis placement.
    param P

    type P

    gp_Pnt2d

    rtype

    None

property thisown

The membership flag

class Geom2d_BSplineCurve(*args)

Bases: OCC.Core.Geom2d.Geom2d_BoundedCurve

  • Creates a non-rational B_spline curve on the basis <Knots, Multiplicities> of degree <Degree>. The following conditions must be verified. 0 < Degree <= MaxDegree. //! Knots.Length() == Mults.Length() >= 2 //! Knots(i) < Knots(i+1) (Knots are increasing) //! 1 <= Mults(i) <= Degree //! On a non periodic curve the first and last multiplicities may be Degree+1 (this is even recommanded if you want the curve to start and finish on the first and last pole). //! On a periodic curve the first and the last multicities must be the same. //! on non-periodic curves //! Poles.Length() == Sum(Mults(i)) - Degree - 1 >= 2 //! on periodic curves //! Poles.Length() == Sum(Mults(i)) except the first or last
    param Poles

    type Poles

    TColgp_Array1OfPnt2d

    param Knots

    type Knots

    TColStd_Array1OfReal

    param Multiplicities

    type Multiplicities

    TColStd_Array1OfInteger

    param Degree

    type Degree

    int

    param Periodic

    default value is Standard_False

    type Periodic

    bool

    rtype

    None* Creates a rational B_spline curve on the basis <Knots, Multiplicities> of degree <Degree>. The following conditions must be verified. 0 < Degree <= MaxDegree. //! Knots.Length() == Mults.Length() >= 2 //! Knots(i) < Knots(i+1) (Knots are increasing) //! 1 <= Mults(i) <= Degree //! On a non periodic curve the first and last multiplicities may be Degree+1 (this is even recommanded if you want the curve to start and finish on the first and last pole). //! On a periodic curve the first and the last multicities must be the same. //! on non-periodic curves //! Poles.Length() == Sum(Mults(i)) - Degree - 1 >= 2 //! on periodic curves //! Poles.Length() == Sum(Mults(i)) except the first or last

    param Poles

    type Poles

    TColgp_Array1OfPnt2d

    param Weights

    type Weights

    TColStd_Array1OfReal

    param Knots

    type Knots

    TColStd_Array1OfReal

    param Multiplicities

    type Multiplicities

    TColStd_Array1OfInteger

    param Degree

    type Degree

    int

    param Periodic

    default value is Standard_False

    type Periodic

    bool

    rtype

    None

Degree()
  • Returns the degree of this BSpline curve. In this class the degree of the basis normalized B-spline functions cannot be greater than ‘MaxDegree’ Computation of value and derivatives
    rtype

    int

static DownCast(t)
FirstUKnotIndex()
  • For a B-spline curve the first parameter (which gives the start point of the curve) is a knot value but if the multiplicity of the first knot index is lower than Degree + 1 it is not the first knot of the curve. This method computes the index of the knot corresponding to the first parameter.
    rtype

    int

IncreaseDegree()
  • Increases the degree of this BSpline curve to Degree. As a result, the poles, weights and multiplicities tables are modified; the knots table is not changed. Nothing is done if Degree is less than or equal to the current degree. Exceptions Standard_ConstructionError if Degree is greater than Geom2d_BSplineCurve::MaxDegree().
    param Degree

    type Degree

    int

    rtype

    None

IncreaseMultiplicity()
  • Increases the multiplicity of the knot <Index> to <M>. //! If <M> is lower or equal to the current multiplicity nothing is done. If <M> is higher than the degree the degree is used. If <Index> is not in [FirstUKnotIndex, LastUKnotIndex]
    param Index

    type Index

    int

    param M

    type M

    int

    rtype

    None* Increases the multiplicities of the knots in [I1,I2] to <M>. //! For each knot if <M> is lower or equal to the current multiplicity nothing is done. If <M> is higher than the degree the degree is used. As a result, the poles and weights tables of this curve are modified. Warning It is forbidden to modify the multiplicity of the first or last knot of a non-periodic curve. Be careful as Geom2d does not protect against this. Exceptions Standard_OutOfRange if either Index, I1 or I2 is outside the bounds of the knots table.

    param I1

    type I1

    int

    param I2

    type I2

    int

    param M

    type M

    int

    rtype

    None

IncrementMultiplicity()
  • Increases by M the multiplicity of the knots of indexes I1 to I2 in the knots table of this BSpline curve. For each knot, the resulting multiplicity is limited to the degree of this curve. If M is negative, nothing is done. As a result, the poles and weights tables of this BSpline curve are modified. Warning It is forbidden to modify the multiplicity of the first or last knot of a non-periodic curve. Be careful as Geom2d does not protect against this. Exceptions Standard_OutOfRange if I1 or I2 is outside the bounds of the knots table.
    param I1

    type I1

    int

    param I2

    type I2

    int

    param M

    type M

    int

    rtype

    None

InsertKnot()
  • Inserts a knot value in the sequence of knots. If <U> is an existing knot the multiplicity is increased by <M>. //! If U is not on the parameter range nothing is done. //! If the multiplicity is negative or null nothing is done. The new multiplicity is limited to the degree. //! The tolerance criterion for knots equality is the max of Epsilon(U) and ParametricTolerance. Warning - If U is less than the first parameter or greater than the last parameter of this BSpline curve, nothing is done. - If M is negative or null, nothing is done. - The multiplicity of a knot is limited to the degree of this BSpline curve.
    param U

    type U

    float

    param M

    default value is 1

    type M

    int

    param ParametricTolerance

    default value is 0.0

    type ParametricTolerance

    float

    rtype

    None

InsertKnots()
  • Inserts the values of the array Knots, with the respective multiplicities given by the array Mults, into the knots table of this BSpline curve. If a value of the array Knots is an existing knot, its multiplicity is: - increased by M, if Add is true, or - increased to M, if Add is false (default value). The tolerance criterion used for knot equality is the larger of the values ParametricTolerance (defaulted to 0.) and Standard_Real::Epsilon(U), where U is the current knot value. Warning - For a value of the array Knots which is less than the first parameter or greater than the last parameter of this BSpline curve, nothing is done. - For a value of the array Mults which is negative or null, nothing is done. - The multiplicity of a knot is limited to the degree of this BSpline curve.
    param Knots

    type Knots

    TColStd_Array1OfReal

    param Mults

    type Mults

    TColStd_Array1OfInteger

    param ParametricTolerance

    default value is 0.0

    type ParametricTolerance

    float

    param Add

    default value is Standard_False

    type Add

    bool

    rtype

    None

InsertPoleAfter()
  • The new pole is inserted after the pole of range Index. If the curve was non rational it can become rational. //! Raised if the B-spline is NonUniform or PiecewiseBezier or if Weight <= 0.0 Raised if Index is not in the range [1, Number of Poles]
    param Index

    type Index

    int

    param P

    type P

    gp_Pnt2d

    param Weight

    default value is 1.0

    type Weight

    float

    rtype

    None

InsertPoleBefore()
  • The new pole is inserted before the pole of range Index. If the curve was non rational it can become rational. //! Raised if the B-spline is NonUniform or PiecewiseBezier or if Weight <= 0.0 Raised if Index is not in the range [1, Number of Poles]
    param Index

    type Index

    int

    param P

    type P

    gp_Pnt2d

    param Weight

    default value is 1.0

    type Weight

    float

    rtype

    None

IsG1()
  • Check if curve has at least G1 continuity in interval [theTf, theTl] Returns true if IsCN(1) or angle betweem ‘left’ and ‘right’ first derivatives at knots with C0 continuity is less then theAngTol only knots in interval [theTf, theTl] is checked
    param theTf

    type theTf

    float

    param theTl

    type theTl

    float

    param theAngTol

    type theAngTol

    float

    rtype

    bool

IsRational()
  • Returns True if the weights are not identical. The tolerance criterion is Epsilon of the class Real.
    rtype

    bool

Knot()
  • Returns the knot of range Index. When there is a knot with a multiplicity greater than 1 the knot is not repeated. The method Multiplicity can be used to get the multiplicity of the Knot. Raised if Index < 1 or Index > NbKnots
    param Index

    type Index

    int

    rtype

    float

KnotDistribution()
  • Returns NonUniform or Uniform or QuasiUniform or PiecewiseBezier. If all the knots differ by a positive constant from the preceding knot the BSpline Curve can be- Uniform if all the knots are of multiplicity 1, - QuasiUniform if all the knots are of multiplicity 1 except for the first and last knot which are of multiplicity Degree + 1, - PiecewiseBezier if the first and last knots have multiplicity Degree + 1 and if interior knots have multiplicity Degree A piecewise Bezier with only two knots is a BezierCurve. else the curve is non uniform. The tolerance criterion is Epsilon from class Real.
    rtype

    GeomAbs_BSplKnotDistribution

KnotSequence()
  • Returns the knots sequence. In this sequence the knots with a multiplicity greater than 1 are repeated. ExampleK = {k1, k1, k1, k2, k3, k3, k4, k4, k4} //! Raised if K.Lower() is less than number of first knot in knot sequence with repetitions or K.Upper() is more than number of last knot in knot sequence with repetitions.
    param K

    type K

    TColStd_Array1OfReal

    rtype

    None* Returns the knots sequence. In this sequence the knots with a multiplicity greater than 1 are repeated. Example : K = {k1, k1, k1, k2, k3, k3, k4, k4, k4}

    rtype

    TColStd_Array1OfReal

Knots()
  • returns the knot values of the B-spline curve; //! Raised K.Lower() is less than number of first knot or K.Upper() is more than number of last knot.
    param K

    type K

    TColStd_Array1OfReal

    rtype

    None* returns the knot values of the B-spline curve;

    rtype

    TColStd_Array1OfReal

LastUKnotIndex()
  • For a BSpline curve the last parameter (which gives the end point of the curve) is a knot value but if the multiplicity of the last knot index is lower than Degree + 1 it is not the last knot of the curve. This method computes the index of the knot corresponding to the last parameter.
    rtype

    int

LocalD0()
  • Raised if FromK1 = ToK2.
    param U

    type U

    float

    param FromK1

    type FromK1

    int

    param ToK2

    type ToK2

    int

    param P

    type P

    gp_Pnt2d

    rtype

    None

LocalD1()
  • Raised if the local continuity of the curve is not C1 between the knot K1 and the knot K2. Raised if FromK1 = ToK2.
    param U

    type U

    float

    param FromK1

    type FromK1

    int

    param ToK2

    type ToK2

    int

    param P

    type P

    gp_Pnt2d

    param V1

    type V1

    gp_Vec2d

    rtype

    None

LocalD2()
  • Raised if the local continuity of the curve is not C2 between the knot K1 and the knot K2. Raised if FromK1 = ToK2.
    param U

    type U

    float

    param FromK1

    type FromK1

    int

    param ToK2

    type ToK2

    int

    param P

    type P

    gp_Pnt2d

    param V1

    type V1

    gp_Vec2d

    param V2

    type V2

    gp_Vec2d

    rtype

    None

LocalD3()
  • Raised if the local continuity of the curve is not C3 between the knot K1 and the knot K2. Raised if FromK1 = ToK2.
    param U

    type U

    float

    param FromK1

    type FromK1

    int

    param ToK2

    type ToK2

    int

    param P

    type P

    gp_Pnt2d

    param V1

    type V1

    gp_Vec2d

    param V2

    type V2

    gp_Vec2d

    param V3

    type V3

    gp_Vec2d

    rtype

    None

LocalDN()
  • Raised if the local continuity of the curve is not CN between the knot K1 and the knot K2. Raised if FromK1 = ToK2. Raised if N < 1.
    param U

    type U

    float

    param FromK1

    type FromK1

    int

    param ToK2

    type ToK2

    int

    param N

    type N

    int

    rtype

    gp_Vec2d

LocalValue()
  • Raised if FromK1 = ToK2.
    param U

    type U

    float

    param FromK1

    type FromK1

    int

    param ToK2

    type ToK2

    int

    rtype

    gp_Pnt2d

LocateU()
  • Locates the parametric value U in the sequence of knots. If ‘WithKnotRepetition’ is True we consider the knot’s representation with repetition of multiple knot value, otherwise we consider the knot’s representation with no repetition of multiple knot values. Knots (I1) <= U <= Knots (I2) . if I1 = I2 U is a knot value (the tolerance criterion ParametricTolerance is used). . if I1 < 1 => U < Knots (1) - Abs(ParametricTolerance) . if I2 > NbKnots => U > Knots (NbKnots) + Abs(ParametricTolerance)
    param U

    type U

    float

    param ParametricTolerance

    type ParametricTolerance

    float

    param I1

    type I1

    int

    param I2

    type I2

    int

    param WithKnotRepetition

    default value is Standard_False

    type WithKnotRepetition

    bool

    rtype

    None

static MaxDegree()
  • Returns the value of the maximum degree of the normalized B-spline basis functions in this package.
    rtype

    int

MovePoint()
  • Moves the point of parameter U of this BSpline curve to P. Index1 and Index2 are the indexes in the table of poles of this BSpline curve of the first and last poles designated to be moved. FirstModifiedPole and LastModifiedPole are the indexes of the first and last poles, which are effectively modified. In the event of incompatibility between Index1, Index2 and the value U: - no change is made to this BSpline curve, and - the FirstModifiedPole and LastModifiedPole are returned null. Exceptions Standard_OutOfRange if: - Index1 is greater than or equal to Index2, or - Index1 or Index2 is less than 1 or greater than the number of poles of this BSpline curve.
    param U

    type U

    float

    param P

    type P

    gp_Pnt2d

    param Index1

    type Index1

    int

    param Index2

    type Index2

    int

    param FirstModifiedPole

    type FirstModifiedPole

    int

    param LastModifiedPole

    type LastModifiedPole

    int

    rtype

    None

MovePointAndTangent()
  • Move a point with parameter U to P. and makes it tangent at U be Tangent. StartingCondition = -1 means first can move EndingCondition = -1 means last point can move StartingCondition = 0 means the first point cannot move EndingCondition = 0 means the last point cannot move StartingCondition = 1 means the first point and tangent cannot move EndingCondition = 1 means the last point and tangent cannot move and so forth ErrorStatus != 0 means that there are not enought degree of freedom with the constrain to deform the curve accordingly
    param U

    type U

    float

    param P

    type P

    gp_Pnt2d

    param Tangent

    type Tangent

    gp_Vec2d

    param Tolerance

    type Tolerance

    float

    param StartingCondition

    type StartingCondition

    int

    param EndingCondition

    type EndingCondition

    int

    param ErrorStatus

    type ErrorStatus

    int

    rtype

    None

Multiplicities()
  • Returns the multiplicity of the knots of the curve. //! Raised if the length of M is not equal to NbKnots.
    param M

    type M

    TColStd_Array1OfInteger

    rtype

    None* returns the multiplicity of the knots of the curve.

    rtype

    TColStd_Array1OfInteger

Multiplicity()
  • Returns the multiplicity of the knots of range Index. Raised if Index < 1 or Index > NbKnots
    param Index

    type Index

    int

    rtype

    int

NbKnots()
  • Returns the number of knots. This method returns the number of knot without repetition of multiple knots.
    rtype

    int

NbPoles()
  • Returns the number of poles
    rtype

    int

PeriodicNormalization()
  • Computes the parameter normalized within the ‘first’ period of this BSpline curve, if it is periodic: the returned value is in the range Param1 and Param1 + Period, where: - Param1 is the ‘first parameter’, and - Period the period of this BSpline curve. Note: If this curve is not periodic, U is not modified.
    param U

    type U

    float

    rtype

    None

Pole()
  • Returns the pole of range Index. Raised if Index < 1 or Index > NbPoles.
    param Index

    type Index

    int

    rtype

    gp_Pnt2d

Poles()
  • Returns the poles of the B-spline curve; //! Raised if the length of P is not equal to the number of poles.
    param P

    type P

    TColgp_Array1OfPnt2d

    rtype

    None* Returns the poles of the B-spline curve;

    rtype

    TColgp_Array1OfPnt2d

RemoveKnot()
  • Reduces the multiplicity of the knot of index Index to M. If M is equal to 0, the knot is removed. With a modification of this type, the array of poles is also modified. Two different algorithms are systematically used to compute the new poles of the curve. If, for each pole, the distance between the pole calculated using the first algorithm and the same pole calculated using the second algorithm, is less than Tolerance, this ensures that the curve is not modified by more than Tolerance. Under these conditions, true is returned; otherwise, false is returned. A low tolerance is used to prevent modification of the curve. A high tolerance is used to ‘smooth’ the curve. Exceptions Standard_OutOfRange if Index is outside the bounds of the knots table.
    param Index

    type Index

    int

    param M

    type M

    int

    param Tolerance

    type Tolerance

    float

    rtype

    bool

RemovePole()
  • Removes the pole of range Index If the curve was rational it can become non rational. //! Raised if the B-spline is NonUniform or PiecewiseBezier. Raised if the number of poles of the B-spline curve is lower or equal to 2 before removing. Raised if Index is not in the range [1, Number of Poles]
    param Index

    type Index

    int

    rtype

    None

Resolution()
  • Computes for this BSpline curve the parametric tolerance UTolerance for a given tolerance Tolerance3D (relative to dimensions in the plane). If f(t) is the equation of this BSpline curve, UTolerance ensures that: | t1 - t0| < Utolerance ===> |f(t1) - f(t0)| < ToleranceUV
    param ToleranceUV

    type ToleranceUV

    float

    param UTolerance

    type UTolerance

    float

    rtype

    None

Segment()
  • Modifies this BSpline curve by segmenting it between U1 and U2. Either of these values can be outside the bounds of the curve, but U2 must be greater than U1. All data structure tables of this BSpline curve are modified, but the knots located between U1 and U2 are retained. The degree of the curve is not modified. //! Parameter theTolerance defines the possible proximity of the segment boundaries and B-spline knots to treat them as equal. //! WarningsEven if <self> is not closed it can become closed after the segmentation for example if U1 or U2 are out of the bounds of the curve <self> or if the curve makes loop. After the segmentation the length of a curve can be null. - The segmentation of a periodic curve over an interval corresponding to its period generates a non-periodic curve with equivalent geometry. Exceptions Standard_DomainError if U2 is less than U1. raises if U2 < U1. Standard_DomainError if U2 - U1 exceeds the period for periodic curves. i.e. ((U2 - U1) - Period) > Precision::PConfusion().
    param U1

    type U1

    float

    param U2

    type U2

    float

    param theTolerance

    default value is Precision::Confusion()

    type theTolerance

    float

    rtype

    None

SetKnot()
  • Modifies this BSpline curve by assigning the value K to the knot of index Index in the knots table. This is a relatively local modification because K must be such that: Knots(Index - 1) < K < Knots(Index + 1) Exceptions Standard_ConstructionError if: - K is not such that: Knots(Index - 1) < K < Knots(Index + 1) - M is greater than the degree of this BSpline curve or lower than the previous multiplicity of knot of index Index in the knots table. Standard_OutOfRange if Index is outside the bounds of the knots table.
    param Index

    type Index

    int

    param K

    type K

    float

    rtype

    None* Modifies this BSpline curve by assigning the value K to the knot of index Index in the knots table. This is a relatively local modification because K must be such that: Knots(Index - 1) < K < Knots(Index + 1) The second syntax allows you also to increase the multiplicity of the knot to M (but it is not possible to decrease the multiplicity of the knot with this function). Exceptions Standard_ConstructionError if: - K is not such that: Knots(Index - 1) < K < Knots(Index + 1) - M is greater than the degree of this BSpline curve or lower than the previous multiplicity of knot of index Index in the knots table. Standard_OutOfRange if Index is outside the bounds of the knots table.

    param Index

    type Index

    int

    param K

    type K

    float

    param M

    type M

    int

    rtype

    None

SetKnots()
  • Modifies this BSpline curve by assigning the array K to its knots table. The multiplicity of the knots is not modified. Exceptions Standard_ConstructionError if the values in the array K are not in ascending order. Standard_OutOfRange if the bounds of the array K are not respectively 1 and the number of knots of this BSpline curve.
    param K

    type K

    TColStd_Array1OfReal

    rtype

    None

SetNotPeriodic()
  • Changes this BSpline curve into a non-periodic curve. If this curve is already non-periodic, it is not modified. Note that the poles and knots tables are modified. Warning If this curve is periodic, as the multiplicity of the first and last knots is not modified, and is not equal to Degree + 1, where Degree is the degree of this BSpline curve, the start and end points of the curve are not its first and last poles.
    rtype

    None

SetOrigin()
  • Assigns the knot of index Index in the knots table as the origin of this periodic BSpline curve. As a consequence, the knots and poles tables are modified. Exceptions Standard_NoSuchObject if this curve is not periodic. Standard_DomainError if Index is outside the bounds of the knots table.
    param Index

    type Index

    int

    rtype

    None

SetPeriodic()
  • Changes this BSpline curve into a periodic curve. To become periodic, the curve must first be closed. Next, the knot sequence must be periodic. For this, FirstUKnotIndex and LastUKnotIndex are used to compute I1 and I2, the indexes in the knots array of the knots corresponding to the first and last parameters of this BSpline curve. The period is therefore Knot(I2) - Knot(I1). Consequently, the knots and poles tables are modified. Exceptions Standard_ConstructionError if this BSpline curve is not closed.
    rtype

    None

SetPole()
  • Modifies this BSpline curve by assigning P to the pole of index Index in the poles table. Exceptions Standard_OutOfRange if Index is outside the bounds of the poles table. Standard_ConstructionError if Weight is negative or null.
    param Index

    type Index

    int

    param P

    type P

    gp_Pnt2d

    rtype

    None* Modifies this BSpline curve by assigning P to the pole of index Index in the poles table. The second syntax also allows you to modify the weight of the modified pole, which becomes Weight. In this case, if this BSpline curve is non-rational, it can become rational and vice versa. Exceptions Standard_OutOfRange if Index is outside the bounds of the poles table. Standard_ConstructionError if Weight is negative or null.

    param Index

    type Index

    int

    param P

    type P

    gp_Pnt2d

    param Weight

    type Weight

    float

    rtype

    None

SetWeight()
  • Assigns the weight Weight to the pole of index Index of the poles table. If the curve was non rational it can become rational. If the curve was rational it can become non rational. Exceptions Standard_OutOfRange if Index is outside the bounds of the poles table. Standard_ConstructionError if Weight is negative or null.
    param Index

    type Index

    int

    param Weight

    type Weight

    float

    rtype

    None

Weight()
  • Returns the weight of the pole of range Index . Raised if Index < 1 or Index > NbPoles.
    param Index

    type Index

    int

    rtype

    float

Weights()
  • Returns the weights of the B-spline curve; //! Raised if the length of W is not equal to NbPoles.
    param W

    type W

    TColStd_Array1OfReal

    rtype

    None* Returns the weights of the B-spline curve;

    rtype

    TColStd_Array1OfReal *

property thisown

The membership flag

class Geom2d_BezierCurve(*args)

Bases: OCC.Core.Geom2d.Geom2d_BoundedCurve

  • Creates a non rational Bezier curve with a set of polesCurvePoles. The weights are defaulted to all being 1. Raises ConstructionError if the number of poles is greater than MaxDegree + 1 or lower than 2.
    param CurvePoles

    type CurvePoles

    TColgp_Array1OfPnt2d

    rtype

    None* Creates a rational Bezier curve with the set of poles CurvePoles and the set of weights PoleWeights . If all the weights are identical the curve is considered as non rational. Raises ConstructionError if the number of poles is greater than MaxDegree + 1 or lower than 2 or CurvePoles and CurveWeights have not the same length or one weight value is lower or equal to Resolution from package gp.

    param CurvePoles

    type CurvePoles

    TColgp_Array1OfPnt2d

    param PoleWeights

    type PoleWeights

    TColStd_Array1OfReal

    rtype

    None

Degree()
  • Returns the polynomial degree of the curve. It is the number of poles less one. In this package the Degree of a Bezier curve cannot be greater than ‘MaxDegree’.
    rtype

    int

static DownCast(t)
Increase()
  • Increases the degree of a bezier curve. Degree is the new degree of <self>. raises ConstructionError if Degree is greater than MaxDegree or lower than 2 or lower than the initial degree of <self>.
    param Degree

    type Degree

    int

    rtype

    None

InsertPoleAfter()
  • Inserts a pole with its weight in the set of poles after the pole of range Index. If the curve was non rational it can become rational if all the weights are not identical. Raised if Index is not in the range [0, NbPoles] //! Raised if the resulting number of poles is greater than MaxDegree + 1.
    param Index

    type Index

    int

    param P

    type P

    gp_Pnt2d

    param Weight

    default value is 1.0

    type Weight

    float

    rtype

    None

InsertPoleBefore()
  • Inserts a pole with its weight in the set of poles after the pole of range Index. If the curve was non rational it can become rational if all the weights are not identical. Raised if Index is not in the range [1, NbPoles+1] //! Raised if the resulting number of poles is greater than MaxDegree + 1.
    param Index

    type Index

    int

    param P

    type P

    gp_Pnt2d

    param Weight

    default value is 1.0

    type Weight

    float

    rtype

    None

IsRational()
  • Returns false if all the weights are identical. The tolerance criterion is Resolution from package gp.
    rtype

    bool

static MaxDegree()
  • Returns the value of the maximum polynomial degree of a BezierCurve. This value is 25.
    rtype

    int

NbPoles()
  • Returns the number of poles for this Bezier curve.
    rtype

    int

Pole()
  • Returns the pole of range Index. Raised if Index is not in the range [1, NbPoles]
    param Index

    type Index

    int

    rtype

    gp_Pnt2d

Poles()
  • Returns all the poles of the curve. //! Raised if the length of P is not equal to the number of poles.
    param P

    type P

    TColgp_Array1OfPnt2d

    rtype

    None* Returns all the poles of the curve.

    rtype

    TColgp_Array1OfPnt2d

RemovePole()
  • Removes the pole of range Index. If the curve was rational it can become non rational. Raised if Index is not in the range [1, NbPoles]
    param Index

    type Index

    int

    rtype

    None

Resolution()
  • Computes for this Bezier curve the parametric tolerance UTolerance for a given tolerance Tolerance3D (relative to dimensions in the plane). If f(t) is the equation of this Bezier curve, UTolerance ensures that | t1 - t0| < Utolerance ===> |f(t1) - f(t0)| < ToleranceUV
    param ToleranceUV

    type ToleranceUV

    float

    param UTolerance

    type UTolerance

    float

    rtype

    None

Segment()
  • Segments the curve between U1 and U2 which can be out of the bounds of the curve. The curve is oriented from U1 to U2. The control points are modified, the first and the last point are not the same but the parametrization range is [0, 1] else it could not be a Bezier curve. WarningsEven if <self> is not closed it can become closed after the segmentation for example if U1 or U2 are out of the bounds of the curve <self> or if the curve makes loop. After the segmentation the length of a curve can be null.
    param U1

    type U1

    float

    param U2

    type U2

    float

    rtype

    None

SetPole()
  • Substitutes the pole of range index with P. If the curve <self> is rational the weight of range Index is not modified. raiseD if Index is not in the range [1, NbPoles]
    param Index

    type Index

    int

    param P

    type P

    gp_Pnt2d

    rtype

    None* Substitutes the pole and the weights of range Index. If the curve <self> is not rational it can become rational if all the weights are not identical. If the curve was rational it can become non rational if all the weights are identical. Raised if Index is not in the range [1, NbPoles] Raised if Weight <= Resolution from package gp

    param Index

    type Index

    int

    param P

    type P

    gp_Pnt2d

    param Weight

    type Weight

    float

    rtype

    None

SetWeight()
  • Changes the weight of the pole of range Index. If the curve <self> is not rational it can become rational if all the weights are not identical. If the curve was rational it can become non rational if all the weights are identical. Raised if Index is not in the range [1, NbPoles] Raised if Weight <= Resolution from package gp
    param Index

    type Index

    int

    param Weight

    type Weight

    float

    rtype

    None

Weight()
  • Returns the weight of range Index. Raised if Index is not in the range [1, NbPoles]
    param Index

    type Index

    int

    rtype

    float

Weights()
  • Returns all the weights of the curve. //! Raised if the length of W is not equal to the number of poles.
    param W

    type W

    TColStd_Array1OfReal

    rtype

    None* Returns all the weights of the curve.

    rtype

    TColStd_Array1OfReal *

property thisown

The membership flag

class Geom2d_BoundedCurve(*args, **kwargs)

Bases: OCC.Core.Geom2d.Geom2d_Curve

  • Empty constructor

Return type

None* Copy constructor – does nothing

Parameters

& (Standard_Transient) –

Return type

None

static DownCast(t)
EndPoint()
  • Returns the end point of the curve. The end point is the value of the curve for the ‘LastParameter’ of the curve.
    rtype

    gp_Pnt2d

StartPoint()
  • Returns the start point of the curve. The start point is the value of the curve for the ‘FirstParameter’ of the curve.
    rtype

    gp_Pnt2d

property thisown

The membership flag

class Geom2d_CartesianPoint(*args)

Bases: OCC.Core.Geom2d.Geom2d_Point

  • Returns a persistent copy of P.
    param P

    type P

    gp_Pnt2d

    rtype

    None:param X:

    type X

    float

    param Y

    type Y

    float

    rtype

    None

static DownCast(t)
SetCoord()
  • Set <self> to X, Y coordinates.
    param X

    type X

    float

    param Y

    type Y

    float

    rtype

    None

SetPnt2d()
  • Set <self> to P.X(), P.Y() coordinates.
    param P

    type P

    gp_Pnt2d

    rtype

    None

SetX()
  • Changes the X coordinate of me.
    param X

    type X

    float

    rtype

    None

SetY()
  • Changes the Y coordinate of me.
    param Y

    type Y

    float

    rtype

    None

property thisown

The membership flag

class Geom2d_Circle(*args)

Bases: OCC.Core.Geom2d.Geom2d_Conic

  • Constructs a circle by conversion of the gp_Circ2d circle C.
    param C

    type C

    gp_Circ2d

    rtype

    None* Constructs a circle of radius Radius, whose center is the origin of axis A; A is the ‘X Axis’ of the local coordinate system of the circle; this coordinate system is direct if Sense is true (default value) or indirect if Sense is false. Note: It is possible to create a circle where Radius is equal to 0.0. Exceptions Standard_ConstructionError if Radius is negative.

    param A

    type A

    gp_Ax2d

    param Radius

    type Radius

    float

    param Sense

    default value is Standard_True

    type Sense

    bool

    rtype

    None* Constructs a circle of radius Radius, where the coordinate system A locates the circle and defines its orientation in the plane such that: - the center of the circle is the origin of A, - the orientation (direct or indirect) of A gives the orientation of the circle.

    param A

    type A

    gp_Ax22d

    param Radius

    type Radius

    float

    rtype

    None

Circ2d()
  • Returns the non persistent circle from gp with the same geometric properties as <self>.
    rtype

    gp_Circ2d

static DownCast(t)
Radius()
  • Returns the radius of this circle.
    rtype

    float

SetCirc2d()
  • Converts the gp_Circ2d circle C into this circle.
    param C

    type C

    gp_Circ2d

    rtype

    None

SetRadius()
Parameters

R

type R

float

rtype

None

property thisown

The membership flag

class Geom2d_Conic(*args, **kwargs)

Bases: OCC.Core.Geom2d.Geom2d_Curve

  • Empty constructor

Return type

None* Copy constructor – does nothing

Parameters

& (Standard_Transient) –

Return type

None

static DownCast(t)
Eccentricity()
  • returns the eccentricity value of the conic e. e = 0 for a circle 0 < e < 1 for an ellipse (e = 0 if MajorRadius = MinorRadius) e > 1 for a hyperbola e = 1 for a parabola
    rtype

    float

Location()
  • Returns the location point of the conic. For the circle, the ellipse and the hyperbola it is the center of the conic. For the parabola it is the vertex of the parabola.
    rtype

    gp_Pnt2d

Position()
  • Returns the local coordinates system of the conic.
    rtype

    gp_Ax22d

SetAxis()
  • Modifies this conic, redefining its local coordinate system partially, by assigning P as its origin
    param A

    type A

    gp_Ax22d

    rtype

    None

SetLocation()
  • Modifies this conic, redefining its local coordinate system fully, by assigning A as this coordinate system.
    param P

    type P

    gp_Pnt2d

    rtype

    None

SetXAxis()
Parameters

A

type A

gp_Ax2d

rtype

None

SetYAxis()
  • Assigns the origin and unit vector of axis A to the origin of the local coordinate system of this conic and either: - its ‘X Direction’, or - its ‘Y Direction’. The other unit vector of the local coordinate system of this conic is recomputed normal to A, without changing the orientation of the local coordinate system (right-handed or left-handed).
    param A

    type A

    gp_Ax2d

    rtype

    None

XAxis()
  • Returns the ‘XAxis’ of the conic. This axis defines the origin of parametrization of the conic. This axis and the ‘Yaxis’ define the local coordinate system of the conic. -C++: return const&
    rtype

    gp_Ax2d

YAxis()
  • Returns the ‘YAxis’ of the conic. The ‘YAxis’ is perpendicular to the ‘Xaxis’.
    rtype

    gp_Ax2d

property thisown

The membership flag

class Geom2d_Curve(*args, **kwargs)

Bases: OCC.Core.Geom2d.Geom2d_Geometry

  • Empty constructor

Return type

None* Copy constructor – does nothing

Parameters

& (Standard_Transient) –

Return type

None

Continuity()
  • It is the global continuity of the curveC0only geometric continuity, C1continuity of the first derivative all along the Curve, C2continuity of the second derivative all along the Curve, C3continuity of the third derivative all along the Curve, G1tangency continuity all along the Curve, G2curvature continuity all along the Curve, CNthe order of continuity is infinite.
    rtype

    GeomAbs_Shape

D0()
  • Returns in P the point of parameter U. If the curve is periodic then the returned point is P(U) with U = Ustart + (U - Uend) where Ustart and Uend are the parametric bounds of the curve. //! Raised only for the ‘OffsetCurve’ if it is not possible to compute the current point. For example when the first derivative on the basis curve and the offset direction are parallel.
    param U

    type U

    float

    param P

    type P

    gp_Pnt2d

    rtype

    void

D1()
  • Returns the point P of parameter U and the first derivative V1. Raised if the continuity of the curve is not C1.
    param U

    type U

    float

    param P

    type P

    gp_Pnt2d

    param V1

    type V1

    gp_Vec2d

    rtype

    void

D2()
  • Returns the point P of parameter U, the first and second derivatives V1 and V2. Raised if the continuity of the curve is not C2.
    param U

    type U

    float

    param P

    type P

    gp_Pnt2d

    param V1

    type V1

    gp_Vec2d

    param V2

    type V2

    gp_Vec2d

    rtype

    void

D3()
  • Returns the point P of parameter U, the first, the second and the third derivative. Raised if the continuity of the curve is not C3.
    param U

    type U

    float

    param P

    type P

    gp_Pnt2d

    param V1

    type V1

    gp_Vec2d

    param V2

    type V2

    gp_Vec2d

    param V3

    type V3

    gp_Vec2d

    rtype

    void

DN()
  • For the point of parameter U of this curve, computes the vector corresponding to the Nth derivative. Exceptions StdFail_UndefinedDerivative if: - the continuity of the curve is not ‘CN’, or - the derivative vector cannot be computed easily; this is the case with specific types of curve (for example, a rational BSpline curve where N is greater than 3). Standard_RangeError if N is less than 1.
    param U

    type U

    float

    param N

    type N

    int

    rtype

    gp_Vec2d

static DownCast(t)
FirstParameter()
  • Returns the value of the first parameter. WarningsIt can be RealFirst or RealLast from package Standard if the curve is infinite
    rtype

    float

IsCN()
  • Returns true if the degree of continuity of this curve is at least N. Exceptions Standard_RangeError if N is less than 0.
    param N

    type N

    int

    rtype

    bool

IsClosed()
  • Returns true if the curve is closed. ExamplesSome curves such as circle are always closed, others such as line are never closed (by definition). Some Curves such as OffsetCurve can be closed or not. These curves are considered as closed if the distance between the first point and the last point of the curve is lower or equal to the Resolution from package gp wich is a fixed criterion independant of the application.
    rtype

    bool

IsPeriodic()
  • Returns true if the parameter of the curve is periodic. It is possible only if the curve is closed and if the following relation is satisfiedfor each parametric value U the distance between the point P(u) and the point P (u + T) is lower or equal to Resolution from package gp, T is the period and must be a constant. There are three possibilities. the curve is never periodic by definition (SegmentLine) . the curve is always periodic by definition (Circle) . the curve can be defined as periodic (BSpline). In this case a function SetPeriodic allows you to give the shape of the curve. The general rule for this case isif a curve can be periodic or not the default periodicity set is non periodic and you have to turn (explicitly) the curve into a periodic curve if you want the curve to be periodic.
    rtype

    bool

LastParameter()
  • Value of the last parameter. WarningsIt can be RealFirst or RealLast from package Standard if the curve is infinite
    rtype

    float

ParametricTransformation()
  • Returns the coefficient required to compute the parametric transformation of this curve when transformation T is applied. This coefficient is the ratio between the parameter of a point on this curve and the parameter of the transformed point on the new curve transformed by T. Note: this function generally returns 1. but it can be redefined (for example, on a line).
    param T

    type T

    gp_Trsf2d

    rtype

    float

Period()
  • Returns thne period of this curve. raises if the curve is not periodic
    rtype

    float

Reverse()
  • Changes the direction of parametrization of <self>. The ‘FirstParameter’ and the ‘LastParameter’ are not changed but the orientation of the curve is modified. If the curve is bounded the StartPoint of the initial curve becomes the EndPoint of the reversed curve and the EndPoint of the initial curve becomes the StartPoint of the reversed curve.
    rtype

    void

Reversed()
  • Creates a reversed duplicate Changes the orientation of this curve. The first and last parameters are not changed, but the parametric direction of the curve is reversed. If the curve is bounded: - the start point of the initial curve becomes the end point of the reversed curve, and - the end point of the initial curve becomes the start point of the reversed curve. - Reversed creates a new curve.
    rtype

    opencascade::handle<Geom2d_Curve>

ReversedParameter()
  • Computes the parameter on the reversed curve for the point of parameter U on this curve. Note: The point of parameter U on this curve is identical to the point of parameter ReversedParameter(U) on the reversed curve.
    param U

    type U

    float

    rtype

    float

TransformedParameter()
  • Computes the parameter on the curve transformed by T for the point of parameter U on this curve. Note: this function generally returns U but it can be redefined (for example, on a line).
    param U

    type U

    float

    param T

    type T

    gp_Trsf2d

    rtype

    float

Value()
  • Computes the point of parameter U on <self>. If the curve is periodic then the returned point is P(U) with U = Ustart + (U - Uend) where Ustart and Uend are the parametric bounds of the curve. //! it is implemented with D0. //! Raised only for the ‘OffsetCurve’ if it is not possible to compute the current point. For example when the first derivative on the basis curve and the offset direction are parallel.
    param U

    type U

    float

    rtype

    gp_Pnt2d

property thisown

The membership flag

class Geom2d_Direction(*args)

Bases: OCC.Core.Geom2d.Geom2d_Vector

  • Creates a unit vector with it 2 cartesian coordinates. //! Raised if Sqrt( X*X + Y*Y) <= Resolution from gp.
    param X

    type X

    float

    param Y

    type Y

    float

    rtype

    None* Creates a persistent copy of <self>.

    param V

    type V

    gp_Dir2d

    rtype

    None

Dir2d()
  • Converts this unit vector into a gp_Dir2d unit vector.
    rtype

    gp_Dir2d

static DownCast(t)
SetCoord()
  • Assigns the coordinates X and Y to this unit vector, then normalizes it. Exceptions Standard_ConstructionError if Sqrt(X*X + Y*Y) is less than or equal to gp::Resolution().
    param X

    type X

    float

    param Y

    type Y

    float

    rtype

    None

SetDir2d()
  • Converts the gp_Dir2d unit vector V into this unit vector.
    param V

    type V

    gp_Dir2d

    rtype

    None

SetX()
  • Assigns a value to the X coordinate of this unit vector, then normalizes it. Exceptions Standard_ConstructionError if the value assigned causes the magnitude of the vector to become less than or equal to gp::Resolution().
    param X

    type X

    float

    rtype

    None

SetY()
  • Assigns a value to the Y coordinate of this unit vector, then normalizes it. Exceptions Standard_ConstructionError if the value assigned causes the magnitude of the vector to become less than or equal to gp::Resolution().
    param Y

    type Y

    float

    rtype

    None

property thisown

The membership flag

class Geom2d_Ellipse(*args)

Bases: OCC.Core.Geom2d.Geom2d_Conic

  • Creates an ellipse by conversion of the gp_Elips2d ellipse E.
    param E

    type E

    gp_Elips2d

    rtype

    None* Creates an ellipse defined by its major and minor radii, MajorRadius and MinorRadius, and positioned in the plane by its major axis MajorAxis; the center of the ellipse is the origin of MajorAxis and the unit vector of MajorAxis is the ‘X Direction’ of the local coordinate system of the ellipse; this coordinate system is direct if Sense is true (default value) or indirect if Sense is false. Warnings : It is not forbidden to create an ellipse with MajorRadius = MinorRadius. Exceptions Standard_ConstructionError if: - MajorRadius is less than MinorRadius, or - MinorRadius is less than 0.

    param MajorAxis

    type MajorAxis

    gp_Ax2d

    param MajorRadius

    type MajorRadius

    float

    param MinorRadius

    type MinorRadius

    float

    param Sense

    default value is Standard_True

    type Sense

    bool

    rtype

    None* Creates an ellipse defined by its major and minor radii, MajorRadius and MinorRadius, where the coordinate system Axis locates the ellipse and defines its orientation in the plane such that: - the center of the ellipse is the origin of Axis, - the ‘X Direction’ of Axis defines the major axis of the ellipse, - the ‘Y Direction’ of Axis defines the minor axis of the ellipse, - the orientation of Axis (direct or indirect) gives the orientation of the ellipse. Warnings : It is not forbidden to create an ellipse with MajorRadius = MinorRadius. Exceptions Standard_ConstructionError if: - MajorRadius is less than MinorRadius, or - MinorRadius is less than 0.

    param Axis

    type Axis

    gp_Ax22d

    param MajorRadius

    type MajorRadius

    float

    param MinorRadius

    type MinorRadius

    float

    rtype

    None

Directrix1()
  • Computes the directrices of this ellipse. This directrix is the line normal to the XAxis of the ellipse in the local plane (Z = 0) at a distance d = MajorRadius / e from the center of the ellipse, where e is the eccentricity of the ellipse. This line is parallel to the ‘YAxis’. The intersection point between directrix1 and the ‘XAxis’ is the ‘Location’ point of the directrix1. This point is on the positive side of the ‘XAxis’. Raises ConstructionError if Eccentricity = 0.0. (The ellipse degenerates into a circle)
    rtype

    gp_Ax2d

Directrix2()
  • This line is obtained by the symmetrical transformation of ‘Directrix1’ with respect to the ‘YAxis’ of the ellipse. Raises ConstructionError if Eccentricity = 0.0. (The ellipse degenerates into a circle).
    rtype

    gp_Ax2d

static DownCast(t)
Elips2d()
  • Converts this ellipse into a gp_Elips2d ellipse.
    rtype

    gp_Elips2d

Focal()
  • Computes the focal distance. The focal distance is the distance between the center and a focus of the ellipse.
    rtype

    float

Focus1()
  • Returns the first focus of the ellipse. This focus is on the positive side of the ‘XAxis’ of the ellipse.
    rtype

    gp_Pnt2d

Focus2()
  • Returns the second focus of the ellipse. This focus is on the negative side of the ‘XAxis’ of the ellipse.
    rtype

    gp_Pnt2d

MajorRadius()
  • Returns the major radius of this ellipse.
    rtype

    float

MinorRadius()
  • Returns the minor radius of this ellipse.
    rtype

    float

Parameter()
  • Computes the parameter of this ellipse. This value is given by the formula p = (1 - e * e) * MajorRadius where e is the eccentricity of the ellipse. Returns 0 if MajorRadius = 0
    rtype

    float

SetElips2d()
  • Converts the gp_Elips2d ellipse E into this ellipse.
    param E

    type E

    gp_Elips2d

    rtype

    None

SetMajorRadius()
  • Assigns a value to the major radius of this ellipse. Exceptions Standard_ConstructionError if: - the major radius of this ellipse becomes less than the minor radius, or - MinorRadius is less than 0.
    param MajorRadius

    type MajorRadius

    float

    rtype

    None

SetMinorRadius()
  • Assigns a value to the minor radius of this ellipse. Exceptions Standard_ConstructionError if: - the major radius of this ellipse becomes less than the minor radius, or - MinorRadius is less than 0.
    param MinorRadius

    type MinorRadius

    float

    rtype

    None

property thisown

The membership flag

class Geom2d_Geometry(*args, **kwargs)

Bases: OCC.Core.Standard.Standard_Transient

  • Empty constructor

Return type

None* Copy constructor – does nothing

Parameters

& (Standard_Transient) –

Return type

None

Copy()
Return type

opencascade::handle<Geom2d_Geometry>

static DownCast(t)
Mirror()
  • Performs the symmetrical transformation of a Geometry with respect to the point P which is the center of the symmetry and assigns the result to this geometric object.
    param P

    type P

    gp_Pnt2d

    rtype

    None* Performs the symmetrical transformation of a Geometry with respect to an axis placement which is the axis of the symmetry.

    param A

    type A

    gp_Ax2d

    rtype

    None

Mirrored()
Parameters

P

type P

gp_Pnt2d

rtype

opencascade::handle<Geom2d_Geometry>:param A:

type A

gp_Ax2d

rtype

opencascade::handle<Geom2d_Geometry>

Rotate()
  • Rotates a Geometry. P is the center of the rotation. Ang is the angular value of the rotation in radians.
    param P

    type P

    gp_Pnt2d

    param Ang

    type Ang

    float

    rtype

    None

Rotated()
Parameters

P

type P

gp_Pnt2d

param Ang

type Ang

float

rtype

opencascade::handle<Geom2d_Geometry>

Scale()
  • Scales a Geometry. S is the scaling value.
    param P

    type P

    gp_Pnt2d

    param S

    type S

    float

    rtype

    None

Scaled()
Parameters

P

type P

gp_Pnt2d

param S

type S

float

rtype

opencascade::handle<Geom2d_Geometry>

Transform()
  • Transformation of a geometric object. This tansformation can be a translation, a rotation, a symmetry, a scaling or a complex transformation obtained by combination of the previous elementaries transformations. (see class Transformation of the package Geom2d). The following transformations have the same properties as the previous ones but they don’t modified the object itself. A copy of the object is returned.
    param T

    type T

    gp_Trsf2d

    rtype

    void

Transformed()
Parameters

T

type T

gp_Trsf2d

rtype

opencascade::handle<Geom2d_Geometry>

Translate()
  • Translates a Geometry. V is the vector of the tanslation.
    param V

    type V

    gp_Vec2d

    rtype

    None* Translates a Geometry from the point P1 to the point P2.

    param P1

    type P1

    gp_Pnt2d

    param P2

    type P2

    gp_Pnt2d

    rtype

    None

Translated()
Parameters

V

type V

gp_Vec2d

rtype

opencascade::handle<Geom2d_Geometry>:param P1:

type P1

gp_Pnt2d

param P2

type P2

gp_Pnt2d

rtype

opencascade::handle<Geom2d_Geometry>

property thisown

The membership flag

class Geom2d_Hyperbola(*args)

Bases: OCC.Core.Geom2d.Geom2d_Conic

  • Creates an Hyperbola from a non persistent one from package gp
    param H

    type H

    gp_Hypr2d

    rtype

    None* MajorAxis is the ‘XAxis’ of the hyperbola. The YAxis is in the direct sense if ‘Sense’ is True; The major radius of the hyperbola is on this ‘XAxis’ and the minor radius is on the ‘YAxis’ of the hyperbola. Raised if MajorRadius < 0.0 or if MinorRadius < 0.0

    param MajorAxis

    type MajorAxis

    gp_Ax2d

    param MajorRadius

    type MajorRadius

    float

    param MinorRadius

    type MinorRadius

    float

    param Sense

    default value is Standard_True

    type Sense

    bool

    rtype

    None* The XDirection of ‘Axis’ is the ‘XAxis’ of the hyperbola and the YDirection of ‘Axis’ is the ‘YAxis’. The major radius of the hyperbola is on this ‘XAxis’ and the minor radius is on the ‘YAxis’ of the hyperbola. Raised if MajorRadius < 0.0 or if MinorRadius < 0.0

    param Axis

    type Axis

    gp_Ax22d

    param MajorRadius

    type MajorRadius

    float

    param MinorRadius

    type MinorRadius

    float

    rtype

    None

Asymptote1()
  • In the local coordinate system of the hyperbola the equation of the hyperbola is (X*X)/(A*A) - (Y*Y)/(B*B) = 1.0 and the equation of the first asymptote is Y = (B/A)*X where A is the major radius of the hyperbola and B is the minor radius of the hyperbola. Raised if MajorRadius = 0.0
    rtype

    gp_Ax2d

Asymptote2()
  • In the local coordinate system of the hyperbola the equation of the hyperbola is (X*X)/(A*A) - (Y*Y)/(B*B) = 1.0 and the equation of the first asymptote is Y = -(B/A)*X. where A is the major radius of the hyperbola and B is the minor radius of the hyperbola. raised if MajorRadius = 0.0
    rtype

    gp_Ax2d

ConjugateBranch1()
  • Computes the first conjugate branch relative to this hyperbola. Note: The diagram given under the class purpose indicates where these two branches of hyperbola are positioned in relation to this branch of hyperbola.
    rtype

    gp_Hypr2d

ConjugateBranch2()
  • Computes the second conjugate branch relative to this hyperbola. Note: The diagram given under the class purpose indicates where these two branches of hyperbola are positioned in relation to this branch of hyperbola.
    rtype

    gp_Hypr2d

Directrix1()
  • This directrix is the line normal to the XAxis of the hyperbola in the local plane (Z = 0) at a distance d = MajorRadius / e from the center of the hyperbola, where e is the eccentricity of the hyperbola. This line is parallel to the ‘YAxis’. The intersection point between directrix1 and the ‘XAxis’ is the location point of the directrix1. This point is on the positive side of the ‘XAxis’.
    rtype

    gp_Ax2d

Directrix2()
  • This line is obtained by the symmetrical transformation of ‘Directrix1’ with respect to the ‘YAxis’ of the hyperbola.
    rtype

    gp_Ax2d

static DownCast(t)
Focal()
  • Computes the focal distance. It is the distance between the two focus of the hyperbola.
    rtype

    float

Focus1()
  • Returns the first focus of the hyperbola. This focus is on the positive side of the ‘XAxis’ of the hyperbola.
    rtype

    gp_Pnt2d

Focus2()
  • Returns the second focus of the hyperbola. This focus is on the negative side of the ‘XAxis’ of the hyperbola.
    rtype

    gp_Pnt2d

Hypr2d()
  • Converts this hyperbola into a gp_Hypr2d one.
    rtype

    gp_Hypr2d

MajorRadius()
  • Returns the major or minor radius of this hyperbola. The major radius is also the distance between the center of the hyperbola and the apex of the main branch (located on the ‘X Axis’ of the hyperbola).
    rtype

    float

MinorRadius()
  • Returns the major or minor radius of this hyperbola. The minor radius is also the distance between the center of the hyperbola and the apex of a conjugate branch (located on the ‘Y Axis’ of the hyperbola).
    rtype

    float

OtherBranch()
  • Computes the ‘other’ branch of this hyperbola. This is a symmetrical branch with respect to the center of this hyperbola. Note: The diagram given under the class purpose indicates where the ‘other’ branch is positioned in relation to this branch of the hyperbola. ^ YAxis | FirstConjugateBranch | Other | Main —————————- C ——————————————&gtXAxis Branch | Branch | | SecondConjugateBranch | Warning The major radius can be less than the minor radius.
    rtype

    gp_Hypr2d

Parameter()
  • Computes the parameter of this hyperbola. The parameter is: p = (e*e - 1) * MajorRadius where e is the eccentricity of this hyperbola and MajorRadius its major radius. Exceptions Standard_DomainError if the major radius of this hyperbola is null.
    rtype

    float

SetHypr2d()
  • Converts the gp_Hypr2d hyperbola H into this hyperbola.
    param H

    type H

    gp_Hypr2d

    rtype

    None

SetMajorRadius()
  • Assigns a value to the major or minor radius of this hyperbola. Exceptions Standard_ConstructionError if: - MajorRadius is less than 0.0, - MinorRadius is less than 0.0.
    param MajorRadius

    type MajorRadius

    float

    rtype

    None

SetMinorRadius()
  • Assigns a value to the major or minor radius of this hyperbola. Exceptions Standard_ConstructionError if: - MajorRadius is less than 0.0, - MinorRadius is less than 0.0.
    param MinorRadius

    type MinorRadius

    float

    rtype

    None

property thisown

The membership flag

class Geom2d_Line(*args)

Bases: OCC.Core.Geom2d.Geom2d_Curve

  • Creates a line located in 2D space with the axis placement A. The Location of A is the origin of the line.
    param A

    type A

    gp_Ax2d

    rtype

    None* Creates a line by conversion of the gp_Lin2d line L.

    param L

    type L

    gp_Lin2d

    rtype

    None* Constructs a line passing through point P and parallel to vector V (P and V are, respectively, the origin and the unit vector of the positioning axis of the line).

    param P

    type P

    gp_Pnt2d

    param V

    type V

    gp_Dir2d

    rtype

    None

Direction()
  • changes the direction of the line.
    rtype

    gp_Dir2d

Distance()
  • Computes the distance between <self> and the point P.
    param P

    type P

    gp_Pnt2d

    rtype

    float

static DownCast(t)
Lin2d()
  • Returns non persistent line from gp with the same geometric properties as <self>
    rtype

    gp_Lin2d

Location()
  • Changes the ‘Location’ point (origin) of the line.
    rtype

    gp_Pnt2d

Position()
Return type

gp_Ax2d

SetDirection()
  • changes the direction of the line.
    param V

    type V

    gp_Dir2d

    rtype

    None

SetLin2d()
  • Set <self> so that <self> has the same geometric properties as L.
    param L

    type L

    gp_Lin2d

    rtype

    None

SetLocation()
  • Changes the ‘Location’ point (origin) of the line.
    param P

    type P

    gp_Pnt2d

    rtype

    None

SetPosition()
  • Changes the ‘Location’ and a the ‘Direction’ of <self>.
    param A

    type A

    gp_Ax2d

    rtype

    None

property thisown

The membership flag

class Geom2d_OffsetCurve(*args)

Bases: OCC.Core.Geom2d.Geom2d_Curve

  • Constructs a curve offset from the basis curve C, where Offset is the distance between the offset curve and the basis curve at any point. A point on the offset curve is built by measuring the offset value along a normal vector at a point on C. This normal vector is obtained by rotating the vector tangential to C at 90 degrees in the anti-trigonometric sense. The side of C on which the offset value is measured is indicated by this normal vector if Offset is positive, or in the inverse sense if Offset is negative. If isNotCheckC0 = True checking if basis curve has C0-continuity is not made. WarningsIn this package the entities are not shared. The OffsetCurve is built with a copy of the curve C. So when C is modified the OffsetCurve is not modified Warning! if isNotCheckC0 = false, ConstructionError raised if the basis curve C is not at least C1. No check is done to know if ||V^Z|| != 0.0 at any point.
    param C

    type C

    Geom2d_Curve

    param Offset

    type Offset

    float

    param isNotCheckC0

    default value is Standard_False

    type isNotCheckC0

    bool

    rtype

    None

BasisCurve()
  • Returns the basis curve of this offset curve. The basis curve can be an offset curve.
    rtype

    opencascade::handle<Geom2d_Curve>

static DownCast(t)
GetBasisCurveContinuity()
  • Returns continuity of the basis curve.
    rtype

    GeomAbs_Shape

Offset()
  • Returns the offset value of this offset curve.
    rtype

    float

SetBasisCurve()
  • Changes this offset curve by assigning C as the basis curve from which it is built. If isNotCheckC0 = True checking if basis curve has C0-continuity is not made. Exceptions if isNotCheckC0 = false, Standard_ConstructionError if the curve C is not at least ‘C1’ continuous.
    param C

    type C

    Geom2d_Curve

    param isNotCheckC0

    default value is Standard_False

    type isNotCheckC0

    bool

    rtype

    None

SetOffsetValue()
  • Changes this offset curve by assigning D as the offset value.
    param D

    type D

    float

    rtype

    None

property thisown

The membership flag

class Geom2d_Parabola(*args)

Bases: OCC.Core.Geom2d.Geom2d_Conic

  • Creates a parabola from a non persistent one.
    param Prb

    type Prb

    gp_Parab2d

    rtype

    None* Creates a parabola with its ‘MirrorAxis’ and it’s focal length ‘Focal’. MirrorAxis is the axis of symmetry of the curve, it is the ‘XAxis’. The ‘YAxis’ is parallel to the directrix of the parabola and is in the direct sense if Sense is True. The ‘Location’ point of ‘MirrorAxis’ is the vertex of the parabola Raised if Focal < 0.0

    param MirrorAxis

    type MirrorAxis

    gp_Ax2d

    param Focal

    type Focal

    float

    param Sense

    default value is Standard_True

    type Sense

    bool

    rtype

    None* Creates a parabola with its Axis and it’s focal length ‘Focal’. The XDirection of Axis is the axis of symmetry of the curve, it is the ‘XAxis’. The ‘YAxis’ is parallel to the directrix of the parabola. The ‘Location’ point of ‘Axis’ is the vertex of the parabola. Raised if Focal < 0.0

    param Axis

    type Axis

    gp_Ax22d

    param Focal

    type Focal

    float

    rtype

    None* D is the directrix of the parabola and F the focus point. The symmetry axis ‘XAxis’ of the parabola is normal to the directrix and pass through the focus point F, but its ‘Location’ point is the vertex of the parabola. The ‘YAxis’ of the parabola is parallel to D and its ‘Location’ point is the vertex of the parabola.

    param D

    type D

    gp_Ax2d

    param F

    type F

    gp_Pnt2d

    rtype

    None

Directrix()
  • The directrix is parallel to the ‘YAxis’ of the parabola. The ‘Location’ point of the directrix is the intersection point between the directrix and the symmetry axis (‘XAxis’) of the parabola.
    rtype

    gp_Ax2d

static DownCast(t)
Focal()
  • Computes the focal length of this parabola. The focal length is the distance between the apex and the focus of the parabola.
    rtype

    float

Focus()
  • Computes the focus of this parabola The focus is on the positive side of the ‘X Axis’ of the local coordinate system of the parabola.
    rtype

    gp_Pnt2d

Parab2d()
  • Returns the non persistent parabola from gp with the same geometric properties as <self>.
    rtype

    gp_Parab2d

Parameter()
  • Computes the parameter of this parabola, which is the distance between its focus and its directrix. This distance is twice the focal length. If P is the parameter of the parabola, the equation of the parabola in its local coordinate system is: Y**2 = 2.*P*X.
    rtype

    float

SetFocal()
  • Assigns the value Focal to the focal length of this parabola. Exceptions Standard_ConstructionError if Focal is negative.
    param Focal

    type Focal

    float

    rtype

    None

SetParab2d()
  • Converts the gp_Parab2d parabola Prb into this parabola.
    param Prb

    type Prb

    gp_Parab2d

    rtype

    None

property thisown

The membership flag

class Geom2d_Point(*args, **kwargs)

Bases: OCC.Core.Geom2d.Geom2d_Geometry

  • Empty constructor

Return type

None* Copy constructor – does nothing

Parameters

& (Standard_Transient) –

Return type

None

Coord()
  • returns the Coordinates of <self>.
    param X

    type X

    float

    param Y

    type Y

    float

    rtype

    void

Distance()
  • computes the distance between <self> and <Other>.
    param Other

    type Other

    Geom2d_Point

    rtype

    float

static DownCast(t)
Pnt2d()
  • returns a non persistent copy of <self>
    rtype

    gp_Pnt2d

SquareDistance()
  • computes the square distance between <self> and <Other>.
    param Other

    type Other

    Geom2d_Point

    rtype

    float

X()
  • returns the X coordinate of <self>.
    rtype

    float

Y()
  • returns the Y coordinate of <self>.
    rtype

    float

property thisown

The membership flag

class Geom2d_Transformation(*args)

Bases: OCC.Core.Standard.Standard_Transient

  • Creates an identity transformation.
    rtype

    None* Creates a persistent copy of T.

    param T

    type T

    gp_Trsf2d

    rtype

    None

Copy()
  • Creates a new object, which is a copy of this transformation.
    rtype

    opencascade::handle<Geom2d_Transformation>

static DownCast(t)
Form()
  • Returns the nature of this transformation as a value of the gp_TrsfForm enumeration. Returns the nature of the transformation. It can be Identity, Rotation, Translation, PntMirror, Ax1Mirror, Scale, CompoundTrsf
    rtype

    gp_TrsfForm

Invert()
  • Computes the inverse of this transformation. and assigns the result to this transformatio //! Raised if the the transformation is singular. This means that the ScaleFactor is lower or equal to Resolution from package gp.
    rtype

    None

Inverted()
  • Computes the inverse of this transformation and creates a new one. Raises ConstructionError if the the transformation is singular. This means that the ScaleFactor is lower or equal to Resolution from package gp.
    rtype

    opencascade::handle<Geom2d_Transformation>

IsNegative()
  • Checks whether this transformation is an indirect transformation: returns true if the determinant of the matrix of the vectorial part of the transformation is less than 0.
    rtype

    bool

Multiplied()
  • Computes the transformation composed with Other and <self>. <self> * Other. Returns a new transformation
    param Other

    type Other

    Geom2d_Transformation

    rtype

    opencascade::handle<Geom2d_Transformation>

Multiply()
  • Computes the transformation composed with Other and <self> . <self> = <self> * Other. //! Computes the following composition of transformations if N > 0 <self> * <self> * …….* <self>. if N = 0 Identity if N < 0 <self>.Invert() * ………* <self>.Invert()
    param Other

    type Other

    Geom2d_Transformation

    rtype

    None

Power()
  • Raised if N < 0 and if the transformation is not inversible
    param N

    type N

    int

    rtype

    None

Powered()
  • Raised if N < 0 and if the transformation is not inversible
    param N

    type N

    int

    rtype

    opencascade::handle<Geom2d_Transformation>

PreMultiply()
  • Computes the matrix of the transformation composed with <self> and Other. <self> = Other * <self>
    param Other

    type Other

    Geom2d_Transformation

    rtype

    None

ScaleFactor()
  • Returns the scale value of the transformation.
    rtype

    float

SetMirror()
  • Makes the transformation into a symmetrical transformation with respect to a point P. P is the center of the symmetry.
    param P

    type P

    gp_Pnt2d

    rtype

    None* Makes the transformation into a symmetrical transformation with respect to an axis A. A is the center of the axial symmetry.

    param A

    type A

    gp_Ax2d

    rtype

    None

SetRotation()
  • Assigns to this transformation the geometric properties of a rotation at angle Ang (in radians) about point P.
    param P

    type P

    gp_Pnt2d

    param Ang

    type Ang

    float

    rtype

    None

SetScale()
  • Makes the transformation into a scale. P is the center of the scale and S is the scaling value.
    param P

    type P

    gp_Pnt2d

    param S

    type S

    float

    rtype

    None

SetTransformation()
  • Makes a transformation allowing passage from the coordinate system ‘FromSystem1’ to the coordinate system ‘ToSystem2’.
    param FromSystem1

    type FromSystem1

    gp_Ax2d

    param ToSystem2

    type ToSystem2

    gp_Ax2d

    rtype

    None* Makes the transformation allowing passage from the basic coordinate system {P(0.,0.,0.), VX (1.,0.,0.), VY (0.,1.,0.)} to the local coordinate system defined with the Ax2d ToSystem.

    param ToSystem

    type ToSystem

    gp_Ax2d

    rtype

    None

SetTranslation()
  • Makes the transformation into a translation. V is the vector of the translation.
    param V

    type V

    gp_Vec2d

    rtype

    None* Makes the transformation into a translation from the point P1 to the point P2.

    param P1

    type P1

    gp_Pnt2d

    param P2

    type P2

    gp_Pnt2d

    rtype

    None

SetTrsf2d()
  • Makes the transformation into a transformation T from package gp.
    param T

    type T

    gp_Trsf2d

    rtype

    None

Transforms()
  • Applies the transformation <self> to the triplet {X, Y}.
    param X

    type X

    float

    param Y

    type Y

    float

    rtype

    None

Trsf2d()
  • Converts this transformation into a gp_Trsf2d transformation. Returns a non persistent copy of <self>. -C++: return const&
    rtype

    gp_Trsf2d

Value()
  • Returns the coefficients of the global matrix of tranformation. It is a 2 rows X 3 columns matrix. //! Raised if Row < 1 or Row > 2 or Col < 1 or Col > 2 //! Computes the reverse transformation.
    param Row

    type Row

    int

    param Col

    type Col

    int

    rtype

    float

property thisown

The membership flag

class Geom2d_TrimmedCurve(*args)

Bases: OCC.Core.Geom2d.Geom2d_BoundedCurve

  • Creates a trimmed curve from the basis curve C limited between U1 and U2. //! . U1 can be greater or lower than U2. . The returned curve is oriented from U1 to U2. . If the basis curve C is periodic there is an ambiguity because two parts are available. In this case by default the trimmed curve has the same orientation as the basis curve (Sense = True). If Sense = False then the orientation of the trimmed curve is opposite to the orientation of the basis curve C. If the curve is closed but not periodic it is not possible to keep the part of the curve including the junction point (except if the junction point is at the beginning or at the end of the trimmed curve) because you could lose the fundamental characteristics of the basis curve which are used for example to compute the derivatives of the trimmed curve. So for a closed curve the rules are the same as for a open curve. WarningsIn this package the entities are not shared. The TrimmedCurve is built with a copy of the curve C. So when C is modified the TrimmedCurve is not modified WarningsIf <C> is periodic and <theAdjustPeriodic> is True, parametrics bounds of the TrimmedCurve, can be different to [<U1>;<U2>}, if <U1> or <U2> are not in the principal period. IncludeFor more explanation see the scheme given with this class. Raises ConstructionError the C is not periodic and U1 or U2 are out of the bounds of C. Raised if U1 = U2.
    param C

    type C

    Geom2d_Curve

    param U1

    type U1

    float

    param U2

    type U2

    float

    param Sense

    default value is Standard_True

    type Sense

    bool

    param theAdjustPeriodic

    default value is Standard_True

    type theAdjustPeriodic

    bool

    rtype

    None

BasisCurve()
  • Returns the basis curve. Warning This function does not return a constant reference. Consequently, any modification of the returned value directly modifies the trimmed curve.
    rtype

    opencascade::handle<Geom2d_Curve>

static DownCast(t)
SetTrim()
  • Changes this trimmed curve, by redefining the parameter values U1 and U2, which limit its basis curve. Note: If the basis curve is periodic, the trimmed curve has the same orientation as the basis curve if Sense is true (default value) or the opposite orientation if Sense is false. Warning If the basis curve is periodic and theAdjustPeriodic is True, the bounds of the trimmed curve may be different from U1 and U2 if the parametric origin of the basis curve is within the arc of the trimmed curve. In this case, the modified parameter will be equal to U1 or U2 plus or minus the period. If theAdjustPeriodic is False, parameters U1 and U2 will stay unchanged. Exceptions Standard_ConstructionError if: - the basis curve is not periodic, and either U1 or U2 are outside the bounds of the basis curve, or - U1 is equal to U2.
    param U1

    type U1

    float

    param U2

    type U2

    float

    param Sense

    default value is Standard_True

    type Sense

    bool

    param theAdjustPeriodic

    default value is Standard_True

    type theAdjustPeriodic

    bool

    rtype

    None

property thisown

The membership flag

class Geom2d_Vector(*args, **kwargs)

Bases: OCC.Core.Geom2d.Geom2d_Geometry

  • Empty constructor

Return type

None* Copy constructor – does nothing

Parameters

& (Standard_Transient) –

Return type

None

Angle()
  • Computes the angular value, in radians, between this vector and vector Other. The result is a value between -Pi and Pi. The orientation is from this vector to vector Other. Raises VectorWithNullMagnitude if one of the two vectors is a vector with null magnitude because the angular value is indefinite.
    param Other

    type Other

    Geom2d_Vector

    rtype

    float

Coord()
  • Returns the coordinates of <self>.
    param X

    type X

    float

    param Y

    type Y

    float

    rtype

    None

Crossed()
  • Cross product of <self> with the vector <Other>.
    param Other

    type Other

    Geom2d_Vector

    rtype

    float

Dot()
  • Returns the scalar product of 2 Vectors.
    param Other

    type Other

    Geom2d_Vector

    rtype

    float

static DownCast(t)
Magnitude()
  • Returns the Magnitude of <self>.
    rtype

    float

Reverse()
  • Reverses the vector <self>.
    rtype

    None

Reversed()
  • Returns a copy of <self> reversed.
    rtype

    opencascade::handle<Geom2d_Vector>

SquareMagnitude()
  • Returns the square magnitude of <self>.
    rtype

    float

Vec2d()
  • Returns a non persistent copy of <self>.
    rtype

    gp_Vec2d

X()
  • Returns the X coordinate of <self>.
    rtype

    float

Y()
  • Returns the Y coordinate of <self>.
    rtype

    float

property thisown

The membership flag

class Geom2d_VectorWithMagnitude(*args)

Bases: OCC.Core.Geom2d.Geom2d_Vector

  • Creates a persistent copy of V.
    param V

    type V

    gp_Vec2d

    rtype

    None* Creates a vector with two cartesian coordinates.

    param X

    type X

    float

    param Y

    type Y

    float

    rtype

    None* Creates a vector from the point P1 to the point P2. The magnitude of the vector is the distance between P1 and P2

    param P1

    type P1

    gp_Pnt2d

    param P2

    type P2

    gp_Pnt2d

    rtype

    None

Add()
  • Adds the Vector Other to <self>.
    param Other

    type Other

    Geom2d_Vector

    rtype

    None

Added()
  • Adds the vector Other to <self>.
    param Other

    type Other

    Geom2d_Vector

    rtype

    opencascade::handle<Geom2d_VectorWithMagnitude>

Divide()
  • Divides <self> by a scalar.
    param Scalar

    type Scalar

    float

    rtype

    None

Divided()
  • Divides <self> by a scalar. A new vector is returned.
    param Scalar

    type Scalar

    float

    rtype

    opencascade::handle<Geom2d_VectorWithMagnitude>

static DownCast(t)
Multiplied()
  • Computes the product of the vector <self> by a scalar. A new vector is returned. //! -C++: alias operator * Collision with same operator defined for the class Vector!
    param Scalar

    type Scalar

    float

    rtype

    opencascade::handle<Geom2d_VectorWithMagnitude>

Multiply()
  • Computes the product of the vector <self> by a scalar.
    param Scalar

    type Scalar

    float

    rtype

    None

Normalize()
  • Normalizes <self>. //! Raised if the magnitude of the vector is lower or equal to Resolution from package gp.
    rtype

    None

Normalized()
  • Returns a copy of <self> Normalized. //! Raised if the magnitude of the vector is lower or equal to Resolution from package gp.
    rtype

    opencascade::handle<Geom2d_VectorWithMagnitude>

SetCoord()
  • Set <self> to X, Y coordinates.
    param X

    type X

    float

    param Y

    type Y

    float

    rtype

    None

SetVec2d()
Parameters

V

type V

gp_Vec2d

rtype

None

SetX()
  • Changes the X coordinate of <self>.
    param X

    type X

    float

    rtype

    None

SetY()
  • Changes the Y coordinate of <self>
    param Y

    type Y

    float

    rtype

    None

Subtract()
  • Subtracts the Vector Other to <self>.
    param Other

    type Other

    Geom2d_Vector

    rtype

    None

Subtracted()
  • Subtracts the vector Other to <self>. A new vector is returned.
    param Other

    type Other

    Geom2d_Vector

    rtype

    opencascade::handle<Geom2d_VectorWithMagnitude>

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()