ElCLib
OCCT package ElCLib: ElCLib.
ElCLib
Provides functions for basic geometric computations on elementary curves such as conics and lines in 2D and 3D space. This includes:
- calculation of a point or derived vector on a 2D or 3D curve where:
- the curve is provided by the gp package, or defined in reference form (as in the gp package), and
- the point is defined by a parameter,
- evaluation of the parameter corresponding to a point on a 2D or 3D curve from gp,
- various elementary computations which allow you to position parameterized values within the period of a curve. Notes:
ElCLibstands for Elementary Curves Library.- If the curves provided by the gp package are not explicitly parameterized, they still have an implicit parameterization, analogous to that which they infer for the equivalent Geom or Geom2d curves.
Constructors(1)
Static methods(120)
- InPeriod(U: number, UFirst: number, ULast: number): number
Return a value in the range <UFirst, ULast> by adding or removing the period <ULast - UFirst> to . ATTENTION!!! It is expected but not checked that (ULast > UFirst).
Parameters (3)UUFirstULast
- AdjustPeriodic(UFirst: number, ULast: number, Precision: number, U1: number, U2: number): { U1: number; U2: number }
Adjust U1 and U2 in the parametric range UFirst Ulast of a periodic curve, where ULast - UFirst is its period. To do this, this function:
- sets U1 in the range [ UFirst, ULast ] by adding/removing the period to/from the value U1, then
- sets U2 in the range [ U1, U1 + period ] by adding/removing the period to/from the value U2.
Precisionis used to test the equalities.
Parameters (5)UFirstULastPrecisionU1U2
ReturnsA result object with fields:
U1: updated value from the call.U2: updated value from the call.
- Parameters (2)
UL
- Parameters (2)
UC
- Parameters (2)
UE
- Parameters (2)
UH
- Parameters (2)
UPrb
- Parameters (2)
UL
- Parameters (2)
UC
- Value(U: number, E: gp_Elips2d): gp_Pnt2dParameters (2)
UE
- Parameters (2)
UH
- Value(U: number, Prb: gp_Parab2d): gp_Pnt2dParameters (2)
UPrb
For elementary curves (lines, circles and conics) from the gp package, computes:
Parameters (4)ULP—Mutated in place; read the updated value from this argument after the call.V1—Mutated in place; read the updated value from this argument after the call.
- Parameters (4)
UCPV1
- Parameters (4)
UEPV1
- Parameters (4)
UHPV1
- Parameters (4)
UPrbPV1
- Parameters (4)
ULPV1
- Parameters (4)
UCPV1
- D1(U: number, E: gp_Elips2d, P: gp_Pnt2d, V1: gp_Vec2d): voidParameters (4)
UEPV1
- Parameters (4)
UHPV1
- D1(U: number, Prb: gp_Parab2d, P: gp_Pnt2d, V1: gp_Vec2d): voidParameters (4)
UPrbPV1
For elementary curves (circles and conics) from the gp package, computes:
Parameters (5)UCP—Mutated in place; read the updated value from this argument after the call.V1—Mutated in place; read the updated value from this argument after the call.V2—Mutated in place; read the updated value from this argument after the call.
- Parameters (5)
UEPV1V2
- Parameters (5)
UHPV1V2
- Parameters (5)
UPrbPV1V2
- Parameters (5)
UCPV1V2
- D2(U: number, E: gp_Elips2d, P: gp_Pnt2d, V1: gp_Vec2d, V2: gp_Vec2d): voidParameters (5)
UEPV1V2
- Parameters (5)
UHPV1V2
- D2(U: number, Prb: gp_Parab2d, P: gp_Pnt2d, V1: gp_Vec2d, V2: gp_Vec2d): voidParameters (5)
UPrbPV1V2
For elementary curves (circles, ellipses and hyperbolae) from the gp package, computes:
Parameters (6)UCP—Mutated in place; read the updated value from this argument after the call.V1—Mutated in place; read the updated value from this argument after the call.V2—Mutated in place; read the updated value from this argument after the call.V3—Mutated in place; read the updated value from this argument after the call.
- Parameters (6)
UEPV1V2V3
- Parameters (6)
UHPV1V2V3
- Parameters (6)
UCPV1V2V3
- Parameters (6)
UEPV1V2V3
In the following functions N is the order of derivation and should be greater than 0.
Parameters (6)UHP—Mutated in place; read the updated value from this argument after the call.V1—Mutated in place; read the updated value from this argument after the call.V2—Mutated in place; read the updated value from this argument after the call.V3—Mutated in place; read the updated value from this argument after the call.
For elementary curves (lines, circles and conics) from the gp package, computes the vector corresponding to the Nth derivative at the point of parameter U. The result is either:
Parameters (3)ULN
- Parameters (3)
UCN
- Parameters (3)
UEN
- Parameters (3)
UHN
- Parameters (3)
UPrbN
- Parameters (3)
ULN
- Parameters (3)
UCN
- DN(U: number, E: gp_Elips2d, N: number): gp_Vec2dParameters (3)
UEN
- Parameters (3)
UHN
- DN(U: number, Prb: gp_Parab2d, N: number): gp_Vec2dParameters (3)
UPrbN
Curve evaluation The following basis functions compute the derivatives on elementary curves defined by their geometric characteristics. These functions can be called without constructing a conic from package gp. They are called by the previous functions. Example : A circle is defined by its position and its radius.
Parameters (2)UPos
- Parameters (2)
UPos
- CircleValue(U: number, Pos: gp_Ax2, Radius: number): gp_PntParameters (3)
UPosRadius
- CircleValue(U: number, Pos: gp_Ax22d, Radius: number): gp_Pnt2dParameters (3)
UPosRadius
- EllipseValue(U: number, Pos: gp_Ax2, MajorRadius: number, MinorRadius: number): gp_PntParameters (4)
UPosMajorRadiusMinorRadius
- EllipseValue(U: number, Pos: gp_Ax22d, MajorRadius: number, MinorRadius: number): gp_Pnt2dParameters (4)
UPosMajorRadiusMinorRadius
- HyperbolaValue(U: number, Pos: gp_Ax2, MajorRadius: number, MinorRadius: number): gp_PntParameters (4)
UPosMajorRadiusMinorRadius
- HyperbolaValue(U: number, Pos: gp_Ax22d, MajorRadius: number, MinorRadius: number): gp_Pnt2dParameters (4)
UPosMajorRadiusMinorRadius
- ParabolaValue(U: number, Pos: gp_Ax2, Focal: number): gp_PntParameters (3)
UPosFocal
- ParabolaValue(U: number, Pos: gp_Ax22d, Focal: number): gp_Pnt2dParameters (3)
UPosFocal
- Parameters (4)
UPosPV1
- Parameters (4)
UPosPV1
- Parameters (5)
UPosRadiusPV1
- Parameters (5)
UPosRadiusPV1
- EllipseD1(U: number, Pos: gp_Ax2, MajorRadius: number, MinorRadius: number, P: gp_Pnt, V1: gp_Vec): voidParameters (6)
UPosMajorRadiusMinorRadiusPV1
- EllipseD1(U: number, Pos: gp_Ax22d, MajorRadius: number, MinorRadius: number, P: gp_Pnt2d, V1: gp_Vec2d): voidParameters (6)
UPosMajorRadiusMinorRadiusPV1
- HyperbolaD1(U: number, Pos: gp_Ax2, MajorRadius: number, MinorRadius: number, P: gp_Pnt, V1: gp_Vec): voidParameters (6)
UPosMajorRadiusMinorRadiusPV1
- HyperbolaD1(U: number, Pos: gp_Ax22d, MajorRadius: number, MinorRadius: number, P: gp_Pnt2d, V1: gp_Vec2d): voidParameters (6)
UPosMajorRadiusMinorRadiusPV1
- ParabolaD1(U: number, Pos: gp_Ax2, Focal: number, P: gp_Pnt, V1: gp_Vec): voidParameters (5)
UPosFocalPV1
- ParabolaD1(U: number, Pos: gp_Ax22d, Focal: number, P: gp_Pnt2d, V1: gp_Vec2d): voidParameters (5)
UPosFocalPV1
- Parameters (6)
UPosRadiusPV1V2
- Parameters (6)
UPosRadiusPV1V2
- EllipseD2(U: number, Pos: gp_Ax2, MajorRadius: number, MinorRadius: number, P: gp_Pnt, V1: gp_Vec, V2: gp_Vec): voidParameters (7)
UPosMajorRadiusMinorRadiusPV1V2
- EllipseD2(U: number, Pos: gp_Ax22d, MajorRadius: number, MinorRadius: number, P: gp_Pnt2d, V1: gp_Vec2d, V2: gp_Vec2d): voidParameters (7)
UPosMajorRadiusMinorRadiusPV1V2
- HyperbolaD2(U: number, Pos: gp_Ax2, MajorRadius: number, MinorRadius: number, P: gp_Pnt, V1: gp_Vec, V2: gp_Vec): voidParameters (7)
UPosMajorRadiusMinorRadiusPV1V2
- HyperbolaD2(U: number, Pos: gp_Ax22d, MajorRadius: number, MinorRadius: number, P: gp_Pnt2d, V1: gp_Vec2d, V2: gp_Vec2d): voidParameters (7)
UPosMajorRadiusMinorRadiusPV1V2
- ParabolaD2(U: number, Pos: gp_Ax2, Focal: number, P: gp_Pnt, V1: gp_Vec, V2: gp_Vec): voidParameters (6)
UPosFocalPV1V2
- ParabolaD2(U: number, Pos: gp_Ax22d, Focal: number, P: gp_Pnt2d, V1: gp_Vec2d, V2: gp_Vec2d): voidParameters (6)
UPosFocalPV1V2
- CircleD3(U: number, Pos: gp_Ax2, Radius: number, P: gp_Pnt, V1: gp_Vec, V2: gp_Vec, V3: gp_Vec): voidParameters (7)
UPosRadiusPV1V2V3
- CircleD3(U: number, Pos: gp_Ax22d, Radius: number, P: gp_Pnt2d, V1: gp_Vec2d, V2: gp_Vec2d, V3: gp_Vec2d): voidParameters (7)
UPosRadiusPV1V2V3
- EllipseD3(U: number, Pos: gp_Ax2, MajorRadius: number, MinorRadius: number, P: gp_Pnt, V1: gp_Vec, V2: gp_Vec, V3: gp_Vec): voidParameters (8)
UPosMajorRadiusMinorRadiusPV1V2V3
- EllipseD3(U: number, Pos: gp_Ax22d, MajorRadius: number, MinorRadius: number, P: gp_Pnt2d, V1: gp_Vec2d, V2: gp_Vec2d, V3: gp_Vec2d): voidParameters (8)
UPosMajorRadiusMinorRadiusPV1V2V3
- HyperbolaD3(U: number, Pos: gp_Ax2, MajorRadius: number, MinorRadius: number, P: gp_Pnt, V1: gp_Vec, V2: gp_Vec, V3: gp_Vec): voidParameters (8)
UPosMajorRadiusMinorRadiusPV1V2V3
- HyperbolaD3(U: number, Pos: gp_Ax22d, MajorRadius: number, MinorRadius: number, P: gp_Pnt2d, V1: gp_Vec2d, V2: gp_Vec2d, V3: gp_Vec2d): void
In the following functions N is the order of derivation and should be greater than 0.
Parameters (8)UPosMajorRadiusMinorRadiusP—Mutated in place; read the updated value from this argument after the call.V1—Mutated in place; read the updated value from this argument after the call.V2—Mutated in place; read the updated value from this argument after the call.V3—Mutated in place; read the updated value from this argument after the call.
In the following functions N is the order of derivation and should be greater than 0.
Parameters (3)UPosN
- Parameters (3)
UPosN
- Parameters (4)
UPosRadiusN
- Parameters (4)
UPosRadiusN
- Parameters (5)
UPosMajorRadiusMinorRadiusN
- Parameters (5)
UPosMajorRadiusMinorRadiusN
- HyperbolaDN(U: number, Pos: gp_Ax2, MajorRadius: number, MinorRadius: number, N: number): gp_VecParameters (5)
UPosMajorRadiusMinorRadiusN
- HyperbolaDN(U: number, Pos: gp_Ax22d, MajorRadius: number, MinorRadius: number, N: number): gp_Vec2dParameters (5)
UPosMajorRadiusMinorRadiusN
- ParabolaDN(U: number, Pos: gp_Ax2, Focal: number, N: number): gp_VecParameters (4)
UPosFocalN
- ParabolaDN(U: number, Pos: gp_Ax22d, Focal: number, N: number): gp_Vec2d
The following functions compute the parametric value corresponding to a given point on a elementary curve. The point should be on the curve.
Parameters (4)UPosFocalN
Computes the parameter value of the point P on the given curve. Note: In its local coordinate system, the parametric equation of the curve is given by the following:
- for the line L: P(U) = Po + U*Vo where Po is the origin and Vo the unit vector of its positioning axis.
- for the circle C: X(U) = Radiusstd::cos(U), Y(U) = RadiusSin(U)
- for the ellipse E: X(U) = MajorRadiusstd::cos(U). Y(U) = MinorRadiusSin(U)
- for the hyperbola H: X(U) = MajorRadiusCh(U), Y(U) = MinorRadiusSh(U)
- for the parabola Prb: X(U) = U**2 / (2*p) Y(U) = U where p is the distance between the focus and the directrix. Warning The point P must be on the curve. These functions are not protected, however, and if point P is not on the curve, an exception may be raised.
Parameters (2)LP
parametrization P (U) = L.Location() + U * L.Direction()
Parameters (2)LP
- Parameters (2)
CP
parametrization In the local coordinate system of the circle X (U) = Radius * Cos (U) Y (U) = Radius * Sin (U)
Parameters (2)CP
- Parameters (2)
EP
- Parameter(E: gp_Elips2d, P: gp_Pnt2d): number
parametrization In the local coordinate system of the Ellipse X (U) = MajorRadius * Cos (U) Y (U) = MinorRadius * Sin (U)
Parameters (2)EP
- Parameters (2)
HP
parametrization In the local coordinate system of the Hyperbola X (U) = MajorRadius * Ch (U) Y (U) = MinorRadius * Sh (U)
Parameters (2)HP
- Parameters (2)
PrbP
- Parameter(Prb: gp_Parab2d, P: gp_Pnt2d): number
parametrization In the local coordinate system of the parabola Y**2 = (2*P) * X where P is the distance between the focus and the directrix.
Parameters (2)PrbP
- LineParameter(Pos: gp_Ax1, P: gp_Pnt): numberParameters (2)
PosP
- LineParameter(Pos: gp_Ax2d, P: gp_Pnt2d): number
parametrization P (U) = L.Location() + U * L.Direction()
Parameters (2)PosP
- CircleParameter(Pos: gp_Ax2, P: gp_Pnt): numberParameters (2)
PosP
- CircleParameter(Pos: gp_Ax22d, P: gp_Pnt2d): number
Pos is the Axis of the Circle parametrization In the local coordinate system of the circle X (U) = Radius * Cos (U) Y (U) = Radius * Sin (U).
Parameters (2)PosP
- EllipseParameter(Pos: gp_Ax2, MajorRadius: number, MinorRadius: number, P: gp_Pnt): numberParameters (4)
PosMajorRadiusMinorRadiusP
- EllipseParameter(Pos: gp_Ax22d, MajorRadius: number, MinorRadius: number, P: gp_Pnt2d): number
Pos is the Axis of the Ellipse parametrization In the local coordinate system of the Ellipse X (U) = MajorRadius * Cos (U) Y (U) = MinorRadius * Sin (U).
Parameters (4)PosMajorRadiusMinorRadiusP
- HyperbolaParameter(Pos: gp_Ax2, MajorRadius: number, MinorRadius: number, P: gp_Pnt): numberParameters (4)
PosMajorRadiusMinorRadiusP
- HyperbolaParameter(Pos: gp_Ax22d, MajorRadius: number, MinorRadius: number, P: gp_Pnt2d): number
Pos is the Axis of the Hyperbola parametrization In the local coordinate system of the Hyperbola X (U) = MajorRadius * Ch (U) Y (U) = MinorRadius * Sh (U).
Parameters (4)PosMajorRadiusMinorRadiusP
- ParabolaParameter(Pos: gp_Ax2, P: gp_Pnt): numberParameters (2)
PosP
- ParabolaParameter(Pos: gp_Ax22d, P: gp_Pnt2d): number
Pos is the mirror axis of the parabola parametrization In the local coordinate system of the parabola Y**2 = (2*P) * X where P is the distance between the focus and the directrix. The following functions build a 3d curve from a 2d curve at a given position defined with an Ax2.
Parameters (2)PosP
- Parameters (2)
PosP
- Parameters (2)
PosV
- Parameters (2)
PosV
- Parameters (2)
PosA
- Parameters (2)
PosA
- Parameters (2)
PosL
- Parameters (2)
PosC
- To3d(Pos: gp_Ax2, E: gp_Elips2d): gp_ElipsParameters (2)
PosE
- Parameters (2)
PosH
- To3d(Pos: gp_Ax2, Prb: gp_Parab2d): gp_Parab
These functions build a 3D geometric entity from a 2D geometric entity. The "X Axis" and the "Y Axis" of the global coordinate system (i.e. 2D space) are lined up respectively with the "X Axis" and "Y Axis" of the 3D coordinate system, Pos.
Parameters (2)PosPrb