OCC.Core.ShapeFix module

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

class ShapeFix_ComposeShell(*args)

Bases: OCC.Core.ShapeFix.ShapeFix_Root

  • Creates empty tool.
    rtype

    None

DispatchWires()
  • Creates new faces from the set of (closed) wires. Each wire is put on corresponding patch in the composite surface, and all pcurves on the initial (pseudo)face are reassigned to that surface. If several wires are one inside another, single face is created.
    param faces

    type faces

    TopTools_SequenceOfShape

    param wires

    type wires

    ShapeFix_SequenceOfWireSegment

    rtype

    None

static DownCast(t)
GetClosedMode(ShapeFix_ComposeShell self) → Standard_Boolean
GetTransferParamTool()
  • Gets tool for transfer parameters from 3d to 2d and vice versa.
    rtype

    opencascade::handle<ShapeAnalysis_TransferParameters>

Init()
  • Initializes with composite surface, face and precision. Here face defines both set of wires and way of getting pcurves. Precision is used (together with tolerance of edges) for handling subtle cases, such as tangential intersections.
    param Grid

    type Grid

    ShapeExtend_CompositeSurface

    param L

    type L

    TopLoc_Location

    param Face

    type Face

    TopoDS_Face

    param Prec

    type Prec

    float

    rtype

    None

Perform()
  • Performs the work on already loaded data.
    rtype

    bool

Result()
  • Returns resulting shell or face (or Null shape if not done)
    rtype

    TopoDS_Shape

SetClosedMode(ShapeFix_ComposeShell self, Standard_Boolean value)
SetTransferParamTool()
  • Sets tool for transfer parameters from 3d to 2d and vice versa.
    param TransferParam

    type TransferParam

    ShapeAnalysis_TransferParameters

    rtype

    None

SplitEdges()
  • Splits edges in the original shape by grid. This is a part of Perform() which does not produce any resulting shape; the only result is filled context where splittings are recorded. //! NOTE: If edge is splitted, it is replaced by wire, and order of edges in the wire corresponds to FORWARD orientation of the edge.
    rtype

    None

Status()
  • Queries status of last call to Perform() OKnothing done (some kind of error) DONE1: splitting is done, at least one new face created DONE2: splitting is done, several new faces obtained FAIL1: misoriented wire encountered (handled) FAIL2: recoverable parity error FAIL3: edge with no pcurve on supporting face FAIL4: unrecoverable algorithm error (parity check)
    param status

    type status

    ShapeExtend_Status

    rtype

    bool

property thisown

The membership flag

class ShapeFix_DataMapOfShapeBox2d(*args)

Bases: object

Assign()
Bind()
Bound()
ChangeFind()
ChangeSeek()
Clear()
Exchange()
Find()
IsBound()
ReSize()
Seek()
Set()
Size()
UnBind()
begin()
cbegin()
cend()
end()
property thisown

The membership flag

class ShapeFix_Edge(*args)

Bases: OCC.Core.Standard.Standard_Transient

  • Empty constructor
    rtype

    None

static DownCast(t)
FixAddCurve3d()
  • Tries to build 3d curve of the edge if missing UseIt is to be called after FixRemoveCurve3d (if removed) or in any case when edge can have no 3d curve Returns: True if 3d curve was added, else False StatusOK3d curve exists FAIL1: BRepLib::BuildCurve3d() has failed DONE1: 3d curve was added
    param edge

    type edge

    TopoDS_Edge

    rtype

    bool

FixAddPCurve()
  • See method below for information
    param edge

    type edge

    TopoDS_Edge

    param face

    type face

    TopoDS_Face

    param isSeam

    type isSeam

    bool

    param prec

    default value is 0.0

    type prec

    float

    rtype

    bool* See method below for information

    param edge

    type edge

    TopoDS_Edge

    param surface

    type surface

    Geom_Surface

    param location

    type location

    TopLoc_Location

    param isSeam

    type isSeam

    bool

    param prec

    default value is 0.0

    type prec

    float

    rtype

    bool* See method below for information

    param edge

    type edge

    TopoDS_Edge

    param face

    type face

    TopoDS_Face

    param isSeam

    type isSeam

    bool

    param surfana

    type surfana

    ShapeAnalysis_Surface

    param prec

    default value is 0.0

    type prec

    float

    rtype

    bool* Adds pcurve(s) of the edge if missing (by projecting 3d curve) Parameter isSeam indicates if the edge is a seam. The parameter <prec> defines the precision for calculations. If it is 0 (default), the tolerance of the edge is taken. Remark : This method is rather for internal use since it accepts parameter <surfana> for optimization of computations Use : It is to be called after FixRemovePCurve (if removed) or in any case when edge can have no pcurve Returns: True if pcurve was added, else False Status : OK : Pcurve exists FAIL1: No 3d curve FAIL2: fail during projecting DONE1: Pcurve was added DONE2: specific case of pcurve going through degenerated point on sphere encountered during projection (see class ShapeConstruct_ProjectCurveOnSurface for more info)

    param edge

    type edge

    TopoDS_Edge

    param surface

    type surface

    Geom_Surface

    param location

    type location

    TopLoc_Location

    param isSeam

    type isSeam

    bool

    param surfana

    type surfana

    ShapeAnalysis_Surface

    param prec

    default value is 0.0

    type prec

    float

    rtype

    bool

FixRemoveCurve3d()
  • Removes 3d curve of the edge if it does not match the vertices Returns: True, if does not match, removed (status DONE) False, (status OK) if matches or (status FAIL) if no 3d curve, nothing done
    param edge

    type edge

    TopoDS_Edge

    rtype

    bool

FixRemovePCurve()
Parameters

edge

type edge

TopoDS_Edge

param face

type face

TopoDS_Face

rtype

bool* Removes the pcurve(s) of the edge if it does not match the vertices Check is done Use : It is to be called when pcurve of an edge can be wrong (e.g., after import from IGES) Returns: True, if does not match, removed (status DONE) False, (status OK) if matches or (status FAIL) if no pcurve, nothing done

param edge

type edge

TopoDS_Edge

param surface

type surface

Geom_Surface

param location

type location

TopLoc_Location

rtype

bool

FixReversed2d()
Parameters

edge

type edge

TopoDS_Edge

param face

type face

TopoDS_Face

rtype

bool* Fixes edge if pcurve is directed opposite to 3d curve Check is done by call to the function ShapeAnalysis_Edge::CheckCurve3dWithPCurve() Warning: For seam edge this method will check and fix the pcurve in only one direction. Hence, it should be called twice for seam edge: once with edge orientation FORWARD and once with REVERSED. Returns: False if nothing done, True if reversed (status DONE) Status: OK - pcurve OK, nothing done FAIL1 - no pcurve FAIL2 - no 3d curve DONE1 - pcurve was reversed

param edge

type edge

TopoDS_Edge

param surface

type surface

Geom_Surface

param location

type location

TopLoc_Location

rtype

bool

