OCC.Core.ShapeCustom module

ShapeCustom module, see official documentation at https://www.opencascade.com/doc/occt-7.4.0/refman/html/package_shapecustom.html

class ShapeCustom_ConvertToBSpline(*args)

Bases: OCC.Core.ShapeCustom.ShapeCustom_Modification

Return type

None

static DownCast(t)
SetExtrusionMode()
  • Sets mode for convertion of Surfaces of Linear extrusion.
    param extrMode

    type extrMode

    bool

    rtype

    None

SetOffsetMode()
  • Sets mode for convertion of Offset surfaces.
    param offsetMode

    type offsetMode

    bool

    rtype

    None

SetPlaneMode()
  • Sets mode for convertion of Plane surfaces.
    param planeMode

    type planeMode

    bool

    rtype

    None

SetRevolutionMode()
  • Sets mode for convertion of Surfaces of Revolution.
    param revolMode

    type revolMode

    bool

    rtype

    None

property thisown

The membership flag

class ShapeCustom_Curve(*args)

Bases: object

Return type

None:param C: :type C: Geom_Curve :rtype: None

ConvertToPeriodic()
  • Tries to convert the Curve to the Periodic form Returns the resulting curve Works only if the Curve is BSpline and is closed with Precision::Confusion() Else, or in case of failure, returns a Null Handle
    param substitute

    type substitute

    bool

    param preci

    default value is -1

    type preci

    float

    rtype

    opencascade::handle<Geom_Curve>

Init()
Parameters

C

type C

Geom_Curve

rtype

None

property thisown

The membership flag

class ShapeCustom_Curve2d

Bases: object

static ConvertToLine2d()
  • Try to convert BSpline2d or Bezier2d to line 2d only if it is linear. Recalculate first and last parameters. Returns line2d or null curve2d.
    param theCurve

    type theCurve

    Geom2d_Curve

    param theFirstIn

    type theFirstIn

    float

    param theLastIn

    type theLastIn

    float

    param theTolerance

    type theTolerance

    float

    param theNewFirst

    type theNewFirst

    float

    param theNewLast

    type theNewLast

    float

    param theDeviation

    type theDeviation

    float

    rtype

    opencascade::handle<Geom2d_Line>

static IsLinear()
  • Check if poleses is in the plane with given precision Returns false if no.
    param thePoles

    type thePoles

    TColgp_Array1OfPnt2d

    param theTolerance

    type theTolerance

    float

    param theDeviation

    type theDeviation

    float

    rtype

    bool

static SimplifyBSpline2d()
  • Try to remove knots from bspline where local derivatives are the same. Remove knots with given precision. Returns false if Bsplien was not modified
    param theBSpline2d

    type theBSpline2d

    Geom2d_BSplineCurve

    param theTolerance

    type theTolerance

    float

    rtype

    bool

property thisown

The membership flag

class ShapeCustom_DirectModification(*args)

Bases: OCC.Core.ShapeCustom.ShapeCustom_Modification

Return type

None

static DownCast(t)
property thisown

The membership flag

class ShapeCustom_Modification(*args, **kwargs)

Bases: OCC.Core.BRepTools.BRepTools_Modification

  • Empty constructor

Return type

None* Copy constructor – does nothing

Parameters

& (Standard_Transient) –

Return type

None

static DownCast(t)
MsgRegistrator()
  • Returns message registrator
    rtype

    opencascade::handle<ShapeExtend_BasicMsgRegistrator>

SendMsg()
  • Sends a message to be attached to the shape. Calls corresponding message of message registrator.
    param shape

    type shape

    TopoDS_Shape

    param message

    type message

    Message_Msg

    param gravity

    default value is Message_Info

    type gravity

    Message_Gravity

    rtype

    None

SetMsgRegistrator()
  • Sets message registrator
    param msgreg

    type msgreg

    ShapeExtend_BasicMsgRegistrator

    rtype

    void

property thisown

The membership flag

class ShapeCustom_RestrictionParameters(*args)

Bases: OCC.Core.Standard.Standard_Transient

  • Sets default parameters.
    rtype

    None

static DownCast(t)
GetConvertBezierSurf(ShapeCustom_RestrictionParameters self) → Standard_Boolean
GetConvertConicalSurf(ShapeCustom_RestrictionParameters self) → Standard_Boolean
GetConvertCurve2d(ShapeCustom_RestrictionParameters self) → Standard_Boolean
GetConvertCurve3d(ShapeCustom_RestrictionParameters self) → Standard_Boolean
GetConvertCylindricalSurf(ShapeCustom_RestrictionParameters self) → Standard_Boolean
GetConvertExtrusionSurf(ShapeCustom_RestrictionParameters self) → Standard_Boolean
GetConvertOffsetCurv2d(ShapeCustom_RestrictionParameters self) → Standard_Boolean
GetConvertOffsetCurv3d(ShapeCustom_RestrictionParameters self) → Standard_Boolean
GetConvertOffsetSurf(ShapeCustom_RestrictionParameters self) → Standard_Boolean
GetConvertPlane(ShapeCustom_RestrictionParameters self) → Standard_Boolean
GetConvertRevolutionSurf(ShapeCustom_RestrictionParameters self) → Standard_Boolean
GetConvertSphericalSurf(ShapeCustom_RestrictionParameters self) → Standard_Boolean
GetConvertToroidalSurf(ShapeCustom_RestrictionParameters self) → Standard_Boolean
GetGMaxDegree(ShapeCustom_RestrictionParameters self) → Standard_Integer
GetGMaxSeg(ShapeCustom_RestrictionParameters self) → Standard_Integer
GetSegmentSurfaceMode(ShapeCustom_RestrictionParameters self) → Standard_Boolean
SetConvertBezierSurf(ShapeCustom_RestrictionParameters self, Standard_Boolean value)
SetConvertConicalSurf(ShapeCustom_RestrictionParameters self, Standard_Boolean value)
SetConvertCurve2d(ShapeCustom_RestrictionParameters self, Standard_Boolean value)
SetConvertCurve3d(ShapeCustom_RestrictionParameters self, Standard_Boolean value)
SetConvertCylindricalSurf(ShapeCustom_RestrictionParameters self, Standard_Boolean value)
SetConvertExtrusionSurf(ShapeCustom_RestrictionParameters self, Standard_Boolean value)
SetConvertOffsetCurv2d(ShapeCustom_RestrictionParameters self, Standard_Boolean value)
SetConvertOffsetCurv3d(ShapeCustom_RestrictionParameters self, Standard_Boolean value)
SetConvertOffsetSurf(ShapeCustom_RestrictionParameters self, Standard_Boolean value)
SetConvertPlane(ShapeCustom_RestrictionParameters self, Standard_Boolean value)
SetConvertRevolutionSurf(ShapeCustom_RestrictionParameters self, Standard_Boolean value)
SetConvertSphericalSurf(ShapeCustom_RestrictionParameters self, Standard_Boolean value)
SetConvertToroidalSurf(ShapeCustom_RestrictionParameters self, Standard_Boolean value)
SetGMaxDegree(ShapeCustom_RestrictionParameters self, Standard_Integer value)
SetGMaxSeg(ShapeCustom_RestrictionParameters self, Standard_Integer value)
SetSegmentSurfaceMode(ShapeCustom_RestrictionParameters self, Standard_Boolean value)
property thisown

The membership flag

class ShapeCustom_Surface(*args)

Bases: object

Return type

None:param S: :type S: Geom_Surface :rtype: None

ConvertToAnalytical()
  • Tries to convert the Surface to an Analytic form Returns the result Works only if the Surface is BSpline or Bezier. Else, or in case of failure, returns a Null Handle //! If <substitute> is True, the new surface replaces the actual one in <self> //! It works by analysing the case which can apply, creating the corresponding analytic surface, then checking coincidence Warning: Parameter laws are not kept, hence PCurves should be redone
    param tol

    type tol

    float

    param substitute

    type substitute

    bool

    rtype

    opencascade::handle<Geom_Surface>

