OCC.Geom2d module

class OCC.Geom2d.Geom2d_AxisPlacement(*args)

Bases: OCC.Geom2d.Geom2d_Geometry

Angle()
  • Computes the angle between the ‘Direction’ of two axis placement in radians. The result is comprised between -Pi and Pi.
Parameters:Other (Handle_Geom2d_AxisPlacement &) –
Return type:float
Ax2d()
  • Converts this axis into a gp_Ax2d axis.
Return type:gp_Ax2d
Direction()
  • Returns the ‘Direction’ of <self>. -C++: return const&
Return type:gp_Dir2d
GetHandle()

Geom2d_AxisPlacement_GetHandle(Geom2d_AxisPlacement self) -> Handle_Geom2d_AxisPlacement

Location()
  • Returns the ‘Location’ point (origin) of the axis placement. -C++: return const&
Return type: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.
Return type:Handle_Geom2d_AxisPlacement
SetAxis()
  • Changes the complete definition of the axis placement.
Parameters:A (gp_Ax2d) –
Return type:None
SetDirection()
  • Changes the ‘Direction’ of the axis placement.
Parameters:V (gp_Dir2d) –
Return type:None
SetLocation()
  • Changes the ‘Location’ point (origin) of the axis placement.
Parameters:P (gp_Pnt2d) –
Return type:None
thisown

The membership flag

class OCC.Geom2d.Geom2d_BSplineCurve(*args)

Bases: OCC.Geom2d.Geom2d_BoundedCurve

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
Return type:int
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.
Return type:int
GetHandle()

Geom2d_BSplineCurve_GetHandle(Geom2d_BSplineCurve self) -> Handle_Geom2d_BSplineCurve

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().
Parameters:Degree (Standard_Integer) –
Return type: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]
Parameters:
  • Index (Standard_Integer) –
  • M (Standard_Integer) –
Return type:

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.
Parameters:
  • I1 (Standard_Integer) –
  • I2 (Standard_Integer) –
  • M (Standard_Integer) –
Return type:

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.
Parameters:
  • I1 (Standard_Integer) –
  • I2 (Standard_Integer) –
  • M (Standard_Integer) –
Return type:

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.
Parameters:
  • U (float) –
  • M (Standard_Integer) – default value is 1
  • ParametricTolerance (float) – default value is 0.0
Return type:

None

  • 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.
Parameters:
  • U (float) –
  • M (Standard_Integer) – default value is 1
  • ParametricTolerance (float) – default value is 0.0
Return type:

None

  • 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.
Parameters:
  • U (float) –
  • M (Standard_Integer) – default value is 1
  • ParametricTolerance (float) – default value is 0.0
Return type:

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.
Parameters:
  • Knots (TColStd_Array1OfReal &) –
  • Mults (TColStd_Array1OfInteger &) –
  • ParametricTolerance (float) – default value is 0.0
  • Add (bool) – default value is Standard_False
Return type:

None

  • 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.
Parameters:
  • Knots (TColStd_Array1OfReal &) –
  • Mults (TColStd_Array1OfInteger &) –
  • ParametricTolerance (float) – default value is 0.0
  • Add (bool) – default value is Standard_False
Return type:

None

  • 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.
Parameters:
  • Knots (TColStd_Array1OfReal &) –
  • Mults (TColStd_Array1OfInteger &) –
  • ParametricTolerance (float) – default value is 0.0
  • Add (bool) – default value is Standard_False
Return type:

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]
Parameters:
  • Index (Standard_Integer) –
  • P (gp_Pnt2d) –
  • Weight (float) – default value is 1.0
Return type:

None

  • 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]
Parameters:
  • Index (Standard_Integer) –
  • P (gp_Pnt2d) –
  • Weight (float) – default value is 1.0
Return type:

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]
Parameters:
  • Index (Standard_Integer) –
  • P (gp_Pnt2d) –
  • Weight (float) – default value is 1.0
Return type:

None

  • 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]
Parameters:
  • Index (Standard_Integer) –
  • P (gp_Pnt2d) –
  • Weight (float) – default value is 1.0
Return type:

None

IsRational()
  • Returns True if the weights are not identical. The tolerance criterion is Epsilon of the class Real.
Return type: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
Parameters:Index (Standard_Integer) –
Return type: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.
Return type:GeomAbs_BSplKnotDistribution
KnotSequence()
  • 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} Raised if the length of K is not equal to NbPoles + Degree + 1
Parameters:K (TColStd_Array1OfReal &) –
Return type:None
Knots()
  • returns the knot values of the B-spline curve; Raised if the length of K is not equal to the number of knots.
Parameters:K (TColStd_Array1OfReal &) –
Return type:None
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.
Return type:int
LocalD0()
Parameters:
  • U (float) –
  • FromK1 (Standard_Integer) –
  • ToK2 (Standard_Integer) –
  • P (gp_Pnt2d) –