FixSameParameter()
  • Tries to make edge SameParameter and sets corresponding tolerance and SameParameter flag. First, it makes edge same range if SameRange flag is not set. //! If flag SameParameter is set, this method calls the function ShapeAnalysis_Edge::CheckSameParameter() that calculates the maximal deviation of pcurves of the edge from its 3d curve. If deviation > tolerance, the tolerance of edge is increased to a value of deviation. If deviation < tolerance nothing happens. //! If flag SameParameter is not set, this method chooses the best variant (one that has minimal tolerance), either a. only after computing deviation (as above) or b. after calling standard procedure BRepLib::SameParameter and computing deviation (as above). If <tolerance> > 0, it is used as parameter for BRepLib::SameParameter, otherwise, tolerance of the edge is used. //! UseIs to be called after all pcurves and 3d curve of the edge are correctly computed RemarkSameParameter flag is always set to True after this method Returns: True, if something done, else False StatusOK - edge was initially SameParameter, nothing is done FAIL1 - computation of deviation of pcurves from 3d curve has failed FAIL2 - BRepLib::SameParameter() has failed DONE1 - tolerance of the edge was increased DONE2 - flag SameParameter was set to True (only if BRepLib::SameParameter() did not set it) DONE3 - edge was modified by BRepLib::SameParameter() to SameParameter DONE4 - not used anymore DONE5 - if the edge resulting from BRepLib has been chosen, i.e. variant b. above (only for edges with not set SameParameter)
    param edge

    type edge

    TopoDS_Edge

    param tolerance

    default value is 0.0

    type tolerance

    float

    rtype

    bool* Tries to make edge SameParameter and sets corresponding tolerance and SameParameter flag. First, it makes edge same range if SameRange flag is not set. //! If flag SameParameter is set, this method calls the function ShapeAnalysis_Edge::CheckSameParameter() that calculates the maximal deviation of pcurves of the edge from its 3d curve. If deviation > tolerance, the tolerance of edge is increased to a value of deviation. If deviation < tolerance nothing happens. //! If flag SameParameter is not set, this method chooses the best variant (one that has minimal tolerance), either a. only after computing deviation (as above) or b. after calling standard procedure BRepLib::SameParameter and computing deviation (as above). If <tolerance> > 0, it is used as parameter for BRepLib::SameParameter, otherwise, tolerance of the edge is used. //! Use : Is to be called after all pcurves and 3d curve of the edge are correctly computed Remark : SameParameter flag is always set to True after this method Returns: True, if something done, else False Status : OK - edge was initially SameParameter, nothing is done FAIL1 - computation of deviation of pcurves from 3d curve has failed FAIL2 - BRepLib::SameParameter() has failed DONE1 - tolerance of the edge was increased DONE2 - flag SameParameter was set to True (only if BRepLib::SameParameter() did not set it) DONE3 - edge was modified by BRepLib::SameParameter() to SameParameter DONE4 - not used anymore DONE5 - if the edge resulting from BRepLib has been chosen, i.e. variant b. above (only for edges with not set SameParameter)

    param edge

    type edge

    TopoDS_Edge

    param face

    type face

    TopoDS_Face

    param tolerance

    default value is 0.0

    type tolerance

    float

    rtype

    bool

FixVertexTolerance()
Parameters

edge

type edge

TopoDS_Edge

param face

type face

TopoDS_Face

rtype

bool* Increases the tolerances of the edge vertices to comprise the ends of 3d curve and pcurve on the given face (first method) or all pcurves stored in an edge (second one) Returns: True, if tolerances have been increased, otherwise False Status: OK : the original tolerances have not been changed DONE1: the tolerance of first vertex has been increased DONE2: the tolerance of last vertex has been increased

param edge

type edge

TopoDS_Edge

rtype

bool

Projector()
  • Returns the projector used for recomputing missing pcurves Can be used for adjusting parameters of projector
    rtype

    opencascade::handle<ShapeConstruct_ProjectCurveOnSurface>

SetContext()
  • Sets context
    param context

    type context

    ShapeBuild_ReShape

    rtype

    None

Status()
  • Returns the status (in the form of True/False) of last Fix
    param status

    type status

    ShapeExtend_Status

    rtype

    bool

property thisown

The membership flag

class ShapeFix_EdgeConnect(*args)

Bases: object

Return type

None

Add()
  • Adds information on connectivity between start vertex of second edge and end vertex of first edge, taking edges orientation into account
    param aFirst

    type aFirst

    TopoDS_Edge

    param aSecond

    type aSecond

    TopoDS_Edge

    rtype

    None* Adds connectivity information for the whole shape. Note: edges in wires must be well ordered Note: flag Closed should be set for closed wires

    param aShape

    type aShape

    TopoDS_Shape

    rtype

    None

Build()
  • Builds shared vertices, updates their positions and tolerances
    rtype

    None

Clear()
  • Clears internal data structure
    rtype

    None

property thisown

The membership flag

class ShapeFix_EdgeProjAux(*args)

Bases: OCC.Core.Standard.Standard_Transient

Return type

None:param F: :type F: TopoDS_Face :param E: :type E: TopoDS_Edge :rtype: None

Compute()
Parameters

preci

type preci

float

rtype

None

static DownCast(t)
FirstParam()
Return type

float

Init()
Parameters

F

type F

TopoDS_Face

param E

type E

TopoDS_Edge

rtype

None

IsFirstDone()
Return type

bool

IsIso()
Parameters

C

type C

Geom2d_Curve

rtype

bool

IsLastDone()
Return type

bool

LastParam()
Return type

float

property thisown

The membership flag

class ShapeFix_Face(*args)

Bases: OCC.Core.ShapeFix.ShapeFix_Root

  • Creates an empty tool
    rtype

    None* Creates a tool and loads a face

    param face

    type face

    TopoDS_Face

    rtype

    None

Add()
  • Add a wire to current face using BRep_Builder. Wire is added without taking into account orientation of face (as if face were FORWARD).
    param wire

    type wire

    TopoDS_Wire

    rtype

    None

ClearModes()
  • Sets all modes to default
    rtype

    void

static DownCast(t)
Face()
  • Returns a face which corresponds to the current state Warning: The finally produced face may be another one … but with the same support
    rtype

    TopoDS_Face

FixAddNaturalBound()
  • Adds natural boundary on face if it is missing. Two cases are supported: - face has no wires - face lies on geometrically double-closed surface (sphere or torus) and none of wires is left-oriented Returns True if natural boundary was added
    rtype

    bool

FixIntersectingWires()
  • Detects and fixes the special case when face has more than one wire and this wires have intersection point
    rtype

    bool

FixLoopWire()
  • Detects if wire has a loop and fixes this situation by splitting on the few parts. if wire has a loops and it was splitted Status was set to value ShapeExtend_DONE6.
    param aResWires

    type aResWires

    TopTools_SequenceOfShape

    rtype

    bool

FixMissingSeam()
  • Detects and fixes the special case when face on a closed surface is given by two wires closed in 3d but with gap in 2d. In that case it creates a new wire from the two, and adds a missing seam edge Returns True if missing seam was added
    rtype

    bool

FixOrientation()
  • Fixes orientation of wires on the face It tries to make all wires lie outside all others (according to orientation) by reversing orientation of some of them. If face lying on sphere or torus has single wire and AddNaturalBoundMode is True, that wire is not reversed in any case (supposing that natural bound will be added). Returns True if wires were reversed
    rtype

    bool* Fixes orientation of wires on the face It tries to make all wires lie outside all others (according to orientation) by reversing orientation of some of them. If face lying on sphere or torus has single wire and AddNaturalBoundMode is True, that wire is not reversed in any case (supposing that natural bound will be added). Returns True if wires were reversed OutWires return information about out wires + list of internal wires for each (for performing split face).

    param MapWires

    type MapWires

    TopTools_DataMapOfShapeListOfShape

    rtype

    bool

FixPeriodicDegenerated()
  • Fixes topology for a specific case when face is composed by a single wire belting a periodic surface. In that case a degenerated edge is reconstructed in the degenerated pole of the surface. Initial wire gets consistent orientation. Must be used in couple and before FixMissingSeam routine
    rtype

    bool

