OCC.ShapeConstruct module¶
This package provides new algorithms for constructingnew geometrical objects and topological shapes. Itcomplements and extends algorithms available in OpenCASCADE topological and geometrical toolkist.The functionality provided by this package are thefollowing:projecting curves on surface,adjusting curve to have given start and end points. P
-
class
Handle_ShapeConstruct_ProjectCurveOnSurface
(*args)¶ Bases:
OCC.MMgt.Handle_MMgt_TShared
-
static
DownCast
()¶
-
GetObject
()¶
-
IsNull
()¶
-
Nullify
()¶
-
thisown
¶ The membership flag
-
static
-
class
ShapeConstruct_CompBezierCurves2dToBSplineCurve2d
(*args)¶ Bases:
object
Parameters: AngularTolerance (float) – default value is 1.0e-4 Return type: None -
AddCurve
()¶ Parameters: Poles (TColgp_Array1OfPnt2d) – Return type: None
-
KnotsAndMults
()¶ Parameters: - Knots (TColStd_Array1OfReal &) –
- Mults (TColStd_Array1OfInteger &) –
Return type:
-
Poles
()¶ Parameters: Poles (TColgp_Array1OfPnt2d) – Return type: None
-
thisown
¶ The membership flag
-
-
class
ShapeConstruct_CompBezierCurvesToBSplineCurve
(*args)¶ Bases:
object
Parameters: AngularTolerance (float) – default value is 1.0e-4 Return type: None -
AddCurve
()¶ Parameters: Poles (TColgp_Array1OfPnt) – Return type: None
-
KnotsAndMults
()¶ Parameters: - Knots (TColStd_Array1OfReal &) –
- Mults (TColStd_Array1OfInteger &) –
Return type:
-
Poles
()¶ Parameters: Poles (TColgp_Array1OfPnt) – Return type: None
-
thisown
¶ The membership flag
-
-
class
ShapeConstruct_Curve
¶ Bases:
object
-
AdjustCurve
()¶ - Modifies a curve in order to make its bounds confused with given points. Works only on lines and B-Splines, returns True in this case, else returns False. For line considers both bounding points, for B-Splines only specified. //! Warning : Does not check if curve should be reversed
Parameters: Return type:
-
AdjustCurve2d
()¶ - Modifies a curve in order to make its bounds confused with given points. Works only on lines and B-Splines, returns True in this case, else returns False. //! For line considers both bounding points, for B-Splines only specified. //! Warning : Does not check if curve should be reversed
Parameters: Return type:
-
AdjustCurveSegment
()¶ - Modifies a curve in order to make its bounds confused with given points. Works only on lines and B-Splines. //! For lines works as previous method, B-Splines are segmented at the given values and then are adjusted to the points.
Parameters: Return type:
-
ConvertToBSpline
()¶ - Converts a curve of any type (only part from first to last) to bspline. The method of conversion depends on the type of original curve: BSpline -> C.Segment(first,last) Bezier and Line -> GeomConvert::CurveToBSplineCurve(C).Segment(first,last) Conic and Other -> Approx_Curve3d(C[first,last],prec,C1,9,1000)
Parameters: Return type: - Converts a curve of any type (only part from first to last) to bspline. The method of conversion depends on the type of original curve: BSpline -> C.Segment(first,last) Bezier and Line -> GeomConvert::CurveToBSplineCurve(C).Segment(first,last) Conic and Other -> Approx_Curve2d(C[first,last],prec,C1,9,1000)
Parameters: Return type:
-
static
FixKnots
()¶ Parameters: knots (Handle_TColStd_HArray1OfReal &) – Return type: bool - Fix bspline knots to ensure that there is enough gap between neighbouring values Returns True if something fixed (by shifting knot)
Parameters: knots (TColStd_Array1OfReal &) – Return type: bool
-
thisown
¶ The membership flag
-
-
ShapeConstruct_Curve_FixKnots
()¶ Parameters: knots (Handle_TColStd_HArray1OfReal &) – Return type: bool - Fix bspline knots to ensure that there is enough gap between neighbouring values Returns True if something fixed (by shifting knot)
Parameters: knots (TColStd_Array1OfReal &) – Return type: bool
-
class
ShapeConstruct_MakeTriangulation
(*args)¶ Bases:
OCC.BRepBuilderAPI.BRepBuilderAPI_MakeShape
Parameters: - pnts (TColgp_Array1OfPnt) –
- prec (float) – default value is 0.0
- wire (TopoDS_Wire &) –
- prec – default value is 0.0
Return type: Return type: -
thisown
¶ The membership flag
-
class
ShapeConstruct_ProjectCurveOnSurface
(*args)¶ Bases:
OCC.MMgt.MMgt_TShared
- Empty constructor.
Return type: None -
GetAdjustOverDegenMode
()¶ ShapeConstruct_ProjectCurveOnSurface_GetAdjustOverDegenMode(ShapeConstruct_ProjectCurveOnSurface self) -> Standard_Integer
-
GetBuildCurveMode
()¶ ShapeConstruct_ProjectCurveOnSurface_GetBuildCurveMode(ShapeConstruct_ProjectCurveOnSurface self) -> Standard_Boolean
-
GetHandle
()¶
-
Init
()¶ - Initializes the object with all necessary parameters, i.e. surface and precision
Parameters: - surf (Handle_Geom_Surface &) –
- preci (float) –
Return type: void
- Initializes the object with all necessary parameters, i.e. surface and precision
Parameters: - surf (Handle_ShapeAnalysis_Surface &) –
- preci (float) –
Return type: void
-
Perform
()¶ - Computes the projection of 3d curve onto a surface using the specialized algorithm. Returns False if projector fails, otherwise, if pcurve computed successfully, returns True. The continuity, maxdeg and nbinterval are parameters of call to Approx_CurveOnSurface. If nbinterval is equal to -1 (default), this value is computed depending on source 3d curve and surface. The output curve 2D is guaranteed to be same-parameter with input curve 3D on the interval [First, Last]. If the output curve lies on a direct line the infinite line is returned, in the case same-parameter condition is satisfied.
Parameters: Return type:
-
PerformAdvanced
()¶ - Computes the projection of 3d curve onto a surface using either standard projector (method PerformByProjLib()) or internal one (method Perform()). The selection is done by analyzing the surface and 3d curve and is aimed to filter the cases potentially dangerous for the standard projector. If the standard projector fails, internal one is used.
Parameters: Return type:
-
PerformByProjLib
()¶ - Computes the projection of 3d curve onto a surface using the standard algorithm from ProjLib. Returns False if standard projector fails or raises an exception or cuts the curve by parametrical bounds of the surface. Else, if pcurve computed successfully, returns True. The continuity, maxdeg and nbinterval are parameters of call to Approx_CurveOnSurface. If nbinterval is equal to -1 (default), this value is computed depending on source 3d curve and surface.
Parameters: Return type:
-
SetAdjustOverDegenMode
()¶ ShapeConstruct_ProjectCurveOnSurface_SetAdjustOverDegenMode(ShapeConstruct_ProjectCurveOnSurface self, Standard_Integer value)
-
SetBuildCurveMode
()¶ ShapeConstruct_ProjectCurveOnSurface_SetBuildCurveMode(ShapeConstruct_ProjectCurveOnSurface self, Standard_Boolean value)
-
SetSurface
()¶ - Loads a surface (in the form of Geom_Surface) to project on
Parameters: surf (Handle_Geom_Surface &) – Return type: None - Loads a surface (in the form of ShapeAnalysis_Surface) to project on
Parameters: surf (Handle_ShapeAnalysis_Surface &) – Return type: None
-
Status
()¶ - Returns the status of last Peform
Parameters: Status (ShapeExtend_Status) – Return type: bool
-
thisown
¶ The membership flag
-
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
-
class
shapeconstruct
¶ Bases:
object
-
static
ConvertCurveToBSpline
()¶ - Tool for wire triangulation
Parameters: Return type: Return type:
-
static
ConvertSurfaceToBSpline
()¶ Parameters: Return type:
-
static
JoinCurves
()¶ - Method for joininig curves 3D. Parameters : c3d1,ac3d2 - initial curves Orient1, Orient2 - initial edges orientations. first1,last1,first2,last2 - parameters for trimming curves (re-calculate with account of orientation edges) c3dOut - result curve isRev1,isRev2 - out parameters indicative on possible errors. Return value : True - if curves were joined successfully, else - False.
Parameters: Return type: - Method for joininig curves 3D. Parameters : c3d1,ac3d2 - initial curves Orient1, Orient2 - initial edges orientations. first1,last1,first2,last2 - parameters for trimming curves (re-calculate with account of orientation edges) c3dOut - result curve isRev1,isRev2 - out parameters indicative on possible errors. isError - input parameter indicative possible errors due to that one from edges have one vertex Return value : True - if curves were joined successfully, else - False.
Parameters: - c2d1 (Handle_Geom2d_Curve &) –
- ac2d2 (Handle_Geom2d_Curve &) –
- Orient1 (TopAbs_Orientation) –
- Orient2 (TopAbs_Orientation) –
- first1 (float &) –
- last1 (float &) –
- first2 (float &) –
- last2 (float &) –
- c2dOut (Handle_Geom2d_Curve &) –
- isRev1 (bool) –
- isRev2 (bool) –
- isError (bool) – default value is Standard_False
Return type:
-
static
JoinPCurves
()¶ - join pcurves of the <theEdge> on the <theFace> try to use pcurves from originas edges <theEdges> Returns false if cannot join pcurves
Parameters: - theEdges (Handle_TopTools_HSequenceOfShape &) –
- theFace (TopoDS_Face &) –
- theEdge (TopoDS_Edge &) –
Return type:
-
thisown
¶ The membership flag
-
static
-
shapeconstruct_ConvertCurveToBSpline
()¶ - Tool for wire triangulation
Parameters: Return type: Return type:
-
shapeconstruct_ConvertSurfaceToBSpline
()¶ Parameters: Return type:
-
shapeconstruct_JoinCurves
()¶ - Method for joininig curves 3D. Parameters : c3d1,ac3d2 - initial curves Orient1, Orient2 - initial edges orientations. first1,last1,first2,last2 - parameters for trimming curves (re-calculate with account of orientation edges) c3dOut - result curve isRev1,isRev2 - out parameters indicative on possible errors. Return value : True - if curves were joined successfully, else - False.
Parameters: Return type: - Method for joininig curves 3D. Parameters : c3d1,ac3d2 - initial curves Orient1, Orient2 - initial edges orientations. first1,last1,first2,last2 - parameters for trimming curves (re-calculate with account of orientation edges) c3dOut - result curve isRev1,isRev2 - out parameters indicative on possible errors. isError - input parameter indicative possible errors due to that one from edges have one vertex Return value : True - if curves were joined successfully, else - False.
Parameters: - c2d1 (Handle_Geom2d_Curve &) –
- ac2d2 (Handle_Geom2d_Curve &) –
- Orient1 (TopAbs_Orientation) –
- Orient2 (TopAbs_Orientation) –
- first1 (float &) –
- last1 (float &) –
- first2 (float &) –
- last2 (float &) –
- c2dOut (Handle_Geom2d_Curve &) –
- isRev1 (bool) –
- isRev2 (bool) –
- isError (bool) – default value is Standard_False
Return type: