OCC.Approx module¶
Tis package provides algorithms approximating a set ofpoints or curves with the possibility of dividing intoone or many bezier curves.It also provides an instantiation for approximatinga continous function f(t) into one or many curves.
-
class
Approx_Array1OfAdHSurface
(*args)¶ Bases:
object
Parameters: Return type: Return type: -
Assign
()¶ Parameters: Other (Approx_Array1OfAdHSurface &) – Return type: Approx_Array1OfAdHSurface
-
ChangeValue
()¶ Parameters: Index (int) – Return type: Handle_Adaptor3d_HSurface
-
Set
()¶ Parameters: Other (Approx_Array1OfAdHSurface &) – Return type: Approx_Array1OfAdHSurface
-
Value
()¶ Parameters: Index (int) – Return type: Handle_Adaptor3d_HSurface
-
thisown
¶ The membership flag
-
-
class
Approx_Array1OfGTrsf2d
(*args)¶ Bases:
object
Parameters: - Low (int) –
- Up (int) –
- Item (gp_GTrsf2d) –
- Low –
- Up –
Return type: Return type: -
Assign
()¶ Parameters: Other (Approx_Array1OfGTrsf2d &) – Return type: Approx_Array1OfGTrsf2d
-
ChangeValue
()¶ Parameters: Index (int) – Return type: gp_GTrsf2d
-
Init
()¶ Parameters: V (gp_GTrsf2d) – Return type: None
-
Set
()¶ Parameters: Other (Approx_Array1OfGTrsf2d &) – Return type: Approx_Array1OfGTrsf2d
-
SetValue
()¶ Parameters: - Index (int) –
- Value (gp_GTrsf2d) –
Return type:
-
Value
()¶ Parameters: Index (int) – Return type: gp_GTrsf2d
-
thisown
¶ The membership flag
-
class
Approx_Curve2d
(*args)¶ Bases:
object
Parameters: Return type: -
Curve
()¶ Return type: Handle_Geom2d_BSplineCurve
-
thisown
¶ The membership flag
-
-
class
Approx_Curve3d
(*args)¶ Bases:
object
- Approximation of a curve with respect of the requiered tolerance Tol3D.
Parameters: Return type: -
Curve
()¶ Return type: Handle_Geom_BSplineCurve
-
DumpToString
()¶ Approx_Curve3d_DumpToString(Approx_Curve3d self) -> std::string
-
HasResult
()¶ - returns Standard_True if the approximation did come out with a result that is not NECESSARELY within the required tolerance
Return type: bool
-
IsDone
()¶ - returns Standard_True if the approximation has been done within requiered tolerance
Return type: bool
-
MaxError
()¶ - returns the Maximum Error (>0 when an approximation has been done, 0 if no approximation)
Return type: float
-
thisown
¶ The membership flag
-
class
Approx_CurveOnSurface
(*args)¶ Bases:
object
Parameters: Return type: -
Curve2d
()¶ Return type: Handle_Geom2d_BSplineCurve
-
Curve3d
()¶ Return type: Handle_Geom_BSplineCurve
-
MaxError2dV
()¶ - returns the maximum errors relativly to the U component or the V component of the 2d Curve
Return type: float
-
thisown
¶ The membership flag
-
-
class
Approx_CurvilinearParameter
(*args)¶ Bases:
object
- case of a free 3D curve
Parameters: Return type: - case of a curve on one surface
Parameters: Return type: - case of a curve on two surfaces
Parameters: Return type: -
Curve2d1
()¶ - returns the BsplineCurve representing the reparametrized 2D curve on the first surface (case of a curve on one or two surfaces)
Return type: Handle_Geom2d_BSplineCurve
-
Curve2d2
()¶ - returns the BsplineCurve representing the reparametrized 2D curve on the second surface (case of a curve on two surfaces)
Return type: Handle_Geom2d_BSplineCurve
-
Curve3d
()¶ - returns the Bspline curve corresponding to the reparametrized 3D curve
Return type: Handle_Geom_BSplineCurve
-
DumpToString
()¶ Approx_CurvilinearParameter_DumpToString(Approx_CurvilinearParameter self) -> std::string
-
thisown
¶ The membership flag
-
class
Approx_CurvlinFunc
(*args)¶ Bases:
OCC.MMgt.MMgt_TShared
Parameters: - C (Handle_Adaptor3d_HCurve &) –
- Tol (float) –
- C2D (Handle_Adaptor2d_HCurve2d &) –
- S (Handle_Adaptor3d_HSurface &) –
- Tol –
- C2D1 (Handle_Adaptor2d_HCurve2d &) –
- C2D2 (Handle_Adaptor2d_HCurve2d &) –
- S1 (Handle_Adaptor3d_HSurface &) –
- S2 (Handle_Adaptor3d_HSurface &) –
- Tol –
Return type: Return type: Return type: -
EvalCase1
()¶ - if myCase != 1
Parameters: Return type:
-
EvalCase2
()¶ - if myCase != 2
Parameters: Return type:
-
EvalCase3
()¶ - if myCase != 3
Parameters: Return type:
-
GetHandle
()¶
-
GetSParameter
()¶ - returns original parameter correponding S.
Parameters: U (float) – Return type: float
-
GetUParameter
()¶ - returns original parameter correponding S. if Case == 1 computation is performed on myC2D1 and mySurf1, otherwise it is done on myC2D2 and mySurf2.
Parameters: Return type:
-
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:
-
Length
()¶ - Computes length of the curve.
Return type: None - Computes length of the curve segment.
Parameters: Return type:
-
NbIntervals
()¶ - Returns the number of intervals for continuity <S>. May be one if Continuity(me) >= <S>
Parameters: S (GeomAbs_Shape) – Return type: int
-
Trim
()¶ - if First < 0 or Last > 1
Parameters: Return type:
-
thisown
¶ The membership flag
-
class
Approx_FitAndDivide
(*args)¶ Bases:
object
Parameters: - Line (AppCont_Function &) –
- degreemin (int) – default value is 3
- degreemax (int) – default value is 8
- Tolerance3d (float) – default value is 1.0e-5
- Tolerance2d (float) – default value is 1.0e-5
- cutting (bool) – default value is Standard_False
- FirstC (AppParCurves_Constraint) – default value is AppParCurves_TangencyPoint
- LastC (AppParCurves_Constraint) – default value is AppParCurves_TangencyPoint
- degreemin – default value is 3
- degreemax – default value is 8
- Tolerance3d – default value is 1.0e-05
- Tolerance2d – default value is 1.0e-05
- cutting – default value is Standard_False
- FirstC – default value is AppParCurves_TangencyPoint
- LastC – default value is AppParCurves_TangencyPoint
Return type: Return type: -
SetConstraints
()¶ Parameters: - FirstC (AppParCurves_Constraint) –
- LastC (AppParCurves_Constraint) –
Return type:
-
Value
()¶ Parameters: Index (int) – default value is 1 Return type: AppParCurves_MultiCurve
-
thisown
¶ The membership flag
-
class
Approx_FitAndDivide2d
(*args)¶ Bases:
object
Parameters: - Line (AppCont_Function &) –
- degreemin (int) – default value is 3
- degreemax (int) – default value is 8
- Tolerance3d (float) – default value is 1.0e-5
- Tolerance2d (float) – default value is 1.0e-5
- cutting (bool) – default value is Standard_False
- FirstC (AppParCurves_Constraint) – default value is AppParCurves_TangencyPoint
- LastC (AppParCurves_Constraint) – default value is AppParCurves_TangencyPoint
- degreemin – default value is 3
- degreemax – default value is 8
- Tolerance3d – default value is 1.0e-05
- Tolerance2d – default value is 1.0e-05
- cutting – default value is Standard_False
- FirstC – default value is AppParCurves_TangencyPoint
- LastC – default value is AppParCurves_TangencyPoint
Return type: Return type: -
SetConstraints
()¶ Parameters: - FirstC (AppParCurves_Constraint) –
- LastC (AppParCurves_Constraint) –
Return type:
-
Value
()¶ Parameters: Index (int) – default value is 1 Return type: AppParCurves_MultiCurve
-
thisown
¶ The membership flag
-
class
Approx_HArray1OfAdHSurface
(*args)¶ Bases:
OCC.MMgt.MMgt_TShared
Parameters: Return type: Return type: -
Array1
()¶ Return type: Approx_Array1OfAdHSurface
-
ChangeArray1
()¶ Return type: Approx_Array1OfAdHSurface
-
ChangeValue
()¶ Parameters: Index (int) – Return type: Handle_Adaptor3d_HSurface
-
GetHandle
()¶
-
Value
()¶ Parameters: Index (int) – Return type: Handle_Adaptor3d_HSurface
-
thisown
¶ The membership flag
-
-
class
Approx_HArray1OfGTrsf2d
(*args)¶ Bases:
OCC.MMgt.MMgt_TShared
Parameters: - Low (int) –
- Up (int) –
- Low –
- Up –
- V (gp_GTrsf2d) –
Return type: Return type: -
Array1
()¶ Return type: Approx_Array1OfGTrsf2d
-
ChangeArray1
()¶ Return type: Approx_Array1OfGTrsf2d
-
ChangeValue
()¶ Parameters: Index (int) – Return type: gp_GTrsf2d
-
GetHandle
()¶
-
Init
()¶ Parameters: V (gp_GTrsf2d) – Return type: None
-
SetValue
()¶ Parameters: - Index (int) –
- Value (gp_GTrsf2d) –
Return type:
-
Value
()¶ Parameters: Index (int) – Return type: gp_GTrsf2d
-
thisown
¶ The membership flag
-
class
Approx_MCurvesToBSpCurve
(*args)¶ Bases:
object
Return type: None -
ChangeValue
()¶ - return the composite MultiCurves as a MultiBSpCurve.
Return type: AppParCurves_MultiBSpCurve
-
Perform
()¶ Return type: None Parameters: TheSeq (AppParCurves_SequenceOfMultiCurve &) – Return type: None
-
Value
()¶ - return the composite MultiCurves as a MultiBSpCurve.
Return type: AppParCurves_MultiBSpCurve
-
thisown
¶ The membership flag
-
-
class
Approx_SameParameter
(*args)¶ Bases:
object
- Warning: the C3D and C2D must have the same parametric domain.
Parameters: - C3D (Handle_Adaptor3d_HCurve &) –
- C2D (Handle_Geom2d_Curve &) –
- S (Handle_Adaptor3d_HSurface &) –
- Tol (float) –
- C3D –
- C2D –
- S –
- Tol –
Return type: Return type: - Warning: the C3D and C2D must have the same parametric domain.
Parameters: - C3D (Handle_Adaptor3d_HCurve &) –
- C2D (Handle_Adaptor2d_HCurve2d &) –
- S (Handle_Adaptor3d_HSurface &) –
- Tol (float) –
Return type: -
Curve2d
()¶ - Returns the 2D curve that has the same parameter as the 3D curve once evaluated on the surface up to the specified tolerance
Return type: Handle_Geom2d_BSplineCurve
-
IsSameParameter
()¶ - Tells whether the original data had already the same parameter up to the tolerance : in that case nothing is done.
Return type: bool
-
thisown
¶ The membership flag
-
class
Approx_SequenceNodeOfSequenceOfHArray1OfReal
(*args)¶ Bases:
OCC.TCollection.TCollection_SeqNode
Parameters: - I (Handle_TColStd_HArray1OfReal &) –
- n (TCollection_SeqNodePtr &) –
- p (TCollection_SeqNodePtr &) –
Return type: -
GetHandle
()¶
-
Value
()¶ Return type: Handle_TColStd_HArray1OfReal
-
thisown
¶ The membership flag
-
class
Approx_SequenceOfHArray1OfReal
(*args)¶ Bases:
OCC.TCollection.TCollection_BaseSequence
Return type: None Parameters: Other (Approx_SequenceOfHArray1OfReal &) – Return type: None -
Append
()¶ Parameters: - T (Handle_TColStd_HArray1OfReal &) –
- S (Approx_SequenceOfHArray1OfReal &) –
Return type: Return type:
-
Assign
()¶ Parameters: Other (Approx_SequenceOfHArray1OfReal &) – Return type: Approx_SequenceOfHArray1OfReal
-
ChangeValue
()¶ Parameters: Index (int) – Return type: Handle_TColStd_HArray1OfReal
-
First
()¶ Return type: Handle_TColStd_HArray1OfReal
-
InsertAfter
()¶ Parameters: - Index (int) –
- T (Handle_TColStd_HArray1OfReal &) –
- Index –
- S (Approx_SequenceOfHArray1OfReal &) –
Return type: Return type:
-
InsertBefore
()¶ Parameters: - Index (int) –
- T (Handle_TColStd_HArray1OfReal &) –
- Index –
- S (Approx_SequenceOfHArray1OfReal &) –
Return type: Return type:
-
Last
()¶ Return type: Handle_TColStd_HArray1OfReal
-
Prepend
()¶ Parameters: - T (Handle_TColStd_HArray1OfReal &) –
- S (Approx_SequenceOfHArray1OfReal &) –
Return type: Return type:
-
Remove
()¶ Parameters: Return type: Return type:
-
Set
()¶ Parameters: Other (Approx_SequenceOfHArray1OfReal &) – Return type: Approx_SequenceOfHArray1OfReal
-
Value
()¶ Parameters: Index (int) – Return type: Handle_TColStd_HArray1OfReal
-
thisown
¶ The membership flag
-
-
class
Approx_SweepApproximation
(*args)¶ Bases:
object
Parameters: Func (Handle_Approx_SweepFunction &) – Return type: None -
Average2dError
()¶ - returns the average error of the <Index> 2d curve approximation.
Parameters: Index (int) – Return type: float
-
Curve2d
()¶ Parameters: - Index (int) –
- TPoles (TColgp_Array1OfPnt2d) –
- TKnots (TColStd_Array1OfReal &) –
- TMults (TColStd_Array1OfInteger &) –
Return type:
-
Curve2dPoles
()¶ Parameters: Index (int) – Return type: TColgp_Array1OfPnt2d
-
Curves2dKnots
()¶ Return type: TColStd_Array1OfReal
-
Curves2dMults
()¶ Return type: TColStd_Array1OfInteger
-
DumpToString
()¶ Approx_SweepApproximation_DumpToString(Approx_SweepApproximation self) -> std::string
-
Eval
()¶ - The EvaluatorFunction from AdvApprox;
Parameters: Return type:
-
Max2dError
()¶ - returns the maximum error of the <Index> 2d curve approximation.
Parameters: Index (int) – Return type: float
-
Perform
()¶ - Perform the Approximation [First, Last] : Approx_SweepApproximation.cdl Tol3d : Tolerance to surface approximation Tol2d : Tolerance used to perform curve approximation Normaly the 2d curve are approximated with a tolerance given by the resolution on support surfaces, but if this tolerance is too large Tol2d is used. TolAngular : Tolerance (in radian) to control the angle beetween tangents on the section law and tangent of iso-v on approximed surface Continuity : The continuity in v waiting on the surface Degmax : The maximum degree in v requiered on the surface Segmax : The maximum number of span in v requiered on the surface Warning : The continuity ci can be obtained only if Ft is Ci
Parameters: Return type:
-
SurfPoles
()¶ Return type: TColgp_Array2OfPnt
-
SurfShape
()¶ Parameters: - UDegree (int &) –
- VDegree (int &) –
- NbUPoles (int &) –
- NbVPoles (int &) –
- NbUKnots (int &) –
- NbVKnots (int &) –
Return type:
-
SurfUKnots
()¶ Return type: TColStd_Array1OfReal
-
SurfUMults
()¶ Return type: TColStd_Array1OfInteger
-
SurfVKnots
()¶ Return type: TColStd_Array1OfReal
-
SurfVMults
()¶ Return type: TColStd_Array1OfInteger
-
SurfWeights
()¶ Return type: TColStd_Array2OfReal
-
Surface
()¶ Parameters: - TPoles (TColgp_Array2OfPnt) –
- TWeights (TColStd_Array2OfReal &) –
- TUKnots (TColStd_Array1OfReal &) –
- TVKnots (TColStd_Array1OfReal &) –
- TUMults (TColStd_Array1OfInteger &) –
- TVMults (TColStd_Array1OfInteger &) –
Return type:
-
TolCurveOnSurf
()¶ - returns the maximum 3d error of the <Index> 2d curve approximation on the Surface.
Parameters: Index (int) – Return type: float
-
thisown
¶ The membership flag
-
-
class
Approx_SweepFunction
(*args, **kwargs)¶ Bases:
OCC.MMgt.MMgt_TShared
-
BarycentreOfSurf
()¶ - Get the barycentre of Surface. An very poor estimation is sufficent. This information is usefull to perform well conditioned rational approximation. Warning: Used only if <self> IsRational
Return type: gp_Pnt
-
D0
()¶ - compute the section for v = param
Parameters: - Param (float) –
- First (float) –
- Last (float) –
- Poles (TColgp_Array1OfPnt) –
- Poles2d (TColgp_Array1OfPnt2d) –
- Weigths (TColStd_Array1OfReal &) –
Return type:
-
D1
()¶ - compute the first derivative in v direction of the section for v = param Warning : It used only for C1 or C2 aproximation
Parameters: - Param (float) –
- First (float) –
- Last (float) –
- Poles (TColgp_Array1OfPnt) –
- DPoles (TColgp_Array1OfVec) –
- Poles2d (TColgp_Array1OfPnt2d) –
- DPoles2d (TColgp_Array1OfVec2d) –
- Weigths (TColStd_Array1OfReal &) –
- DWeigths (TColStd_Array1OfReal &) –
Return type:
-
D2
()¶ - compute the second derivative in v direction of the section for v = param Warning : It used only for C2 aproximation
Parameters: - Param (float) –
- First (float) –
- Last (float) –
- Poles (TColgp_Array1OfPnt) –
- DPoles (TColgp_Array1OfVec) –
- D2Poles (TColgp_Array1OfVec) –
- Poles2d (TColgp_Array1OfPnt2d) –
- DPoles2d (TColgp_Array1OfVec2d) –
- D2Poles2d (TColgp_Array1OfVec2d) –
- Weigths (TColStd_Array1OfReal &) –
- DWeigths (TColStd_Array1OfReal &) –
- D2Weigths (TColStd_Array1OfReal &) –
Return type:
-
GetHandle
()¶
-
GetMinimalWeight
()¶ - Compute the minimal value of weight for each poles in all sections. This information is usefull to control error in rational approximation. Warning: Used only if <self> IsRational
Parameters: Weigths (TColStd_Array1OfReal &) – Return type: void
-
GetTolerance
()¶ - Returns the tolerance to reach in approximation to satisfy. BoundTol error at the Boundary AngleTol tangent error at the Boundary (in radian) SurfTol error inside the surface.
Parameters: Return type: void
-
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
-
Knots
()¶ - get the Knots of the section
Parameters: TKnots (TColStd_Array1OfReal &) – Return type: void
-
MaximalSection
()¶ - Returns the length of the greater section. This information is usefull to G1’s control. Warning: With an little value, approximation can be slower.
Return type: float
-
Mults
()¶ - get the Multplicities of the section
Parameters: TMults (TColStd_Array1OfInteger &) – Return type: void
-
NbIntervals
()¶ - Returns the number of intervals for continuity <S>. May be one if Continuity(me) >= <S>
Parameters: S (GeomAbs_Shape) – Return type: int
-
Resolution
()¶ - Returns the resolutions in the sub-space 2d <Index> This information is usfull to find an good tolerance in 2d approximation.
Parameters: Return type: void
-
SectionShape
()¶ - get the format of an section
Parameters: - NbPoles (int &) –
- NbKnots (int &) –
- Degree (int &) –
Return type: void
-
SetInterval
()¶ - Sets the bounds of the parametric interval on the fonction This determines the derivatives in these values if the function is not Cn.
Parameters: Return type: void
-
SetTolerance
()¶ - Is usefull, if (me) have to run numerical algorithm to perform D0, D1 or D2
Parameters: Return type: void
-
thisown
¶ The membership flag
-
-
class
Handle_Approx_CurvlinFunc
(*args)¶ Bases:
OCC.MMgt.Handle_MMgt_TShared
-
static
DownCast
()¶
-
GetObject
()¶
-
IsNull
()¶
-
Nullify
()¶
-
thisown
¶ The membership flag
-
static
-
class
Handle_Approx_HArray1OfAdHSurface
(*args)¶ Bases:
OCC.MMgt.Handle_MMgt_TShared
-
static
DownCast
()¶
-
GetObject
()¶
-
IsNull
()¶
-
Nullify
()¶
-
thisown
¶ The membership flag
-
static
-
class
Handle_Approx_HArray1OfGTrsf2d
(*args)¶ Bases:
OCC.MMgt.Handle_MMgt_TShared
-
static
DownCast
()¶
-
GetObject
()¶
-
IsNull
()¶
-
Nullify
()¶
-
thisown
¶ The membership flag
-
static
-
class
Handle_Approx_SequenceNodeOfSequenceOfHArray1OfReal
(*args)¶ Bases:
OCC.TCollection.Handle_TCollection_SeqNode
-
static
DownCast
()¶
-
GetObject
()¶
-
IsNull
()¶
-
Nullify
()¶
-
thisown
¶ The membership flag
-
static
-
class
Handle_Approx_SweepFunction
(*args)¶ Bases:
OCC.MMgt.Handle_MMgt_TShared
-
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