OCC.Adaptor2d module¶
The Adaptor2d package is used to help definingreusable geometric algorithms. i.e. that can beused on curves and surfaces.It defines general services for objects :- the 2d curve. Curve2dThe services are :- Usual services found in Geom or Geom2d :* parameter range, value and derivatives, etc…- Continuity breakout services :* Allows to divide a curve or a surfaces inparts with a given derivation order.- Special geometries detection services :* Allows to test for special cases that canbe processed more easily :- Conics, Quadrics, Bezier, BSpline …And to get the correponding data form thepackage gp or Geom. The special typeOtherCurve means that no special case hasbeen detected and the algorithm may useonly the evaluation methods (D0, D1, …)For each category Curve2d, Curve, Surface wedefine three classes, we illustrate now theprinciples with the Curve, the same applies toCurve2d and Surface.The class Curve is the abstract root for allCurves used by algorithms, it is handled by valueand provides as deferred methods the servicesdescribed above.Some services (breakout) requires to create newcurves, this leads to memory allocationconsiderations (who create the curve, who deletesit ?). To solve this problem elegantly the curvewill return a HCurve, the HCurve is a curvehandled by reference so it will be deallocatedautomatically when it is not used.A third class GenHCurve is provided, this class isgeneric and its utility is to provide automaticgeneration of the HCurve class when you havewritten the Curve class.* Let us show an example (with 2d curves) :Imagine an algorithm to intersect curves, thisalgorithms is written to process Curve2d fromAdaptor2d :A method may look like :Intersect(C1,C2 : Curve2d from Adaptor2d);Which will look like in C++Intersect(const Adaptor2d_Curve2d& C1,const Adaptor2d_Curve2d& C2){// you can call any methodStandard_Real first1 = C1.FirstParameter();// but avoid to copy in an Adaptor2d_Curve which// is an Abstract class, use a reference or a pointerconst Adaptor2d_Curve& C = C1;const Adaptor2d_Curve pC = &C1;// If you are interseted in Intervals you must// store them in a HCurve to ensure they are kept// in memory. Then a referrence may be used.Handle(Adaptor2d_HCurve) HCI = C1.Interval(1);const Adaptor2d_Curve& CI = HCI->Curve();pC = &(HCI->Curve()); The Adaptor2d provides also Generic classesimplementing algorithmic curves and surfaces.- IsoCurve : Isoparametric curve on a surface.- CurveOnSurface : 2D curve in the parametricspace of a surface.- OffsetCurve2d : 2d offset curve- ProjectedCurve : 3d curve projected on a plane- SurfaceOfLinearExtrusion- SurfaceOfRevolutionThey are instantiated with HCurve, HSurface, HCurved2d
-
class
Adaptor2d_Curve2d
¶ Bases:
object
-
BSpline
()¶ Return type: Handle_Geom2d_BSplineCurve
-
Bezier
()¶ Return type: Handle_Geom2d_BezierCurve
-
Continuity
()¶ Return type: GeomAbs_Shape
-
D0
()¶ - Computes the point of parameter U on the curve.
Parameters: Return type: void
-
D1
()¶ - Computes the point of parameter U on the curve with its first derivative. Raised if the continuity of the current interval is not C1.
Parameters: 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 current interval is not C2.
Parameters: 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 current interval is not C3.
Parameters: Return type: void
-
DN
()¶ - The returned vector gives the value of the derivative for the order of derivation N. Raised if the continuity of the current interval is not CN. Raised if N < 1.
Parameters: Return type:
-
Ellipse
()¶ Return type: gp_Elips2d
-
GetType
()¶ - Returns the type of the curve in the current interval : Line, Circle, Ellipse, Hyperbola, Parabola, BezierCurve, BSplineCurve, OtherCurve.
Return type: GeomAbs_CurveType
-
Intervals
()¶ - Stores in <T> the parameters bounding the intervals of continuity <S>. //! The array must provide enough room to accomodate for the parameters. i.e. T.Length() > NbIntervals()
Parameters: - T (TColStd_Array1OfReal &) –
- S (GeomAbs_Shape) –
Return type: void
-
NbIntervals
()¶ - If necessary, breaks the curve in intervals of continuity <S>. And returns the number of intervals.
Parameters: S (GeomAbs_Shape) – Return type: int
-
Parabola
()¶ Return type: gp_Parab2d
-
Resolution
()¶ - Returns the parametric resolution corresponding to the real space resolution <R3d>.
Parameters: R3d (float) – Return type: float
-
Trim
()¶ - Returns a curve equivalent of <self> between parameters <First> and <Last>. <Tol> is used to test for 3d points confusion. If <First> >= <Last>
Parameters: Return type:
-
Value
()¶ - Computes the point of parameter U on the curve.
Parameters: U (float) – Return type: gp_Pnt2d
-
thisown
¶ The membership flag
-
-
class
Adaptor2d_HCurve2d
(*args, **kwargs)¶ Bases:
OCC.MMgt.MMgt_TShared
-
BSpline
()¶ Return type: Handle_Geom2d_BSplineCurve
-
Bezier
()¶ Return type: Handle_Geom2d_BezierCurve
-
Continuity
()¶ Return type: GeomAbs_Shape
-
Curve2d
()¶ - Returns a reference to the Curve2d inside the HCurve2d.
Return type: Adaptor2d_Curve2d
-
D3
()¶ Parameters: Return type:
-
Ellipse
()¶ Return type: gp_Elips2d
-
GetHandle
()¶
-
GetType
()¶ Return type: GeomAbs_CurveType
-
Parabola
()¶ Return type: gp_Parab2d
-
Trim
()¶ - If <First> >= <Last>
Parameters: Return type:
-
thisown
¶ The membership flag
-
-
class
Adaptor2d_HLine2d
(*args)¶ Bases:
OCC.Adaptor2d.Adaptor2d_HCurve2d
Return type: None Parameters: C (Adaptor2d_Line2d &) – Return type: None -
ChangeCurve2d
()¶ Return type: Adaptor2d_Line2d
-
GetHandle
()¶
-
thisown
¶ The membership flag
-
-
class
Adaptor2d_Line2d
(*args)¶ Bases:
OCC.Adaptor2d.Adaptor2d_Curve2d
Return type: Parameters: Return type: -
Load
()¶ Parameters: Return type: Return type:
-
thisown
¶ The membership flag
-
-
class
Handle_Adaptor2d_HCurve2d
(*args)¶ Bases:
OCC.MMgt.Handle_MMgt_TShared
-
static
DownCast
()¶
-
GetObject
()¶
-
IsNull
()¶
-
Nullify
()¶
-
thisown
¶ The membership flag
-
static
-
class
Handle_Adaptor2d_HLine2d
(*args)¶ Bases:
OCC.Adaptor2d.Handle_Adaptor2d_HCurve2d
-
static
DownCast
()¶
-
GetObject
()¶
-
IsNull
()¶
-
Nullify
()¶
-
thisown
¶ The membership flag
-
static
-
class
SwigPyIterator
(*args, **kwargs)¶ Bases:
object
-
advance
()¶
-
copy
()¶
-
decr
()¶
-
distance
()¶
-
equal
()¶
-
incr
()¶
-
next
()¶
-
previous
()¶
-
thisown
¶ The membership flag
-
value
()¶
-
-
new_instancemethod
(func, inst, cls)¶
-
register_handle
(handle, base_object)¶ Inserts the handle into the base object to prevent memory corruption in certain cases