Return type:

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. Raised if FromK1 and ToK2 are not in the range [FirstUKnotIndex, LastUKnotIndex].
Parameters:
  • U (float) –
  • FromK1 (Standard_Integer) –
  • ToK2 (Standard_Integer) –
  • P (gp_Pnt2d) –
  • V1 (gp_Vec2d) –
Return type:

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. Raised if FromK1 and ToK2 are not in the range [FirstUKnotIndex, LastUKnotIndex].
Parameters:
  • U (float) –
  • FromK1 (Standard_Integer) –
  • ToK2 (Standard_Integer) –
  • P (gp_Pnt2d) –
  • V1 (gp_Vec2d) –
  • V2 (gp_Vec2d) –
Return type:

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. Raised if FromK1 and ToK2 are not in the range [FirstUKnotIndex, LastUKnotIndex].
Parameters:
  • U (float) –
  • FromK1 (Standard_Integer) –
  • ToK2 (Standard_Integer) –
  • P (gp_Pnt2d) –
  • V1 (gp_Vec2d) –
  • V2 (gp_Vec2d) –
  • V3 (gp_Vec2d) –
Return type:

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. Raises if FromK1 and ToK2 are not in the range [FirstUKnotIndex, LastUKnotIndex].
Parameters:
  • U (float) –
  • FromK1 (Standard_Integer) –
  • ToK2 (Standard_Integer) –
  • N (Standard_Integer) –
Return type:

gp_Vec2d

LocalValue()
  • Raised if FromK1 = ToK2. Raised if FromK1 and ToK2 are not in the range [FirstUKnotIndex, LastUKnotIndex].
Parameters:
  • U (float) –
  • FromK1 (Standard_Integer) –
  • ToK2 (Standard_Integer) –
Return type:

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)
Parameters:
  • U (float) –
  • ParametricTolerance (float) –
  • I1 (Standard_Integer &) –
  • I2 (Standard_Integer &) –
  • WithKnotRepetition (bool) – default value is Standard_False
Return type:

None

  • 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)
Parameters:
  • U (float) –
  • ParametricTolerance (float) –
  • I1 (Standard_Integer &) –
  • I2 (Standard_Integer &) –
  • WithKnotRepetition (bool) – default value is Standard_False
Return type:

None

static MaxDegree()
  • Returns the value of the maximum degree of the normalized B-spline basis functions in this package.
Return type: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.
Parameters:
  • U (float) –
  • P (gp_Pnt2d) –
  • Index1 (Standard_Integer) –
  • Index2 (Standard_Integer) –
  • FirstModifiedPole (Standard_Integer &) –
  • LastModifiedPole (Standard_Integer &) –
Return type:

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
Parameters:
  • U (float) –
  • P (gp_Pnt2d) –
  • Tangent (gp_Vec2d) –
  • Tolerance (float) –
  • StartingCondition (Standard_Integer) –
  • EndingCondition (Standard_Integer) –
  • ErrorStatus (Standard_Integer &) –
Return type:

None

Multiplicities()
  • Returns the multiplicity of the knots of the curve. Raised if the length of M is not equal to NbKnots.
Parameters:M (TColStd_Array1OfInteger &) –
Return type:None
Multiplicity()
  • Returns the multiplicity of the knots of range Index. Raised if Index < 1 or Index > NbKnots
Parameters:Index (Standard_Integer) –
Return type:int
NbKnots()
  • Returns the number of knots. This method returns the number of knot without repetition of multiple knots.
Return type:int
NbPoles()
  • Returns the number of poles
Return type: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.
Parameters:U (float &) –
Return type:None
Pole()
  • Returns the pole of range Index. Raised if Index < 1 or Index > NbPoles.
Parameters:Index (Standard_Integer) –
Return type: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.
Parameters:P (TColgp_Array1OfPnt2d) –
Return type:None
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.
Parameters:
  • Index (Standard_Integer) –
  • M (Standard_Integer) –
  • Tolerance (float) –
Return type:

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]
Parameters:Index (Standard_Integer) –
Return type: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
Parameters:
  • ToleranceUV (float) –
  • UTolerance (float &) –
Return type:

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. Warnings : Even 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.
Parameters:
  • U1 (float) –
  • U2 (float) –
Return type:

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.
Parameters:
  • Index (Standard_Integer) –
  • K (float) –
Return type:

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.
Parameters:
  • Index (Standard_Integer) –
  • K (float) –
  • M (Standard_Integer) –
Return type:

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.
Parameters:K (TColStd_Array1OfReal &) –
Return type: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.
Return type: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.
Parameters:Index (Standard_Integer) –
Return type: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.
Return type: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.
Parameters:
  • Index (Standard_Integer) –
  • P (gp_Pnt2d) –
Return type:

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.
Parameters:
  • Index (Standard_Integer) –
  • P (gp_Pnt2d) –
  • Weight (float) –
Return type:

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.
Parameters:
  • Index (Standard_Integer) –
  • Weight (float) –
Return type:

None

Weight()
  • Returns the weight of the pole of range Index . Raised if Index < 1 or Index > NbPoles.
Parameters:Index (Standard_Integer) –
Return type:float
Weights()
  • Returns the weights of the B-spline curve; Raised if the length of W is not equal to NbPoles.
Parameters:W (TColStd_Array1OfReal &) –
Return type:None
thisown

The membership flag

OCC.Geom2d.Geom2d_BSplineCurve_MaxDegree()
  • Returns the value of the maximum degree of the normalized B-spline basis functions in this package.
Return type:int
class OCC.Geom2d.Geom2d_BezierCurve(*args)

Bases: OCC.Geom2d.Geom2d_BoundedCurve

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’.
Return type:int
GetHandle()

Geom2d_BezierCurve_GetHandle(Geom2d_BezierCurve self) -> Handle_Geom2d_BezierCurve

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>.
Parameters:Degree (Standard_Integer) –
Return type: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.
Parameters:
  • Index (Standard_Integer) –
  • P (gp_Pnt2d) –
  • Weight (float) – default value is 1.0
Return type:

None

  • 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.
Parameters:
  • Index (Standard_Integer) –
  • P (gp_Pnt2d) –
  • Weight (float) – default value is 1.0
Return type:

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.
Parameters:
  • Index (Standard_Integer) –
  • P (gp_Pnt2d) –
  • Weight (float) – default value is 1.0
Return type:

None

  • 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.
Parameters:
  • Index (Standard_Integer) –
  • P (gp_Pnt2d) –
  • Weight (float) – default value is 1.0
Return type:

None

IsRational()
  • Returns false if all the weights are identical. The tolerance criterion is Resolution from package gp.
Return type:bool
static MaxDegree()
  • Returns the value of the maximum polynomial degree of a BezierCurve. This value is 25.
Return type:int
NbPoles()
  • Returns the number of poles for this Bezier curve.
Return type:int
Pole()
  • Returns the pole of range Index. Raised if Index is not in the range [1, NbPoles]
Parameters:Index (Standard_Integer) –
Return type:gp_Pnt2d
Poles()
  • Returns all the poles of the curve. Raised if the length of P is not equal to the number of poles.
Parameters:P (TColgp_Array1OfPnt2d) –
Return type:None
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]
Parameters:Index (Standard_Integer) –
Return type: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
Parameters:
  • ToleranceUV (float) –
  • UTolerance (float &) –
Return type:

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. Warnings : Even 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.
Parameters:
  • U1 (float) –
  • U2 (float) –
Return type:

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]
Parameters:
  • Index (Standard_Integer) –
  • P (gp_Pnt2d) –
Return type:

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
Parameters:
  • Index (Standard_Integer) –
  • P (gp_Pnt2d) –
  • Weight (float) –
Return type:

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
Parameters:
  • Index (Standard_Integer) –
  • Weight (float) –
Return type:

None

Weight()
  • Returns the weight of range Index. Raised if Index is not in the range [1, NbPoles]
Parameters:Index (Standard_Integer) –
Return type:float
Weights()
  • Returns all the weights of the curve. Raised if the length of W is not equal to the number of poles.
Parameters:W (TColStd_Array1OfReal &) –
Return type:None
thisown

The membership flag

OCC.Geom2d.Geom2d_BezierCurve_MaxDegree()
  • Returns the value of the maximum polynomial degree of a BezierCurve. This value is 25.
Return type:int
class OCC.Geom2d.Geom2d_BoundedCurve(*args, **kwargs)

Bases: OCC.Geom2d.Geom2d_Curve

EndPoint()
  • Returns the end point of the curve. The end point is the value of the curve for the ‘LastParameter’ of the curve.
Return type:gp_Pnt2d
GetHandle()

Geom2d_BoundedCurve_GetHandle(Geom2d_BoundedCurve self) -> Handle_Geom2d_BoundedCurve

StartPoint()
  • Returns the start point of the curve. The start point is the value of the curve for the ‘FirstParameter’ of the curve.
Return type:gp_Pnt2d
thisown

The membership flag

class OCC.Geom2d.Geom2d_CartesianPoint(*args)

Bases: OCC.Geom2d.Geom2d_Point

GetHandle()

Geom2d_CartesianPoint_GetHandle(Geom2d_CartesianPoint self) -> Handle_Geom2d_CartesianPoint

SetCoord()
  • Set <self> to X, Y coordinates.
Parameters:
  • X (float) –
  • Y (float) –
Return type:

None

SetPnt2d()
  • Set <self> to P.X(), P.Y() coordinates.
Parameters:P (gp_Pnt2d) –
Return type:None
SetX()
  • Changes the X coordinate of me.
Parameters:X (float) –
Return type:None
SetY()
  • Changes the Y coordinate of me.
Parameters:Y (float) –
Return type:None
thisown

The membership flag

class OCC.Geom2d.Geom2d_Circle(*args)

Bases: OCC.Geom2d.Geom2d_Conic

Circ2d()
  • Returns the non persistent circle from gp with the same geometric properties as <self>.
Return type:gp_Circ2d
GetHandle()

Geom2d_Circle_GetHandle(Geom2d_Circle self) -> Handle_Geom2d_Circle

Radius()
  • Returns the radius of this circle.
Return type:float
SetCirc2d()
  • Converts the gp_Circ2d circle C into this circle.
Parameters:C (gp_Circ2d) –
Return type:None
SetRadius()
Parameters:R (float) –
Return type:None
thisown

The membership flag

class OCC.Geom2d.Geom2d_Conic(*args, **kwargs)

Bases: OCC.Geom2d.Geom2d_Curve

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
Return type:float
GetHandle()

Geom2d_Conic_GetHandle(Geom2d_Conic self) -> Handle_Geom2d_Conic

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.
Return type:gp_Pnt2d
Position()
  • Returns the local coordinates system of the conic.
Return type:gp_Ax22d
SetAxis()
  • Modifies this conic, redefining its local coordinate system partially, by assigning P as its origin
Parameters:A (gp_Ax22d) –
Return type:None
SetLocation()
  • Modifies this conic, redefining its local coordinate system fully, by assigning A as this coordinate system.
Parameters:P (gp_Pnt2d) –
Return type:None
SetXAxis()
Parameters:A (gp_Ax2d) –
Return type: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).
Parameters:A (gp_Ax2d) –
Return type: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&
Return type:gp_Ax2d
YAxis()
  • Returns the ‘YAxis’ of the conic. The ‘YAxis’ is perpendicular to the ‘Xaxis’.
Return type:gp_Ax2d
thisown

The membership flag

class OCC.Geom2d.Geom2d_Curve(*args, **kwargs)

Bases: OCC.Geom2d.Geom2d_Geometry

Continuity()
  • It is the global continuity of the curve : C0 : only geometric continuity, C1 : continuity of the first derivative all along the Curve, C2 : continuity of the second derivative all along the Curve, C3 : continuity of the third derivative all along the Curve, G1 : tangency continuity all along the Curve, G2 : curvature continuity all along the Curve, CN : the order of continuity is infinite.
Return type: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.
Parameters:
  • U (float) –
  • P (gp_Pnt2d) –
Return type:

void

D1()
  • Returns the point P of parameter U and the first derivative V1. Raised if the continuity of the curve is not C1.
Parameters:
  • U (float) –
  • P (gp_Pnt2d) –
  • V1 (gp_Vec2d) –
Return type:

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.
Parameters:
  • U (float) –
  • P (gp_Pnt2d) –
  • V1 (gp_Vec2d) –
  • V2 (gp_Vec2d) –
Return type:

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.
Parameters:
  • U (float) –
  • P (gp_Pnt2d) –
  • V1 (gp_Vec2d) –
  • V2 (gp_Vec2d) –
  • V3 (gp_Vec2d) –
Return type:

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.
Parameters:
  • U (float) –
  • N (Standard_Integer) –
Return type:

gp_Vec2d

FirstParameter()
  • Returns the value of the first parameter. Warnings : It can be RealFirst or RealLast from package Standard if the curve is infinite
Return type:float
GetHandle()

Geom2d_Curve_GetHandle(Geom2d_Curve self) -> Handle_Geom2d_Curve

IsCN()
  • Returns true if the degree of continuity of this curve is at least N. Exceptions Standard_RangeError if N is less than 0.
Parameters:N (Standard_Integer) –
Return type:bool
IsClosed()
  • Returns true if the curve is closed. Examples : Some 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.
Return type: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 satisfied : for 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 is : if 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.
Return type:bool
LastParameter()
  • Value of the last parameter. Warnings : It can be RealFirst or RealLast from package Standard if the curve is infinite
Return type: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).
Parameters:T (gp_Trsf2d) –
Return type:float
Period()
  • Returns thne period of this curve. raises if the curve is not periodic
Return type: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.
Return type: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.
Return type: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.
Parameters:U (float) –
Return type: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).
Parameters:
  • U (float) –
  • T (gp_Trsf2d) –
Return type:

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.
Parameters:U (float) –
Return type:gp_Pnt2d
thisown

The membership flag

class OCC.Geom2d.Geom2d_Direction(*args)

Bases: OCC.Geom2d.Geom2d_Vector

Dir2d()
  • Converts this unit vector into a gp_Dir2d unit vector.
Return type:gp_Dir2d
GetHandle()

Geom2d_Direction_GetHandle(Geom2d_Direction self) -> Handle_Geom2d_Direction

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().
Parameters:
  • X (float) –
  • Y (float) –
Return type:

None

SetDir2d()
  • Converts the gp_Dir2d unit vector V into this unit vector.
Parameters:V (gp_Dir2d) –
Return type: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().
Parameters:X (float) –
Return type: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().
Parameters:Y (float) –
Return type:None
thisown

The membership flag

class OCC.Geom2d.Geom2d_Ellipse(*args)

Bases: OCC.Geom2d.Geom2d_Conic

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)
Return type: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).
Return type:gp_Ax2d
Elips2d()
  • Converts this ellipse into a gp_Elips2d ellipse.
Return type:gp_Elips2d
Focal()
  • Computes the focal distance. The focal distance is the distance between the center and a focus of the ellipse.