FixSmallAreaWire()
  • Detects wires with small area (that is less than 100*Precision::PConfusion(). Removes these wires if they are internal. ReturnsTrue if at least one small wire removed, False if does nothing.
    param theIsRemoveSmallFace

    type theIsRemoveSmallFace

    bool

    rtype

    bool

FixSplitFace()
  • Split face if there are more than one out wire using inrormation after FixOrientation()
    param MapWires

    type MapWires

    TopTools_DataMapOfShapeListOfShape

    rtype

    bool

FixWireTool()
  • Returns tool for fixing wires.
    rtype

    opencascade::handle<ShapeFix_Wire>

FixWiresTwoCoincEdges()
  • If wire contains two coincidence edges it must be removed Queries on status after Perform()
    rtype

    bool

GetAutoCorrectPrecisionMode(ShapeFix_Face self) → Standard_Integer
GetFixAddNaturalBoundMode(ShapeFix_Face self) → Standard_Integer
GetFixIntersectingWiresMode(ShapeFix_Face self) → Standard_Integer
GetFixLoopWiresMode(ShapeFix_Face self) → Standard_Integer
GetFixMissingSeamMode(ShapeFix_Face self) → Standard_Integer
GetFixOrientationMode(ShapeFix_Face self) → Standard_Integer
GetFixPeriodicDegeneratedMode(ShapeFix_Face self) → Standard_Integer
GetFixSmallAreaWireMode(ShapeFix_Face self) → Standard_Integer
GetFixSplitFaceMode(ShapeFix_Face self) → Standard_Integer
GetFixWireMode(ShapeFix_Face self) → Standard_Integer
GetRemoveSmallAreaFaceMode(ShapeFix_Face self) → Standard_Integer
Init()
  • Loads a whole face already created, with its wires, sense and location
    param face

    type face

    TopoDS_Face

    rtype

    None* Starts the creation of the face By default it will be FORWARD, or REVERSED if <fwd> is False

    param surf

    type surf

    Geom_Surface

    param preci

    type preci

    float

    param fwd

    default value is Standard_True

    type fwd

    bool

    rtype

    None* Starts the creation of the face By default it will be FORWARD, or REVERSED if <fwd> is False

    param surf

    type surf

    ShapeAnalysis_Surface

    param preci

    type preci

    float

    param fwd

    default value is Standard_True

    type fwd

    bool

    rtype

    None

Perform()
  • Performs all the fixes, depending on modes Function Status returns the status of last call to Perform() ShapeExtend_OKface was OK, nothing done ShapeExtend_DONE1: some wires are fixed ShapeExtend_DONE2: orientation of wires fixed ShapeExtend_DONE3: missing seam added ShapeExtend_DONE4: small area wire removed ShapeExtend_DONE5: natural bounds added ShapeExtend_FAIL1: some fails during fixing wires ShapeExtend_FAIL2: cannot fix orientation of wires ShapeExtend_FAIL3: cannot add missing seam ShapeExtend_FAIL4: cannot remove small area wire
    rtype

    bool

Result()
  • Returns resulting shape (Face or Shell if splitted) To be used instead of Face() if FixMissingSeam involved
    rtype

    TopoDS_Shape

SetAutoCorrectPrecisionMode(ShapeFix_Face self, Standard_Integer value)
SetFixAddNaturalBoundMode(ShapeFix_Face self, Standard_Integer value)
SetFixIntersectingWiresMode(ShapeFix_Face self, Standard_Integer value)
SetFixLoopWiresMode(ShapeFix_Face self, Standard_Integer value)
SetFixMissingSeamMode(ShapeFix_Face self, Standard_Integer value)
SetFixOrientationMode(ShapeFix_Face self, Standard_Integer value)
SetFixPeriodicDegeneratedMode(ShapeFix_Face self, Standard_Integer value)
SetFixSmallAreaWireMode(ShapeFix_Face self, Standard_Integer value)
SetFixSplitFaceMode(ShapeFix_Face self, Standard_Integer value)
SetFixWireMode(ShapeFix_Face self, Standard_Integer value)
SetRemoveSmallAreaFaceMode(ShapeFix_Face self, Standard_Integer value)
Status()
  • Returns the status of last call to Perform() ShapeExtend_OKface was OK, nothing done ShapeExtend_DONE1: some wires are fixed ShapeExtend_DONE2: orientation of wires fixed ShapeExtend_DONE3: missing seam added ShapeExtend_DONE4: small area wire removed ShapeExtend_DONE5: natural bounds added ShapeExtend_DONE8: face may be splited ShapeExtend_FAIL1: some fails during fixing wires ShapeExtend_FAIL2: cannot fix orientation of wires ShapeExtend_FAIL3: cannot add missing seam ShapeExtend_FAIL4: cannot remove small area wire
    param status

    type status

    ShapeExtend_Status

    rtype

    bool

property thisown

The membership flag

class ShapeFix_FaceConnect(*args)

Bases: object

Return type

None

Add()
Parameters

aFirst

type aFirst

TopoDS_Face

param aSecond

type aSecond

TopoDS_Face

rtype

bool

Build()
Parameters

shell

type shell

TopoDS_Shell

param sewtoler

type sewtoler

float

param fixtoler

type fixtoler

float

rtype

TopoDS_Shell

Clear()
  • Clears internal data structure
    rtype

    None

property thisown

The membership flag

class ShapeFix_FixSmallFace(*args)

Bases: OCC.Core.ShapeFix.ShapeFix_Root

Return type

None

ComputeSharedEdgeForStripFace()
  • Compute average edge for strip face
    param F

    type F

    TopoDS_Face

    param E1

    type E1

    TopoDS_Edge

    param E2

    type E2

    TopoDS_Edge

    param F1

    type F1

    TopoDS_Face

    param tol

    type tol

    float

    rtype

    TopoDS_Edge

static DownCast(t)
FixFace()
Parameters

F

type F

TopoDS_Face

rtype

TopoDS_Face

FixPinFace()
Parameters

F

type F

TopoDS_Face

rtype

bool

FixShape()
Return type

TopoDS_Shape

FixSplitFace()
Parameters

S

type S

TopoDS_Shape

rtype

TopoDS_Shape

FixSpotFace()
  • Fixing case of spot face, if tol = -1 used local tolerance.
    rtype

    TopoDS_Shape

FixStripFace()
  • Fixing case of strip face, if tol = -1 used local tolerance
    param wasdone

    default value is Standard_False

    type wasdone

    bool

    rtype

    TopoDS_Shape

Init()
Parameters

S

type S

TopoDS_Shape

rtype

None

Perform()
  • Fixing case of spot face
    rtype

    None

RemoveFacesInCaseOfSpot()
  • Remove spot face from compound
    param F

    type F

    TopoDS_Face

    rtype

    bool

RemoveFacesInCaseOfStrip()
  • Remove strip face from compound.
    param F

    type F

    TopoDS_Face

    rtype

    bool

ReplaceInCaseOfStrip()
  • Replace veretces and edges.
    param F

    type F

    TopoDS_Face

    param E1

    type E1

    TopoDS_Edge

    param E2

    type E2

    TopoDS_Edge

    param tol

    type tol

    float

    rtype

    bool

ReplaceVerticesInCaseOfSpot()
  • Compute average vertex and replacing vertices by new one.
    param F

    type F

    TopoDS_Face

    param tol

    type tol

    float

    rtype

    bool

Shape()
Return type

TopoDS_Shape

SplitOneFace()
  • Compute data for face splitting.
    param F

    type F

    TopoDS_Face

    param theSplittedFaces

    type theSplittedFaces

    TopoDS_Compound

    rtype

    bool

property thisown

The membership flag

class ShapeFix_FixSmallSolid(*args)

Bases: OCC.Core.ShapeFix.ShapeFix_Root

  • Construct
    rtype

    None

static DownCast(t)
Merge()
  • Merge small solids in the given shape to adjacent non-small ones
    param theShape

    type theShape

    TopoDS_Shape

    param theContext

    type theContext

    ShapeBuild_ReShape

    rtype

    TopoDS_Shape

Remove()
  • Remove small solids from the given shape
    param theShape

    type theShape

    TopoDS_Shape

    param theContext

    type theContext

    ShapeBuild_ReShape

    rtype

    TopoDS_Shape

SetFixMode()
  • Set working mode for operator: - theMode = 0 use both WidthFactorThreshold and VolumeThreshold parameters - theMode = 1 use only WidthFactorThreshold parameter - theMode = 2 use only VolumeThreshold parameter
    param theMode

    type theMode

    int

    rtype

    None

SetVolumeThreshold()
  • Set or clear volume threshold for small solids
    param theThreshold

    default value is -1.0

    type theThreshold

    float

    rtype

    None

SetWidthFactorThreshold()
  • Set or clear width factor threshold for small solids
    param theThreshold

    default value is -1.0

    type theThreshold

    float

    rtype

    None

property thisown

The membership flag

class ShapeFix_FreeBounds(*args)

Bases: object

  • Empty constructor
    rtype

    None* Builds forecasting free bounds of the <shape> and connects open wires with tolerance <closetoler>. <shape> should be a compound of faces. Tolerance <closetoler> should be greater than tolerance <sewtoler> used for initializing sewing analyzer, otherwise connection of open wires is not performed.

    param shape

    type shape

    TopoDS_Shape

    param sewtoler

    type sewtoler

    float

    param closetoler

    type closetoler

    float

    param splitclosed

    type splitclosed

    bool

    param splitopen

    type splitopen

    bool

    rtype

    None* Builds actual free bounds of the <shape> and connects open wires with tolerance <closetoler>. <shape> should be a compound of shells.

    param shape

    type shape

    TopoDS_Shape

    param closetoler

    type closetoler

    float

    param splitclosed

    type splitclosed

    bool

    param splitopen

    type splitopen

    bool

    rtype

    None

GetClosedWires()
  • Returns compound of closed wires out of free edges.
    rtype

    TopoDS_Compound

GetOpenWires()
  • Returns compound of open wires out of free edges.
    rtype

    TopoDS_Compound

GetShape()
  • Returns modified source shape.
    rtype

    TopoDS_Shape

property thisown

The membership flag

class ShapeFix_IntersectionTool(*args)

Bases: object

  • Constructor
    param context

    type context

    ShapeBuild_ReShape

    param preci

    type preci

    float

    param maxtol

    default value is 1.0

    type maxtol

    float

    rtype

    None

Context()
  • Returns context
    rtype

    opencascade::handle<ShapeBuild_ReShape>

CutEdge()
  • Cut edge by parameters pend and cut
    param edge

    type edge

    TopoDS_Edge

    param pend

    type pend

    float

    param cut

    type cut

    float

    param face

    type face

    TopoDS_Face

    param iscutline

    type iscutline

    bool

    rtype

    bool

FixIntersectingWires()
Parameters

face

type face

TopoDS_Face

rtype

bool

FixSelfIntersectWire()
Parameters

sewd

type sewd

ShapeExtend_WireData

param face

type face

TopoDS_Face

param NbSplit

type NbSplit

int

param NbCut

type NbCut

int

param NbRemoved

type NbRemoved

int

rtype

bool

SplitEdge()
  • Split edge on two new edges using new vertex ‘vert’ and ‘param’ - parameter for splitting The ‘face’ is necessary for pcurves and using TransferParameterProj
    param edge

    type edge

    TopoDS_Edge

    param param

    type param

    float

    param vert

    type vert

    TopoDS_Vertex

    param face

    type face

    TopoDS_Face

    param newE1

    type newE1

    TopoDS_Edge

    param newE2

    type newE2

    TopoDS_Edge

    param preci

    type preci

    float

    rtype

    bool

property thisown

The membership flag

class ShapeFix_Root(*args)

Bases: OCC.Core.Standard.Standard_Transient

  • Empty Constructor (no context is created)
    rtype

    None

Context()
  • Returns context
    rtype

    opencascade::handle<ShapeBuild_ReShape>

static DownCast(t)
LimitTolerance()
  • Returns tolerance limited by [myMinTol,myMaxTol]
    param toler

    type toler

    float

    rtype

    float

MaxTolerance()
  • Returns maximal allowed tolerance
    rtype

    float

MinTolerance()
  • Returns minimal allowed tolerance
    rtype

    float

MsgRegistrator()
  • Returns message registrator
    rtype

    opencascade::handle<ShapeExtend_BasicMsgRegistrator>

Precision()
  • Returns basic precision value
    rtype

    float

SendFail()
  • Sends a fail to be attached to the shape. Calls SendMsg with gravity set to Message_Fail.
    param shape

    type shape

    TopoDS_Shape

    param message

    type message

    Message_Msg

    rtype

    None* Calls previous method for myShape.

    param message

    type message

    Message_Msg

    rtype

    None

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* Sends a message to be attached to myShape. Calls previous method.

    param message

    type message

    Message_Msg

    param gravity

    default value is Message_Info

    type gravity

    Message_Gravity

    rtype

    None

SendWarning()
  • Sends a warning to be attached to the shape. Calls SendMsg with gravity set to Message_Warning.
    param shape

    type shape

    TopoDS_Shape

    param message

    type message

    Message_Msg

    rtype

    None* Calls previous method for myShape.

    param message

    type message

    Message_Msg

    rtype

    None

Set()
  • Copy all fields from another Root object
    param Root

    type Root

    ShapeFix_Root

    rtype

    void

SetContext()
  • Sets context
    param context

    type context

    ShapeBuild_ReShape

    rtype

    void

SetMaxTolerance()
  • Sets maximal allowed tolerance
    param maxtol

    type maxtol

    float

    rtype

    void

SetMinTolerance()
  • Sets minimal allowed tolerance
    param mintol

    type mintol

    float

    rtype

    void

SetMsgRegistrator()
  • Sets message registrator
    param msgreg

    type msgreg

    ShapeExtend_BasicMsgRegistrator

    rtype

    void

SetPrecision()
  • Sets basic precision value
    param preci

    type preci

    float

    rtype

    void

property thisown

The membership flag

class ShapeFix_SequenceOfWireSegment(*args)

Bases: object

Append()
Assign()
ChangeFirst()
ChangeLast()
ChangeValue()
Clear()
Exchange()
First()
InsertAfter()
InsertBefore()
IsEmpty()
Last()
Length()
Lower()
Prepend()
Remove()
Reverse()
Set()
SetValue()
Size()
Split()
Upper()
Value()
begin()
cbegin()
cend()
static delNode()
end()
property thisown

The membership flag

class ShapeFix_Shape(*args)

Bases: OCC.Core.ShapeFix.ShapeFix_Root

  • Empty Constructor
    rtype

    None* Initislises by shape.

    param shape

    type shape

    TopoDS_Shape

    rtype

    None

static DownCast(t)
FixEdgeTool()
  • Returns tool for fixing edges.
    rtype

    opencascade::handle<ShapeFix_Edge>

FixFaceTool()
  • Returns tool for fixing faces.
    rtype

    opencascade::handle<ShapeFix_Face>

FixShellTool()
  • Returns tool for fixing shells.
    rtype

    opencascade::handle<ShapeFix_Shell>

FixSolidTool()
  • Returns tool for fixing solids.
    rtype

    opencascade::handle<ShapeFix_Solid>

FixWireTool()
  • Returns tool for fixing wires.
    rtype

    opencascade::handle<ShapeFix_Wire>

GetFixFreeFaceMode(ShapeFix_Shape self) → Standard_Integer
GetFixFreeShellMode(ShapeFix_Shape self) → Standard_Integer
GetFixFreeWireMode(ShapeFix_Shape self) → Standard_Integer
GetFixSameParameterMode(ShapeFix_Shape self) → Standard_Integer
GetFixSolidMode(ShapeFix_Shape self) → Standard_Integer
GetFixVertexPositionMode(ShapeFix_Shape self) → Standard_Integer
GetFixVertexTolMode(ShapeFix_Shape self) → Standard_Integer
Init()
  • Initislises by shape.
    param shape

    type shape

    TopoDS_Shape

    rtype

    None

Perform()
  • Iterates on sub- shape and performs fixes
    param theProgress

    default value is 0

    type theProgress

    Message_ProgressIndicator

    rtype

    bool

SetFixFreeFaceMode(ShapeFix_Shape self, Standard_Integer value)
SetFixFreeShellMode(ShapeFix_Shape self, Standard_Integer value)
SetFixFreeWireMode(ShapeFix_Shape self, Standard_Integer value)
SetFixSameParameterMode(ShapeFix_Shape self, Standard_Integer value)
SetFixSolidMode(ShapeFix_Shape self, Standard_Integer value)
SetFixVertexPositionMode(ShapeFix_Shape self, Standard_Integer value)
SetFixVertexTolMode(ShapeFix_Shape self, Standard_Integer value)
Shape()
  • Returns resulting shape
    rtype

    TopoDS_Shape

Status()
  • Returns the status of the last Fix. This can be a combination of the following flags: ShapeExtend_DONE1: some free edges were fixed ShapeExtend_DONE2: some free wires were fixed ShapeExtend_DONE3: some free faces were fixed ShapeExtend_DONE4: some free shells were fixed ShapeExtend_DONE5: some free solids were fixed ShapeExtend_DONE6: shapes in compound(s) were fixed
    param status

    type status

    ShapeExtend_Status

    rtype

    bool

property thisown

The membership flag

class ShapeFix_ShapeTolerance(*args)

Bases: object

Return type

None

LimitTolerance()
  • Limits tolerances in a shape as followstmin = tmax -> as SetTolerance (forces) tmin = 0 -> maximum tolerance will be <tmax> tmax = 0 or not given (more generally, tmax < tmin) -> <tmax> ignored, minimum will be <tmin> else, maximum will be <max> and minimum will be <min> styp = VERTEXonly vertices are set styp = EDGEonly edges are set styp = FACEonly faces are set styp = WIREto have edges and their vertices set styp = other valueall (vertices,edges,faces) are set Returns True if at least one tolerance of the sub-shape has been modified
    param shape

    type shape

    TopoDS_Shape

    param tmin

    type tmin

    float

    param tmax

    default value is 0.0

    type tmax

    float

    param styp

    default value is TopAbs_SHAPE

    type styp

    TopAbs_ShapeEnum

    rtype

    bool

SetTolerance()
  • Sets (enforces) tolerances in a shape to the given value styp = VERTEXonly vertices are set styp = EDGEonly edges are set styp = FACEonly faces are set styp = WIREto have edges and their vertices set styp = other valueall (vertices,edges,faces) are set
    param shape

    type shape

    TopoDS_Shape

    param preci

    type preci

    float

    param styp

    default value is TopAbs_SHAPE

    type styp

    TopAbs_ShapeEnum

    rtype

    None

property thisown

The membership flag

class ShapeFix_Shell(*args)

Bases: OCC.Core.ShapeFix.ShapeFix_Root

  • Empty constructor
    rtype

    None* Initializes by shell.

    param shape

    type shape

    TopoDS_Shell

    rtype

    None

static DownCast(t)
ErrorFaces()
  • Returns not oriented subset of faces.
    rtype

    TopoDS_Compound

FixFaceOrientation()
  • Fixes orientation of faces in shell. Changes orientation of face in the shell, if it is oriented opposite to neigbouring faces. If it is not possible to orient all faces in the shell (like in case of mebious band), this method orients only subset of faces. Other faces are stored in Error compound. ModesisAccountMultiConex - mode for account cases of multiconnexity. If this mode is equal to Standard_True, separate shells will be created in the cases of multiconnexity. If this mode is equal to Standard_False, one shell will be created without account of multiconnexity.By defautt - Standard_True; NonManifold - mode for creation of non-manifold shells. If this mode is equal to Standard_True one non-manifold will be created from shell contains multishared edges. Else if this mode is equal to Standard_False only manifold shells will be created. By default - Standard_False.
    param shell

    type shell

    TopoDS_Shell

    param isAccountMultiConex

    default value is Standard_True

    type isAccountMultiConex

    bool

    param NonManifold

    default value is Standard_False

    type NonManifold

    bool

    rtype

    bool

FixFaceTool()
  • Returns tool for fixing faces.
    rtype

    opencascade::handle<ShapeFix_Face>

GetFixFaceMode(ShapeFix_Shell self) → Standard_Integer
GetFixOrientationMode(ShapeFix_Shell self) → Standard_Integer
Init()
  • Initializes by shell.
    param shell

    type shell

    TopoDS_Shell

    rtype

    None

NbShells()
  • Returns Number of obtainrd shells;
    rtype

    int

Perform()
  • Iterates on subshapes and performs fixes (for each face calls ShapeFix_Face::Perform and then calls FixFaceOrientation). The passed progress indicator allows user to consult the current progress stage and abort algorithm if needed.
    param theProgress

    default value is 0

    type theProgress

    Message_ProgressIndicator

    rtype

    bool

SetFixFaceMode(ShapeFix_Shell self, Standard_Integer value)
SetFixOrientationMode(ShapeFix_Shell self, Standard_Integer value)
SetNonManifoldFlag()
  • Sets NonManifold flag
    param isNonManifold

    type isNonManifold

    bool

    rtype

    void

Shape()
  • In case of multiconnexity returns compound of fixed shells else returns one shell..
    rtype

    TopoDS_Shape

Shell()
  • Returns fixed shell (or subset of oriented faces).
    rtype

    TopoDS_Shell

Status()
  • Returns the status of the last Fix.
    param status

    type status

    ShapeExtend_Status

    rtype

    bool

property thisown

The membership flag

class ShapeFix_Solid(*args)

Bases: OCC.Core.ShapeFix.ShapeFix_Root

  • Empty constructor;
    rtype

    None* Initializes by solid.

    param solid

    type solid

    TopoDS_Solid

    rtype

    None

static DownCast(t)
FixShellTool()
  • Returns tool for fixing shells.
    rtype

    opencascade::handle<ShapeFix_Shell>

GetCreateOpenSolidMode(ShapeFix_Solid self) → Standard_Boolean
GetFixShellMode(ShapeFix_Solid self) → Standard_Integer
GetFixShellOrientationMode(ShapeFix_Solid self) → Standard_Integer
Init()
  • Initializes by solid .
    param solid

    type solid

    TopoDS_Solid

    rtype

    void

Perform()
  • Iterates on shells and performs fixes (calls ShapeFix_Shell for each subshell). The passed progress indicator allows user to consult the current progress stage and abort algorithm if needed.
    param theProgress

    default value is 0

    type theProgress

    Message_ProgressIndicator

    rtype

    bool

SetCreateOpenSolidMode(ShapeFix_Solid self, Standard_Boolean value)
SetFixShellMode(ShapeFix_Solid self, Standard_Integer value)
SetFixShellOrientationMode(ShapeFix_Solid self, Standard_Integer value)
Shape()
  • In case of multiconnexity returns compound of fixed solids else returns one solid.
    rtype

    TopoDS_Shape

Solid()
  • Returns resulting solid.
    rtype

    TopoDS_Shape

SolidFromShell()
  • Calls MakeSolid and orients the solid to be ‘not infinite’
    param shell

    type shell

    TopoDS_Shell

    rtype

    TopoDS_Solid

Status()
  • Returns the status of the last Fix.
    param status

    type status

    ShapeExtend_Status

    rtype

    bool

property thisown

The membership flag

class ShapeFix_SplitCommonVertex(*args)

Bases: OCC.Core.ShapeFix.ShapeFix_Root

Return type

None

static DownCast(t)
Init()
Parameters

S

type S

TopoDS_Shape

rtype

None

Perform()
Return type

None

Shape()
Return type

TopoDS_Shape

property thisown

The membership flag

class ShapeFix_SplitTool(*args)

Bases: object

  • Empty constructor
    rtype

    None

CutEdge()
  • Cut edge by parameters pend and cut
    param edge

    type edge

    TopoDS_Edge

    param pend

    type pend

    float

    param cut

    type cut

    float

    param face

    type face

    TopoDS_Face

    param iscutline

    type iscutline

    bool

    rtype

    bool

SplitEdge()
  • Split edge on two new edges using new vertex ‘vert’ and ‘param’ - parameter for splitting The ‘face’ is necessary for pcurves and using TransferParameterProj
    param edge

    type edge

    TopoDS_Edge

    param param

    type param

    float

    param vert

    type vert

    TopoDS_Vertex

    param face

    type face

    TopoDS_Face

    param newE1

    type newE1

    TopoDS_Edge

    param newE2

    type newE2

    TopoDS_Edge

    param tol3d

    type tol3d

    float

    param tol2d

    type tol2d

    float

    rtype

    bool* Split edge on two new edges using new vertex ‘vert’ and ‘param1’ and ‘param2’ - parameter for splitting and cutting The ‘face’ is necessary for pcurves and using TransferParameterProj

    param edge

    type edge

    TopoDS_Edge

    param param1

    type param1

    float

    param param2

    type param2

    float

    param vert

    type vert

    TopoDS_Vertex

    param face

    type face

    TopoDS_Face

    param newE1

    type newE1

    TopoDS_Edge

    param newE2

    type newE2

    TopoDS_Edge

    param tol3d

    type tol3d

    float

    param tol2d

    type tol2d

    float

    rtype

    bool* Split edge on two new edges using two new vertex V1 and V2 and two parameters for splitting - fp and lp correspondingly The ‘face’ is necessary for pcurves and using TransferParameterProj aNum - number of edge in SeqE which corresponding to [fp,lp]

    param edge

    type edge

    TopoDS_Edge

    param fp

    type fp

    float

    param V1

    type V1

    TopoDS_Vertex

    param lp

    type lp

    float

    param V2

    type V2

    TopoDS_Vertex

    param face

    type face

    TopoDS_Face

    param SeqE

    type SeqE

    TopTools_SequenceOfShape

    param aNum

    type aNum

    int

    param context

    type context

    ShapeBuild_ReShape

    param tol3d

    type tol3d

    float

    param tol2d

    type tol2d

    float

    rtype

    bool

property thisown

The membership flag

class ShapeFix_Wire(*args)

Bases: OCC.Core.ShapeFix.ShapeFix_Root

  • Empty Constructor, creates clear object with default flags
    rtype

    None* Create new object with default flags and prepare it for use (Loads analyzer with all the data for the wire and face)

    param wire

    type wire

    TopoDS_Wire

    param face

    type face

    TopoDS_Face

    param prec

    type prec

    float

    rtype

    None

Analyzer()
  • returns field Analyzer (working tool)
    rtype

    opencascade::handle<ShapeAnalysis_Wire>

ClearModes()
  • Sets all modes to default
    rtype

    None

ClearStatuses()
  • Clears all statuses
    rtype

    None

static DownCast(t)
Face()
  • returns working face (Analyzer.Face())
    rtype

    TopoDS_Face

FixClosed()
  • Fixes a wire to be well closed It performs FixConnected, FixDegenerated and FixLacking between last and first edges (independingly on flag ClosedMode and modes for these fixings) If <prec> is -1 then MaxTolerance() is taken.
    param prec

    default value is -1.0

    type prec

    float

    rtype

    bool

FixConnected()
  • Applies FixConnected(num) to all edges in the wire Connection between first and last edges is treated only if flag ClosedMode is True If <prec> is -1 then MaxTolerance() is taken.
    param prec

    default value is -1.0

    type prec

    float

    rtype

    bool* Fixes connected edges (preceeding and current) Forces Vertices (end of preceeding-begin of current) to be the same one Tests with starting preci or, if given greater, <prec> If <prec> is -1 then MaxTolerance() is taken.

    param num

    type num

    int

    param prec

    type prec

    float

    rtype

    bool

FixDegenerated()
  • Applies FixDegenerated(num) to all edges in the wire Connection between first and last edges is treated only if flag ClosedMode is True
    rtype

    bool* Fixes Degenerated Edge Checks an <num-th> edge or a point between <num>th-1 and <num>th edges for a singularity on a supporting surface. If singularity is detected, either adds new degenerated edge (before <num>th), or makes <num>th edge to be degenerated.

    param num

    type num

    int

    rtype

    bool

FixEdgeCurves()
  • Groups the fixes dealing with 3d and pcurves of the edges. The order of the fixes and the default behaviour are: ShapeFix_Edge::FixReversed2d ShapeFix_Edge::FixRemovePCurve (only if forced) ShapeFix_Edge::FixAddPCurve ShapeFix_Edge::FixRemoveCurve3d (only if forced) ShapeFix_Edge::FixAddCurve3d FixSeam, FixShifted, ShapeFix_Edge::FixSameParameter
    rtype

    bool

FixEdgeTool()
  • Returns tool for fixing wires.
    rtype

    opencascade::handle<ShapeFix_Edge>

FixGap2d()
  • Fixes gap between ends of pcurves on num-1 and num-th edges. myPrecision is used to detect the gap. If convert is True, converts pcurves to bsplines to bend.
    param num

    type num

    int

    param convert

    default value is Standard_False

    type convert

    bool

    rtype

    bool

FixGap3d()
  • Fixes gap between ends of 3d curves on num-1 and num-th edges. myPrecision is used to detect the gap. If convert is True, converts curves to bsplines to bend.
    param num

    type num

    int

    param convert

    default value is Standard_False

    type convert

    bool

    rtype

    bool

FixGaps2d()
  • Fixes gaps between ends of pcurves on adjacent edges myPrecision is used to detect the gaps.
    rtype

    bool

FixGaps3d()
  • Fixes gaps between ends of 3d curves on adjacent edges myPrecision is used to detect the gaps.
    rtype

    bool

FixLacking()
  • Applies FixLacking(num) to all edges in the wire Connection between first and last edges is treated only if flag ClosedMode is True If <force> is False (default), test for connectness is done with precision of vertex between edges, else it is done with minimal value of vertex tolerance and Analyzer.Precision(). Hence, <force> will lead to inserting lacking edges in replacement of vertices which have big tolerances.
    param force

    default value is Standard_False

    type force

    bool

    rtype

    bool* Fixes Lacking Edge Test if two adjucent edges are disconnected in 2d (while connected in 3d), and in that case either increase tolerance of the vertex or add a new edge (straight in 2d space), in order to close wire in 2d. Returns True if edge was added or tolerance was increased.

    param num

    type num

    int

    param force

    default value is Standard_False

    type force

    bool

    rtype

    bool

FixNotchedEdges()
Return type

bool

FixReorder()
  • Performs an analysis and reorders edges in the wire using class WireOrder
    rtype

    bool* Reorder edges in the wire as determined by WireOrder that should be filled and computed before

    param wi

    type wi

    ShapeAnalysis_WireOrder

    rtype

    bool

FixSeam()
  • Fixes a seam edge A Seam edge has two pcurves, one for forward. one for reversed The forward pcurve must be set as first //! NOTE that correct order of pcurves in the seam edge depends on its orientation (i.e., on orientation of the wire, method of exploration of edges etc.). Since wire represented by the ShapeExtend_WireData is always forward (orientation is accounted by edges), it will work correct if: 1. Wire created from ShapeExtend_WireData with methods ShapeExtend_WireData::Wire..() is added into the FORWARD face (orientation can be applied later) 2. Wire is extracted from the face with orientation not composed with orientation of the face
    param num

    type num

    int

    rtype

    bool

FixSelfIntersection()
  • Applies FixSelfIntersectingEdge(num) and FixIntersectingEdges(num) to all edges in the wire and FixIntersectingEdges(num1, num2) for all pairs num1 and num2 such that num2 >= num1 + 2 and removes wrong edges if any
    rtype

    bool

FixShifted()
  • Fixes edges which have pcurves shifted by whole parameter range on the closed surface (the case may occur if pcurve of edge was computed by projecting 3d curve, which goes along the seam). It compares each two consequent edges and tries to connect them if distance between ends is near to range of the surface. It also can detect and fix the case if all pcurves are connected, but lie out of parametric bounds of the surface. In addition to FixShifted from ShapeFix_Wire, more sophisticated check of degenerate points is performed, and special cases like sphere given by two meridians are treated.
    rtype

    bool

FixSmall()
  • Applies FixSmall(num) to all edges in the wire
    param lockvtx

    type lockvtx

    bool

    param precsmall

    default value is 0.0

    type precsmall

    float

    rtype

    int* Fixes Null Length Edge to be removed If an Edge has Null Length (regarding preci, or <precsmall> - what is smaller), it should be removed It can be with no problem if its two vertices are the same Else, if lockvtx is False, it is removed and its end vertex is put on the preceeding edge But if lockvtx is True, this edge must be kept …

    param num

    type num

    int

    param lockvtx

    type lockvtx

    bool

    param precsmall

    type precsmall

    float

    rtype

    bool

FixTails()
Return type

bool

GetClosedWireMode(ShapeFix_Wire self) → Standard_Boolean
GetFixAddCurve3dMode(ShapeFix_Wire self) → Standard_Integer
GetFixAddPCurveMode(ShapeFix_Wire self) → Standard_Integer
GetFixConnectedMode(ShapeFix_Wire self) → Standard_Integer
GetFixDegeneratedMode(ShapeFix_Wire self) → Standard_Integer
GetFixEdgeCurvesMode(ShapeFix_Wire self) → Standard_Integer
GetFixGaps2dMode(ShapeFix_Wire self) → Standard_Integer
GetFixGaps3dMode(ShapeFix_Wire self) → Standard_Integer
GetFixGapsByRangesMode(ShapeFix_Wire self) → Standard_Boolean
GetFixIntersectingEdgesMode(ShapeFix_Wire self) → Standard_Integer
GetFixLackingMode(ShapeFix_Wire self) → Standard_Integer
GetFixNonAdjacentIntersectingEdgesMode(ShapeFix_Wire self) → Standard_Integer
GetFixNotchedEdgesMode(ShapeFix_Wire self) → Standard_Integer
GetFixRemoveCurve3dMode(ShapeFix_Wire self) → Standard_Integer
GetFixRemovePCurveMode(ShapeFix_Wire self) → Standard_Integer
GetFixReorderMode(ShapeFix_Wire self) → Standard_Integer
GetFixReversed2dMode(ShapeFix_Wire self) → Standard_Integer
GetFixSameParameterMode(ShapeFix_Wire self) → Standard_Integer
GetFixSeamMode(ShapeFix_Wire self) → Standard_Integer
GetFixSelfIntersectingEdgeMode(ShapeFix_Wire self) → Standard_Integer
GetFixSelfIntersectionMode(ShapeFix_Wire self) → Standard_Integer
GetFixShiftedMode(ShapeFix_Wire self) → Standard_Integer
GetFixSmallMode(ShapeFix_Wire self) → Standard_Integer
GetFixTailMode(ShapeFix_Wire self) → Standard_Integer
GetFixVertexToleranceMode(ShapeFix_Wire self) → Standard_Integer
GetModifyGeometryMode(ShapeFix_Wire self) → Standard_Boolean
GetModifyRemoveLoopMode(ShapeFix_Wire self) → Standard_Integer
GetModifyTopologyMode(ShapeFix_Wire self) → Standard_Boolean
GetPreferencePCurveMode(ShapeFix_Wire self) → Standard_Boolean
Init()
  • Load analyzer with all the data for the wire and face and drops all fixing statuses
    param wire

    type wire

    TopoDS_Wire

    param face

    type face

    TopoDS_Face

    param prec

    type prec

    float

    rtype

    None* Load analyzer with all the data already prepared and drops all fixing statuses If analyzer contains face, there is no need to set it by SetFace or SetSurface

    param saw

    type saw

    ShapeAnalysis_Wire

    rtype

    None

IsLoaded()
  • Tells if the wire is loaded
    rtype

    bool

IsReady()
  • Tells if the wire and face are loaded
    rtype

    bool

LastFixStatus()
  • Queries the status of last call to methods Fix… of advanced level For details see corresponding methods; universal statuses are: OKproblem not detected; nothing done DONE: problem was detected and successfully fixed FAIL: problem cannot be fixed
    param status

    type status

    ShapeExtend_Status

    rtype

    bool

Load()
  • Load data for the wire, and drops all fixing statuses
    param wire

    type wire

    TopoDS_Wire

    rtype

    None* Load data for the wire, and drops all fixing statuses

    param sbwd

    type sbwd

    ShapeExtend_WireData

    rtype

    None

NbEdges()
  • returns number of edges in the working wire
    rtype

    int

Perform()
  • This method performs all the available fixes. If some fix is turned on or off explicitly by the Fix..Mode() flag, this fix is either called or not depending on that flag. Else (i.e. if flag is default) fix is called depending on the situation: some fixes are not called or are limited if order of edges in the wire is not OK, or depending on modes //! The order of the fixes and default behaviour of Perform() are: FixReorder FixSmall (with lockvtx true if ! TopoMode or if wire is not ordered) FixConnected (if wire is ordered) FixEdgeCurves (without FixShifted if wire is not ordered) FixDegenerated (if wire is ordered) FixSelfIntersection (if wire is ordered and ClosedMode is True) FixLacking (if wire is ordered)
    rtype

    bool

SetClosedWireMode(ShapeFix_Wire self, Standard_Boolean value)
SetFace()
  • Set working face for the wire
    param face

    type face

    TopoDS_Face

    rtype

    None

SetFixAddCurve3dMode(ShapeFix_Wire self, Standard_Integer value)
SetFixAddPCurveMode(ShapeFix_Wire self, Standard_Integer value)
SetFixConnectedMode(ShapeFix_Wire self, Standard_Integer value)
SetFixDegeneratedMode(ShapeFix_Wire self, Standard_Integer value)
SetFixEdgeCurvesMode(ShapeFix_Wire self, Standard_Integer value)
SetFixGaps2dMode(ShapeFix_Wire self, Standard_Integer value)
SetFixGaps3dMode(ShapeFix_Wire self, Standard_Integer value)
SetFixGapsByRangesMode(ShapeFix_Wire self, Standard_Boolean value)
SetFixIntersectingEdgesMode(ShapeFix_Wire self, Standard_Integer value)
SetFixLackingMode(ShapeFix_Wire self, Standard_Integer value)
SetFixNonAdjacentIntersectingEdgesMode(ShapeFix_Wire self, Standard_Integer value)
SetFixNotchedEdgesMode(ShapeFix_Wire self, Standard_Integer value)
SetFixRemoveCurve3dMode(ShapeFix_Wire self, Standard_Integer value)
SetFixRemovePCurveMode(ShapeFix_Wire self, Standard_Integer value)
SetFixReorderMode(ShapeFix_Wire self, Standard_Integer value)
SetFixReversed2dMode(ShapeFix_Wire self, Standard_Integer value)
SetFixSameParameterMode(ShapeFix_Wire self, Standard_Integer value)
SetFixSeamMode(ShapeFix_Wire self, Standard_Integer value)
SetFixSelfIntersectingEdgeMode(ShapeFix_Wire self, Standard_Integer value)
SetFixSelfIntersectionMode(ShapeFix_Wire self, Standard_Integer value)
SetFixShiftedMode(ShapeFix_Wire self, Standard_Integer value)
SetFixSmallMode(ShapeFix_Wire self, Standard_Integer value)
SetFixTailMode(ShapeFix_Wire self, Standard_Integer value)
SetFixVertexToleranceMode(ShapeFix_Wire self, Standard_Integer value)
SetMaxTailAngle()
  • Sets the maximal allowed angle of the tails in radians.
    param theMaxTailAngle

    type theMaxTailAngle

    float

    rtype

    None

SetMaxTailWidth()
  • Sets the maximal allowed width of the tails.
    param theMaxTailWidth

    type theMaxTailWidth

    float

    rtype

    None

SetModifyGeometryMode(ShapeFix_Wire self, Standard_Boolean value)
SetModifyRemoveLoopMode(ShapeFix_Wire self, Standard_Integer value)
SetModifyTopologyMode(ShapeFix_Wire self, Standard_Boolean value)
SetPreferencePCurveMode(ShapeFix_Wire self, Standard_Boolean value)
SetSurface()
  • Set surface for the wire
    param surf

    type surf

    Geom_Surface

    rtype

    None* Set surface for the wire

    param surf

    type surf

    Geom_Surface

    param loc

    type loc

    TopLoc_Location

    rtype

    None

StatusClosed()
Parameters

status

type status

ShapeExtend_Status

rtype

bool

StatusConnected()
Parameters

status

type status

ShapeExtend_Status

rtype

bool

StatusDegenerated()
Parameters

status

type status

ShapeExtend_Status

rtype

bool

StatusEdgeCurves()
Parameters

status

type status

ShapeExtend_Status

rtype

bool

StatusFixTails()
Parameters

status

type status

ShapeExtend_Status

rtype

bool

StatusGaps2d()
Parameters

status

type status

ShapeExtend_Status

rtype

bool

StatusGaps3d()
Parameters

status

type status

ShapeExtend_Status

rtype

bool

StatusLacking()
Parameters

status

type status

ShapeExtend_Status

rtype

bool

StatusNotches()
Parameters

status

type status

ShapeExtend_Status

rtype

bool

StatusRemovedSegment()
  • Querying the status of perfomed API fixing procedures Each Status..() methods gives information about the last call to the corresponding Fix..() method of API level: OKno problems detected; nothing done DONE: some problem(s) was(were) detected and successfully fixed FAIL: some problem(s) cannot be fixed
    rtype

    bool

StatusReorder()
Parameters

status

type status

ShapeExtend_Status

rtype

bool

StatusSelfIntersection()
Parameters

status

type status

ShapeExtend_Status

rtype

bool

StatusSmall()
Parameters

status

type status

ShapeExtend_Status

rtype

bool

Wire()
  • Makes the resulting Wire (by basic Brep_Builder)
    rtype

    TopoDS_Wire

WireAPIMake()
  • Makes the resulting Wire (by BRepAPI_MakeWire)
    rtype

    TopoDS_Wire

WireData()
  • returns working wire
    rtype

    opencascade::handle<ShapeExtend_WireData>

property thisown

The membership flag

class ShapeFix_WireVertex(*args)

Bases: object

Return type

None

Analyzer()
  • returns internal analyzer
    rtype

    ShapeAnalysis_WireVertex

Fix()
  • Fixes all statuses except ‘Disjoined’, i.e. the cases in which a common value has been set, with or without changing parameters Returns the count of fixed vertices, 0 if none
    rtype

    int

FixSame()
  • Fixes ‘Same’ or ‘Close’ status (same vertex may be set, without changing parameters) Returns the count of fixed vertices, 0 if none
    rtype

    int

Init()
  • Loads the wire, ininializes internal analyzer (ShapeAnalysis_WireVertex) with the given precision, and performs analysis
    param wire

    type wire

    TopoDS_Wire

    param preci

    type preci

    float

    rtype

    None* Loads the wire, ininializes internal analyzer (ShapeAnalysis_WireVertex) with the given precision, and performs analysis

    param sbwd

    type sbwd

    ShapeExtend_WireData

    param preci

    type preci

    float

    rtype

    None* Loads all the data on wire, already analysed by ShapeAnalysis_WireVertex

    param sawv

    type sawv

    ShapeAnalysis_WireVertex

    rtype

    None

Wire()
  • returns resulting wire (fixed)
    rtype

    TopoDS_Wire

WireData()
  • returns data on wire (fixed)
    rtype

    opencascade::handle<ShapeExtend_WireData>

property thisown

The membership flag

class ShapeFix_Wireframe(*args)

Bases: OCC.Core.ShapeFix.ShapeFix_Root

Return type

None:param shape: :type shape: TopoDS_Shape :rtype: None

CheckSmallEdges()
  • Auxiliary tool for FixSmallEdges which checks for small edges and fills the maps. Returns True if at least one small edge has been found.
    param theSmallEdges

    type theSmallEdges

    TopTools_MapOfShape

    param theEdgeToFaces

    type theEdgeToFaces

    TopTools_DataMapOfShapeListOfShape

    param theFaceWithSmall

    type theFaceWithSmall

    TopTools_DataMapOfShapeListOfShape

    param theMultyEdges

    type theMultyEdges

    TopTools_MapOfShape

    rtype

    bool

ClearStatuses()
  • Clears all statuses
    rtype

    void

static DownCast(t)
FixSmallEdges()
  • Fixes small edges in shape by merging adjacent edges If precision is 0.0, uses Precision::Confusion().
    rtype

    bool

FixWireGaps()
  • Fixes gaps between ends of curves of adjacent edges (both 3d and pcurves) in wires If precision is 0.0, uses Precision::Confusion().
    rtype

    bool

GetModeDropSmallEdges(ShapeFix_Wireframe self) → Standard_Boolean
LimitAngle()
  • Get limit angle for merging edges.
    rtype

    float

Load()
  • Loads a shape, resets statuses
    param shape

    type shape

    TopoDS_Shape

    rtype

    None

MergeSmallEdges()
  • Auxiliary tool for FixSmallEdges which merges small edges. If theModeDrop is equal to Standard_True then small edges, which cannot be connected with adjacent edges are dropped. Otherwise they are kept. theLimitAngle specifies maximum allowed tangency discontinuity between adjacent edges. If theLimitAngle is equal to -1, this angle is not taken into account.
    param theSmallEdges

    type theSmallEdges

    TopTools_MapOfShape

    param theEdgeToFaces

    type theEdgeToFaces

    TopTools_DataMapOfShapeListOfShape

    param theFaceWithSmall

    type theFaceWithSmall

    TopTools_DataMapOfShapeListOfShape

    param theMultyEdges

    type theMultyEdges

    TopTools_MapOfShape

    param theModeDrop

    default value is Standard_False

    type theModeDrop

    bool

    param theLimitAngle

    default value is -1

    type theLimitAngle

    float

    rtype

    bool

SetLimitAngle()
  • Set limit angle for merging edges.
    param theLimitAngle

    type theLimitAngle

    float

    rtype

    None

SetModeDropSmallEdges(ShapeFix_Wireframe self, Standard_Boolean value)
Shape()
Return type

TopoDS_Shape

StatusSmallEdges()
  • Decodes the status of the last FixSmallEdges. OK - No small edges were found DONE1 - Some small edges were fixed FAIL1 - Failed to fix some small edges
    param status

    type status

    ShapeExtend_Status

    rtype

    bool

StatusWireGaps()
  • Decodes the status of the last FixWireGaps. OK - No gaps were found DONE1 - Some gaps in 3D were fixed DONE2 - Some gaps in 2D were fixed FAIL1 - Failed to fix some gaps in 3D FAIL2 - Failed to fix some gaps in 2D
    param status

    type status

    ShapeExtend_Status

    rtype

    bool

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 shapefix

Bases: object

static EncodeRegularity()
  • Runs EncodeRegularity from BRepLib taking into account shared components of assemblies, so that each component is processed only once
    param shape

    type shape

    TopoDS_Shape

    param tolang

    default value is 1.0e-10

    type tolang

    float

    rtype

    void

static FixVertexPosition()
  • Fix position of the vertices having tolerance more tnan specified one.;
    param theshape

    type theshape

    TopoDS_Shape

    param theTolerance

    type theTolerance

    float

    param thecontext

    type thecontext

    ShapeBuild_ReShape

    rtype

    bool

static LeastEdgeSize()
  • Calculate size of least edge;
    param theshape

    type theshape

    TopoDS_Shape

    rtype

    float

static RemoveSmallEdges()
  • Removes edges which are less than given tolerance from shape with help of ShapeFix_Wire::FixSmall()
    param shape

    type shape

    TopoDS_Shape

    param Tolerance

    type Tolerance

    float

    param context

    type context

    ShapeBuild_ReShape

    rtype

    TopoDS_Shape

static SameParameter()
  • Runs SameParameter from BRepLib with these adaptations<enforce> forces computations, else they are made only on Edges with flag SameParameter false <preci>, if not precised, is taken for each EDge as its own Tolerance Returns True when done, False if an exception has been raised In case of exception anyway, as many edges as possible have been processed. The passed progress indicator allows user to consult the current progress stage and abort algorithm if needed.
    param shape

    type shape

    TopoDS_Shape

    param enforce

    type enforce

    bool

    param preci

    default value is 0.0

    type preci

    float

    param theProgress

    default value is 0

    type theProgress

    Message_ProgressIndicator

    param theMsgReg

    default value is 0

    type theMsgReg

    ShapeExtend_BasicMsgRegistrator

    rtype

    bool

property thisown

The membership flag