ConvertToPeriodic()
  • Tries to convert the Surface to the Periodic form Returns the resulting surface Works only if the Surface is BSpline and is closed with Precision::Confusion() Else, or in case of failure, returns a Null Handle
    param substitute

    type substitute

    bool

    param preci

    default value is -1

    type preci

    float

    rtype

    opencascade::handle<Geom_Surface>

Gap()
  • Returns maximal deviation of converted surface from the original one computed by last call to ConvertToAnalytical
    rtype

    float

Init()
Parameters

S

type S

Geom_Surface

rtype

None

property thisown

The membership flag

class ShapeCustom_TrsfModification(*args)

Bases: OCC.Core.BRepTools.BRepTools_TrsfModification

  • Empty constructor
    param T

    type T

    gp_Trsf

    rtype

    None

static DownCast(t)
property thisown

The membership flag

class SwigPyIterator(*args, **kwargs)

Bases: object

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

The membership flag

value()
class shapecustom

Bases: object

static BSplineRestriction()
  • Returns a new shape with all surfaces, curves and pcurves which type is BSpline/Bezier or based on them converted having Degree less than <MaxDegree> or number of spans less than <NbMaxSegment> in dependence on parameter priority <Degree>. <GmaxDegree> and <GMaxSegments> are maximum possible degree and number of spans correspondingly. These values will be used in those cases when approximation with specified parameters is impossible and one of GmaxDegree or GMaxSegments is selected in dependence on priority. Note that even if approximation is impossible with <GMaxDegree> then number of spans can exceed specified <GMaxSegment> <Rational> specifies if to convert Rational BSpline/Bezier into polynomial B-Spline. If flags ConvOffSurf,ConvOffCurve3d,ConvOffCurve2d are Standard_True there are means that Offset surfaces , Offset curves 3d and Offset curves 2d are converted to BSPline correspondingly.
    param S

    type S

    TopoDS_Shape

    param Tol3d

    type Tol3d

    float

    param Tol2d

    type Tol2d

    float

    param MaxDegree

    type MaxDegree

    int

    param MaxNbSegment

    type MaxNbSegment

    int

    param Continuity3d

    type Continuity3d

    GeomAbs_Shape

    param Continuity2d

    type Continuity2d

    GeomAbs_Shape

    param Degree

    type Degree

    bool

    param Rational

    type Rational

    bool

    param aParameters

    type aParameters

    ShapeCustom_RestrictionParameters

    rtype

    TopoDS_Shape

static ConvertToBSpline()
  • Returns a new shape with all surfaces of linear extrusion, revolution, offset, and planar surfaces converted according to flags to Geom_BSplineSurface (with same parameterisation).
    param S

    type S

    TopoDS_Shape

    param extrMode

    type extrMode

    bool

    param revolMode

    type revolMode

    bool

    param offsetMode

    type offsetMode

    bool

    param planeMode

    default value is Standard_False

    type planeMode

    bool

    rtype

    TopoDS_Shape

static ConvertToRevolution()
  • Returns a new shape with all elementary periodic surfaces converted to Geom_SurfaceOfRevolution
    param S

    type S

    TopoDS_Shape

    rtype

    TopoDS_Shape

static DirectFaces()
  • Returns a new shape without indirect surfaces.
    param S

    type S

    TopoDS_Shape

    rtype

    TopoDS_Shape

static ScaleShape()
  • Returns a new shape which is scaled original
    param S

    type S

    TopoDS_Shape

    param scale

    type scale

    float

    rtype

    TopoDS_Shape

static SweptToElementary()
  • Returns a new shape with all surfaces of revolution and linear extrusion convert to elementary periodic surfaces
    param S

    type S

    TopoDS_Shape

    rtype

    TopoDS_Shape

property thisown

The membership flag