Return type:float
Focus1()
  • Returns the first focus of the ellipse. This focus is on the positive side of the ‘XAxis’ of the ellipse.
Return type:gp_Pnt2d
Focus2()
  • Returns the second focus of the ellipse. This focus is on the negative side of the ‘XAxis’ of the ellipse.
Return type:gp_Pnt2d
GetHandle()

Geom2d_Ellipse_GetHandle(Geom2d_Ellipse self) -> Handle_Geom2d_Ellipse

MajorRadius()
  • Returns the major radius of this ellipse.
Return type:float
MinorRadius()
  • Returns the minor radius of this ellipse.
Return type: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
Return type:float
SetElips2d()
  • Converts the gp_Elips2d ellipse E into this ellipse.
Parameters:E (gp_Elips2d) –
Return type: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.
Parameters:MajorRadius (float) –
Return type: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.
Parameters:MinorRadius (float) –
Return type:None
thisown

The membership flag

class OCC.Geom2d.Geom2d_Geometry(*args, **kwargs)

Bases: OCC.MMgt.MMgt_TShared

Copy()
Return type:Handle_Geom2d_Geometry
GetHandle()

Geom2d_Geometry_GetHandle(Geom2d_Geometry self) -> Handle_Geom2d_Geometry

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.
Parameters:P (gp_Pnt2d) –
Return type:None
  • Performs the symmetrical transformation of a Geometry with respect to an axis placement which is the axis of the symmetry.
Parameters:A (gp_Ax2d) –
Return type:None
Mirrored()
Parameters:
  • P (gp_Pnt2d) –
  • A (gp_Ax2d) –
Return type:

Handle_Geom2d_Geometry

Return type:

Handle_Geom2d_Geometry

Rotate()
  • Rotates a Geometry. P is the center of the rotation. Ang is the angular value of the rotation in radians.
Parameters:
  • P (gp_Pnt2d) –
  • Ang (float) –
Return type:

None

Rotated()
Parameters:
  • P (gp_Pnt2d) –
  • Ang (float) –
Return type:

Handle_Geom2d_Geometry

Scale()
  • Scales a Geometry. S is the scaling value.
Parameters:
  • P (gp_Pnt2d) –
  • S (float) –
Return type:

None

Scaled()
Parameters:
  • P (gp_Pnt2d) –
  • S (float) –
Return type:

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.
Parameters:T (gp_Trsf2d) –
Return type:void
Transformed()
Parameters:T (gp_Trsf2d) –
Return type:Handle_Geom2d_Geometry
Translate()
  • Translates a Geometry. V is the vector of the tanslation.
Parameters:V (gp_Vec2d) –
Return type:None
  • Translates a Geometry from the point P1 to the point P2.
Parameters:
  • P1 (gp_Pnt2d) –
  • P2 (gp_Pnt2d) –
Return type:

None

Translated()
Parameters:
  • V (gp_Vec2d) –
  • P1 (gp_Pnt2d) –
  • P2 (gp_Pnt2d) –
Return type:

Handle_Geom2d_Geometry

Return type:

Handle_Geom2d_Geometry

thisown

The membership flag

class OCC.Geom2d.Geom2d_Hyperbola(*args)

Bases: OCC.Geom2d.Geom2d_Conic

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
Return type: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
Return type: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.
Return type: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.
Return type: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’.
Return type:gp_Ax2d
Directrix2()
  • This line is obtained by the symmetrical transformation of ‘Directrix1’ with respect to the ‘YAxis’ of the hyperbola.
Return type:gp_Ax2d
Focal()
  • Computes the focal distance. It is the distance between the two focus of the hyperbola.
Return type:float
Focus1()
  • Returns the first focus of the hyperbola. This focus is on the positive side of the ‘XAxis’ of the hyperbola.
Return type:gp_Pnt2d
Focus2()
  • Returns the second focus of the hyperbola. This focus is on the negative side of the ‘XAxis’ of the hyperbola.
Return type:gp_Pnt2d
GetHandle()

Geom2d_Hyperbola_GetHandle(Geom2d_Hyperbola self) -> Handle_Geom2d_Hyperbola

Hypr2d()
  • Converts this hyperbola into a gp_Hypr2d one.
Return type: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).
Return type: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).
Return type: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.
Return type: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.
Return type:float
SetHypr2d()
  • Converts the gp_Hypr2d hyperbola H into this hyperbola.
Parameters:H (gp_Hypr2d) –
Return type: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.
Parameters:MajorRadius (float) –
Return type: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.
Parameters:MinorRadius (float) –
Return type:None
thisown

The membership flag

class OCC.Geom2d.Geom2d_Line(*args)

Bases: OCC.Geom2d.Geom2d_Curve

Direction()
  • changes the direction of the line.
Return type:gp_Dir2d
Distance()
  • Computes the distance between <self> and the point P.
Parameters:P (gp_Pnt2d) –
Return type:float
GetHandle()

Geom2d_Line_GetHandle(Geom2d_Line self) -> Handle_Geom2d_Line

