OCC.ShapeConstruct module

class OCC.ShapeConstruct.Handle_ShapeConstruct_ProjectCurveOnSurface(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

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

The membership flag

class OCC.ShapeConstruct.ShapeConstruct_CompBezierCurves2dToBSplineCurve2d(AngularTolerance=0.0001)

Bases: object

AddCurve()
Parameters:Poles (TColgp_Array1OfPnt2d) –
Return type:None
Degree()
Return type:int
KnotsAndMults()
Parameters:
  • Knots (TColStd_Array1OfReal &) –
  • Mults (TColStd_Array1OfInteger &) –
Return type:

None

NbKnots()
Return type:int
NbPoles()
Return type:int
Perform()
  • Computes the algorithm.
Return type:None
Poles()
Parameters:Poles (TColgp_Array1OfPnt2d) –
Return type:None
thisown

The membership flag

class OCC.ShapeConstruct.ShapeConstruct_CompBezierCurvesToBSplineCurve(AngularTolerance=0.0001)

Bases: object

AddCurve()
Parameters:Poles (TColgp_Array1OfPnt) –
Return type:None
Degree()
Return type:int
KnotsAndMults()
Parameters:
  • Knots (TColStd_Array1OfReal &) –
  • Mults (TColStd_Array1OfInteger &) –
Return type:

None

NbKnots()
Return type:int
NbPoles()
Return type:int
Perform()
  • Computes the algorithm.
Return type:None
Poles()
Parameters:Poles (TColgp_Array1OfPnt) –
Return type:None
thisown

The membership flag

class OCC.ShapeConstruct.ShapeConstruct_Curve(*args, **kwargs)

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:
  • C3D (Handle_Geom_Curve &) –
  • P1 (gp_Pnt) –
  • P2 (gp_Pnt) –
  • take1 (bool) – default value is Standard_True
  • take2 (bool) – default value is Standard_True
Return type:

bool

  • 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:
  • C3D (Handle_Geom_Curve &) –
  • P1 (gp_Pnt) –
  • P2 (gp_Pnt) –
  • take1 (bool) – default value is Standard_True
  • take2 (bool) – default value is Standard_True
Return type:

bool

  • 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:
  • C3D (Handle_Geom_Curve &) –
  • P1 (gp_Pnt) –
  • P2 (gp_Pnt) –
  • take1 (bool) – default value is Standard_True
  • take2 (bool) – default value is Standard_True
Return type:

bool

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:
  • C2D (Handle_Geom2d_Curve &) –
  • P1 (gp_Pnt2d) –
  • P2 (gp_Pnt2d) –
  • take1 (bool) – default value is Standard_True
  • take2 (bool) – default value is Standard_True
Return type:

bool

  • 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:
  • C2D (Handle_Geom2d_Curve &) –
  • P1 (gp_Pnt2d) –
  • P2 (gp_Pnt2d) –
  • take1 (bool) – default value is Standard_True
  • take2 (bool) – default value is Standard_True
Return type:

bool

  • 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:
  • C2D (Handle_Geom2d_Curve &) –
  • P1 (gp_Pnt2d) –
  • P2 (gp_Pnt2d) –
  • take1 (bool) – default value is Standard_True
  • take2 (bool) – default value is Standard_True
Return type:

bool

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:
  • C3D (Handle_Geom_Curve &) –
  • P1 (gp_Pnt) –
  • P2 (gp_Pnt) –
  • U1 (float) –
  • U2 (float) –
Return type:

bool

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:
  • C (Handle_Geom_Curve &) –
  • first (float) –
  • last (float) –
  • prec (float) –
Return type:

Handle_Geom_BSplineCurve

  • 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:
  • C (Handle_Geom2d_Curve &) –
  • first (float) –
  • last (float) –
  • prec (float) –
Return type:

Handle_Geom2d_BSplineCurve

static FixKnots(*args)
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

OCC.ShapeConstruct.ShapeConstruct_Curve_FixKnots(*args)
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 OCC.ShapeConstruct.ShapeConstruct_MakeTriangulation(*args)

Bases: OCC.BRepBuilderAPI.BRepBuilderAPI_MakeShape

thisown

The membership flag

class OCC.ShapeConstruct.ShapeConstruct_ProjectCurveOnSurface

Bases: OCC.MMgt.MMgt_TShared

GetAdjustOverDegenMode()

ShapeConstruct_ProjectCurveOnSurface_GetAdjustOverDegenMode(ShapeConstruct_ProjectCurveOnSurface self) -> Standard_Integer

GetBuildCurveMode()

ShapeConstruct_ProjectCurveOnSurface_GetBuildCurveMode(ShapeConstruct_ProjectCurveOnSurface self) -> Standard_Boolean

GetHandle()

ShapeConstruct_ProjectCurveOnSurface_GetHandle(ShapeConstruct_ProjectCurveOnSurface self) -> Handle_ShapeConstruct_ProjectCurveOnSurface

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 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:
  • c3d (Handle_Geom_Curve &) –
  • First (float) –
  • Last (float) –
  • c2d (Handle_Geom2d_Curve &) –
  • continuity (GeomAbs_Shape) – default value is GeomAbs_C1
  • maxdeg (Standard_Integer) – default value is 12
  • nbinterval (Standard_Integer) – default value is - 1
Return type:

bool

  • 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:
  • c3d (Handle_Geom_Curve &) –
  • First (float) –
  • Last (float) –
  • c2d (Handle_Geom2d_Curve &) –
  • continuity (GeomAbs_Shape) – default value is GeomAbs_C1
  • maxdeg (Standard_Integer) – default value is 12
  • nbinterval (Standard_Integer) – default value is - 1
Return type:

bool

  • 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:
  • c3d (Handle_Geom_Curve &) –
  • First (float) –
  • Last (float) –
  • c2d (Handle_Geom2d_Curve &) –
  • continuity (GeomAbs_Shape) – default value is GeomAbs_C1
  • maxdeg (Standard_Integer) – default value is 12
  • nbinterval (Standard_Integer) – default value is - 1
Return type:

bool

  • 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:
  • c3d (Handle_Geom_Curve &) –
  • First (float) –
  • Last (float) –
  • c2d (Handle_Geom2d_Curve &) –
  • continuity (GeomAbs_Shape) – default value is GeomAbs_C1
  • maxdeg (Standard_Integer) – default value is 12
  • nbinterval (Standard_Integer) – default value is - 1
Return type:

bool

PerformAdvanced()
  • Computes the projection of 3d curve onto a surface using either standard projector (method PerformByStandard()) 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:
  • c3d (Handle_Geom_Curve &) –
  • First (float) –
  • Last (float) –
  • c2d (Handle_Geom2d_Curve &) –
Return type:

bool

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:
  • c3d (Handle_Geom_Curve &) –
  • First (float) –
  • Last (float) –
  • c2d (Handle_Geom2d_Curve &) –
  • continuity (GeomAbs_Shape) – default value is GeomAbs_C1
  • maxdeg (Standard_Integer) – default value is 12
  • nbinterval (Standard_Integer) – default value is - 1
Return type:

bool

  • 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:
  • c3d (Handle_Geom_Curve &) –
  • First (float) –
  • Last (float) –
  • c2d (Handle_Geom2d_Curve &) –
  • continuity (GeomAbs_Shape) – default value is GeomAbs_C1
  • maxdeg (Standard_Integer) – default value is 12
  • nbinterval (Standard_Integer) – default value is - 1
Return type:

bool

  • 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:
  • c3d (Handle_Geom_Curve &) –
  • First (float) –
  • Last (float) –
  • c2d (Handle_Geom2d_Curve &) –
  • continuity (GeomAbs_Shape) – default value is GeomAbs_C1
  • maxdeg (Standard_Integer) – default value is 12
  • nbinterval (Standard_Integer) – default value is - 1
Return type:

bool

  • 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:
  • c3d (Handle_Geom_Curve &) –
  • First (float) –
  • Last (float) –
  • c2d (Handle_Geom2d_Curve &) –
  • continuity (GeomAbs_Shape) – default value is GeomAbs_C1
  • maxdeg (Standard_Integer) – default value is 12
  • nbinterval (Standard_Integer) – default value is - 1
Return type:

bool

SetAdjustOverDegenMode()

ShapeConstruct_ProjectCurveOnSurface_SetAdjustOverDegenMode(ShapeConstruct_ProjectCurveOnSurface self, Standard_Integer value)

SetBuildCurveMode()

ShapeConstruct_ProjectCurveOnSurface_SetBuildCurveMode(ShapeConstruct_ProjectCurveOnSurface self, Standard_Boolean value)

SetPrecision()
  • Sets value for current precision
Parameters:preci (float) –
Return type:None
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 OCC.ShapeConstruct.SwigPyIterator(*args, **kwargs)

Bases: object

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

The membership flag

value()
class OCC.ShapeConstruct.shapeconstruct(*args, **kwargs)

Bases: object

static ConvertCurveToBSpline(*args)
  • Tool for wire triangulation
Parameters:
  • C3D (Handle_Geom_Curve &) –
  • First (float) –
  • Last (float) –
  • Tol3d (float) –
  • Continuity (GeomAbs_Shape) –
  • MaxSegments (Standard_Integer) –
  • MaxDegree (Standard_Integer) –
  • C2D (Handle_Geom2d_Curve &) –
  • First
  • Last
  • Tol2d (float) –
  • Continuity
  • MaxSegments
  • MaxDegree
Return type:

Handle_Geom_BSplineCurve

Return type:

Handle_Geom2d_BSplineCurve

static ConvertSurfaceToBSpline(*args)
Parameters:
  • surf (Handle_Geom_Surface &) –
  • UF (float) –
  • UL (float) –
  • VF (float) –
  • VL (float) –
  • Tol3d (float) –
  • Continuity (GeomAbs_Shape) –
  • MaxSegments (Standard_Integer) –
  • MaxDegree (Standard_Integer) –
Return type:

Handle_Geom_BSplineSurface

static JoinCurves(*args)
  • //!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:
  • c3d1 (Handle_Geom_Curve &) –
  • ac3d2 (Handle_Geom_Curve &) –
  • Orient1 (TopAbs_Orientation) –
  • Orient2 (TopAbs_Orientation) –
  • first1 (float &) –
  • last1 (float &) –
  • first2 (float &) –
  • last2 (float &) –
  • c3dOut (Handle_Geom_Curve &) –
  • isRev1 (bool) –
  • isRev2 (bool) –
Return type:

bool

  • //!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:

bool

  • //!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:

bool

static JoinPCurves(*args)
  • 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:

bool

thisown

The membership flag

OCC.ShapeConstruct.shapeconstruct_ConvertCurveToBSpline(*args)
  • Tool for wire triangulation
Parameters:
  • C3D (Handle_Geom_Curve &) –
  • First (float) –
  • Last (float) –
  • Tol3d (float) –
  • Continuity (GeomAbs_Shape) –
  • MaxSegments (Standard_Integer) –
  • MaxDegree (Standard_Integer) –
  • C2D (Handle_Geom2d_Curve &) –
  • First
  • Last
  • Tol2d (float) –
  • Continuity
  • MaxSegments
  • MaxDegree
Return type:

Handle_Geom_BSplineCurve

Return type:

Handle_Geom2d_BSplineCurve

OCC.ShapeConstruct.shapeconstruct_ConvertSurfaceToBSpline(*args)
Parameters:
  • surf (Handle_Geom_Surface &) –
  • UF (float) –
  • UL (float) –
  • VF (float) –
  • VL (float) –
  • Tol3d (float) –
  • Continuity (GeomAbs_Shape) –
  • MaxSegments (Standard_Integer) –
  • MaxDegree (Standard_Integer) –
Return type:

Handle_Geom_BSplineSurface

OCC.ShapeConstruct.shapeconstruct_JoinCurves(*args)
  • //!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:
  • c3d1 (Handle_Geom_Curve &) –
  • ac3d2 (Handle_Geom_Curve &) –
  • Orient1 (TopAbs_Orientation) –
  • Orient2 (TopAbs_Orientation) –
  • first1 (float &) –
  • last1 (float &) –
  • first2 (float &) –
  • last2 (float &) –
  • c3dOut (Handle_Geom_Curve &) –
  • isRev1 (bool) –
  • isRev2 (bool) –
Return type:

bool

  • //!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:

bool

  • //!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:

bool

OCC.ShapeConstruct.shapeconstruct_JoinPCurves(*args)
  • 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:

bool