Lin2d()
  • Returns non persistent line from gp with the same geometric properties as <self>
Return type:gp_Lin2d
Location()
  • Changes the ‘Location’ point (origin) of the line.
Return type:gp_Pnt2d
Position()
Return type:gp_Ax2d
SetDirection()
  • changes the direction of the line.
Parameters:V (gp_Dir2d) –
Return type:None
SetLin2d()
  • Set <self> so that <self> has the same geometric properties as L.
Parameters:L (gp_Lin2d) –
Return type:None
SetLocation()
  • Changes the ‘Location’ point (origin) of the line.
Parameters:P (gp_Pnt2d) –
Return type:None
SetPosition()
  • Changes the ‘Location’ and a the ‘Direction’ of <self>.
Parameters:A (gp_Ax2d) –
Return type:None
thisown

The membership flag

class OCC.Geom2d.Geom2d_OffsetCurve(*args)

Bases: OCC.Geom2d.Geom2d_Curve

BasisCurve()
  • Returns the basis curve of this offset curve. The basis curve can be an offset curve.
Return type:Handle_Geom2d_Curve
D1()
  • Warning! this should not be called if the continuity of the basis curve is not C2. Nevertheless, it’s OK to use it on portion where the curve is C2
Parameters:
  • U (float) –
  • P (gp_Pnt2d) –
  • V1 (gp_Vec2d) –
Return type:

None

  • Warning! this should not be called if the continuity of the basis curve is not C1. Nevertheless, it’s OK to use it on portion where the curve is C1
Parameters:
  • U (float) –
  • P (gp_Pnt2d) –
  • Pbasis (gp_Pnt2d) –
  • V1 (gp_Vec2d) –
  • V1basis (gp_Vec2d) –
  • V2basis (gp_Vec2d) –
Return type:

None

D2()
  • Warning! This should not be called if the continuity of the basis curve is not C3. Nevertheless, it’s OK to use it on portion where the curve is C3
Parameters:
  • U (float) –
  • P (gp_Pnt2d) –
  • V1 (gp_Vec2d) –
  • V2 (gp_Vec2d) –
Return type:

None

  • Warning! this should not be called if the continuity of the basis curve is not C3. Nevertheless, it’s OK to use it on portion where the curve is C3
Parameters:
  • U (float) –
  • P (gp_Pnt2d) –
  • Pbasis (gp_Pnt2d) –
  • V1 (gp_Vec2d) –
  • V2 (gp_Vec2d) –
  • V1basis (gp_Vec2d) –
  • V2basis (gp_Vec2d) –
  • V3basis (gp_Vec2d) –
Return type:

None

GetHandle()

Geom2d_OffsetCurve_GetHandle(Geom2d_OffsetCurve self) -> Handle_Geom2d_OffsetCurve

Offset()
  • Returns the offset value of this offset curve.
Return type:float
SetBasisCurve()
  • Changes this offset curve by assigning C as the basis curve from which it is built. Exceptions Standard_ConstructionError if the curve C is not at least ‘C1’ continuous.
Parameters:C (Handle_Geom2d_Curve &) –
Return type:None
SetOffsetValue()
  • Changes this offset curve by assigning D as the offset value.
Parameters:D (float) –
Return type:None
Value()
  • Warning! this should not be called if the basis curve is not at least C1. Nevertheless if used on portion where the curve is C1, it is OK
Parameters:
  • U (float) –
  • P (gp_Pnt2d) –
  • Pbasis (gp_Pnt2d) –
  • V1basis (gp_Vec2d) –
Return type:

None

thisown

The membership flag

class OCC.Geom2d.Geom2d_Parabola(*args)

Bases: OCC.Geom2d.Geom2d_Conic

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.
Return type:gp_Ax2d
Focal()
  • Computes the focal length of this parabola. The focal length is the distance between the apex and the focus of the parabola.
Return type: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.
Return type:gp_Pnt2d
GetHandle()

Geom2d_Parabola_GetHandle(Geom2d_Parabola self) -> Handle_Geom2d_Parabola

Parab2d()
  • Returns the non persistent parabola from gp with the same geometric properties as <self>.
Return type: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.
Return type:float
SetFocal()
  • Assigns the value Focal to the focal length of this parabola. Exceptions Standard_ConstructionError if Focal is negative.
Parameters:Focal (float) –
Return type:None
SetParab2d()
  • Converts the gp_Parab2d parabola Prb into this parabola.
Parameters:Prb (gp_Parab2d) –
Return type:None
thisown

The membership flag

class OCC.Geom2d.Geom2d_Point(*args, **kwargs)

Bases: OCC.Geom2d.Geom2d_Geometry

Coord()
  • returns the Coordinates of <self>.
Parameters:
  • X (float &) –
  • Y (float &) –
Return type:

void

Distance()
  • computes the distance between <self> and <Other>.
Parameters:Other (Handle_Geom2d_Point &) –
Return type:float
GetHandle()

Geom2d_Point_GetHandle(Geom2d_Point self) -> Handle_Geom2d_Point

Pnt2d()
  • returns a non persistent copy of <self>
Return type:gp_Pnt2d
SquareDistance()
  • computes the square distance between <self> and <Other>.
Parameters:Other (Handle_Geom2d_Point &) –
Return type:float
X()
  • returns the X coordinate of <self>.
Return type:float
Y()
  • returns the Y coordinate of <self>.
Return type:float
thisown

The membership flag

class OCC.Geom2d.Geom2d_Transformation(*args)

Bases: OCC.MMgt.MMgt_TShared

Copy()
  • Creates a new object, which is a copy of this transformation.
Return type:Handle_Geom2d_Transformation
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
Return type:gp_TrsfForm
GetHandle()

Geom2d_Transformation_GetHandle(Geom2d_Transformation self) -> Handle_Geom2d_Transformation

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.
Return type: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.
Return type: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.
Return type:bool
Multiplied()
  • Computes the transformation composed with Other and <self>. <self> * Other. Returns a new transformation
Parameters:Other (Handle_Geom2d_Transformation &) –
Return type: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()
Parameters:Other (Handle_Geom2d_Transformation &) –
Return type:None
Power()
  • Raised if N < 0 and if the transformation is not inversible
Parameters:N (Standard_Integer) –
Return type:None
Powered()
  • Raised if N < 0 and if the transformation is not inversible
Parameters:N (Standard_Integer) –
Return type:Handle_Geom2d_Transformation
PreMultiply()
  • Computes the matrix of the transformation composed with <self> and Other. <self> = Other * <self>
Parameters:Other (Handle_Geom2d_Transformation &) –
Return type:None
ScaleFactor()
  • Returns the scale value of the transformation.
Return type:float
SetMirror()
  • Makes the transformation into a symmetrical transformation with respect to a point P. P is the center of the symmetry.
Parameters:P (gp_Pnt2d) –
Return type:None
  • Makes the transformation into a symmetrical transformation with respect to an axis A. A is the center of the axial symmetry.
Parameters:A (gp_Ax2d) –
Return type:None
SetRotation()
  • Assigns to this transformation the geometric properties of a rotation at angle Ang (in radians) about point P.
Parameters:
  • P (gp_Pnt2d) –
  • Ang (float) –
Return type:

None

SetScale()
  • Makes the transformation into a scale. P is the center of the scale and S is the scaling value.
Parameters:
  • P (gp_Pnt2d) –
  • S (float) –
Return type:

None

SetTransformation()
  • Makes a transformation allowing passage from the coordinate system ‘FromSystem1’ to the coordinate system ‘ToSystem2’.
Parameters:
  • FromSystem1 (gp_Ax2d) –
  • ToSystem2 (gp_Ax2d) –
Return type:

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.
Parameters:ToSystem (gp_Ax2d) –
Return type:None
SetTranslation()
  • Makes the transformation into a translation. V is the vector of the translation.
Parameters:V (gp_Vec2d) –
Return type:None
  • Makes the transformation into a translation from the point P1 to the point P2.
Parameters:
  • P1 (gp_Pnt2d) –
  • P2 (gp_Pnt2d) –
Return type:

None

SetTrsf2d()
  • Makes the transformation into a transformation T from package gp.
Parameters:T (gp_Trsf2d) –
Return type:None
Transforms()
  • Applies the transformation <self> to the triplet {X, Y}.
Parameters:
  • X (float &) –
  • Y (float &) –
Return type:

None

Trsf2d()
  • Converts this transformation into a gp_Trsf2d transformation. Returns a non persistent copy of <self>. -C++: return const&
Return type: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.
Parameters:
  • Row (Standard_Integer) –
  • Col (Standard_Integer) –
Return type:

float

thisown

The membership flag

class OCC.Geom2d.Geom2d_TrimmedCurve(*args)

Bases: OCC.Geom2d.Geom2d_BoundedCurve

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.
Return type:Handle_Geom2d_Curve
GetHandle()

Geom2d_TrimmedCurve_GetHandle(Geom2d_TrimmedCurve self) -> Handle_Geom2d_TrimmedCurve

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, 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. 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.
Parameters:
  • U1 (float) –
  • U2 (float) –
  • Sense (bool) – default value is Standard_True
Return type:

None

  • 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, 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. 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.
Parameters:
  • U1 (float) –
  • U2 (float) –
  • Sense (bool) – default value is Standard_True
Return type:

None

thisown

The membership flag

class OCC.Geom2d.Geom2d_Vector(*args, **kwargs)

Bases: OCC.Geom2d.Geom2d_Geometry

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.
Parameters:Other (Handle_Geom2d_Vector &) –
Return type:float
Coord()
  • Returns the coordinates of <self>.
Parameters:
  • X (float &) –
  • Y (float &) –
Return type:

None

Crossed()
  • Cross product of <self> with the vector <Other>.
Parameters:Other (Handle_Geom2d_Vector &) –
Return type:float
Dot()
  • Returns the scalar product of 2 Vectors.
Parameters:Other (Handle_Geom2d_Vector &) –
Return type:float
GetHandle()

Geom2d_Vector_GetHandle(Geom2d_Vector self) -> Handle_Geom2d_Vector

Magnitude()
  • Returns the Magnitude of <self>.
Return type:float
Reverse()
  • Reverses the vector <self>.
Return type:None
Reversed()
  • Returns a copy of <self> reversed.
Return type:Handle_Geom2d_Vector
SquareMagnitude()
  • Returns the square magnitude of <self>.
Return type:float
Vec2d()
  • Returns a non persistent copy of <self>.
Return type:gp_Vec2d
X()
  • Returns the X coordinate of <self>.
Return type:float
Y()
  • Returns the Y coordinate of <self>.
Return type:float
thisown

The membership flag

class OCC.Geom2d.Geom2d_VectorWithMagnitude(*args)

Bases: OCC.Geom2d.Geom2d_Vector

Add()
  • Adds the Vector Other to <self>.
Parameters:Other (Handle_Geom2d_Vector &) –
Return type:None
Added()
  • Adds the vector Other to <self>.
Parameters:Other (Handle_Geom2d_Vector &) –
Return type:Handle_Geom2d_VectorWithMagnitude
Divide()
  • Divides <self> by a scalar.
Parameters:Scalar (float) –
Return type:None
Divided()
  • Divides <self> by a scalar. A new vector is returned.
Parameters:Scalar (float) –
Return type:Handle_Geom2d_VectorWithMagnitude
GetHandle()

Geom2d_VectorWithMagnitude_GetHandle(Geom2d_VectorWithMagnitude self) -> Handle_Geom2d_VectorWithMagnitude

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!
Parameters:Scalar (float) –
Return type:Handle_Geom2d_VectorWithMagnitude
Multiply()
  • Computes the product of the vector <self> by a scalar.
Parameters:Scalar (float) –
Return type:None
Normalize()
  • Normalizes <self>. Raised if the magnitude of the vector is lower or equal to Resolution from package gp.
Return type:None
Normalized()
  • Returns a copy of <self> Normalized. Raised if the magnitude of the vector is lower or equal to Resolution from package gp.
Return type:Handle_Geom2d_VectorWithMagnitude
SetCoord()
  • Set <self> to X, Y coordinates.
Parameters:
  • X (float) –
  • Y (float) –
Return type:

None

SetVec2d()
Parameters:V (gp_Vec2d) –
Return type:None
SetX()
  • Changes the X coordinate of <self>.
Parameters:X (float) –
Return type:None
SetY()
  • Changes the Y coordinate of <self>
Parameters:Y (float) –
Return type:None
Subtract()
  • Subtracts the Vector Other to <self>.
Parameters:Other (Handle_Geom2d_Vector &) –
Return type:None
Subtracted()
  • Subtracts the vector Other to <self>. A new vector is returned.
Parameters:Other (Handle_Geom2d_Vector &) –
Return type:Handle_Geom2d_VectorWithMagnitude
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_AxisPlacement(*args)

Bases: OCC.Geom2d.Handle_Geom2d_Geometry

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_BSplineCurve(*args)

Bases: OCC.Geom2d.Handle_Geom2d_BoundedCurve

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_BezierCurve(*args)

Bases: OCC.Geom2d.Handle_Geom2d_BoundedCurve

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_BoundedCurve(*args)

Bases: OCC.Geom2d.Handle_Geom2d_Curve

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_CartesianPoint(*args)

Bases: OCC.Geom2d.Handle_Geom2d_Point

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_Circle(*args)

Bases: OCC.Geom2d.Handle_Geom2d_Conic

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_Conic(*args)

Bases: OCC.Geom2d.Handle_Geom2d_Curve

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_Curve(*args)

Bases: OCC.Geom2d.Handle_Geom2d_Geometry

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_Direction(*args)

Bases: OCC.Geom2d.Handle_Geom2d_Vector

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_Ellipse(*args)

Bases: OCC.Geom2d.Handle_Geom2d_Conic

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_Geometry(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_Hyperbola(*args)

Bases: OCC.Geom2d.Handle_Geom2d_Conic

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_Line(*args)

Bases: OCC.Geom2d.Handle_Geom2d_Curve

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_OffsetCurve(*args)

Bases: OCC.Geom2d.Handle_Geom2d_Curve

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_Parabola(*args)

Bases: OCC.Geom2d.Handle_Geom2d_Conic

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_Point(*args)

Bases: OCC.Geom2d.Handle_Geom2d_Geometry

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_Transformation(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_TrimmedCurve(*args)

Bases: OCC.Geom2d.Handle_Geom2d_BoundedCurve

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_Vector(*args)

Bases: OCC.Geom2d.Handle_Geom2d_Geometry

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.Handle_Geom2d_VectorWithMagnitude(*args)

Bases: OCC.Geom2d.Handle_Geom2d_Vector

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class OCC.Geom2d.SwigPyIterator(*args, **kwargs)

Bases: object

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

The membership flag

value()