ShapeFix
OCCT package ShapeFix: ShapeFix, ShapeFix_ComposeShell, ShapeFix_Edge, ShapeFix_EdgeConnect, and 17 more bound classes.
ShapeFix
This package provides algorithms for fixing problematic (violating Open CASCADE requirements) shapes. Tools from package ShapeAnalysis are used for detecting the problems. The detecting and fixing is done taking in account various criteria implemented in BRepCheck package. Each class of package ShapeFix deals with one certain type of shapes or with some family of problems.
Constructors(1)
Static methods(5)
- SameParameter(shape: TopoDS_Shape, enforce: boolean, preci?: number, theProgress?: Message_ProgressRange, theMsgReg?: ShapeExtend_BasicMsgRegistrator): boolean
Runs SameParameter from
BRepLibwith 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.Parameters (5)shapeenforceprecitheProgresstheMsgReg
- EncodeRegularity(shape: TopoDS_Shape, tolang?: number): void
Runs EncodeRegularity from
BRepLibtaking into account shared components of assemblies, so that each component is processed only once.Parameters (2)shapetolang
- RemoveSmallEdges(shape: TopoDS_Shape, Tolerance: number): { returnValue: TopoDS_Shape; context: ShapeBuild_ReShape; [Symbol.dispose](): void }
Removes edges which are less than given tolerance from shape with help of
ShapeFix_Wire::FixSmall().Parameters (2)shape—Mutated in place; read the updated value from this argument after the call.Tolerance
ReturnsA result object with fields:
returnValue: the C++ return valuecontext: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- FixVertexPosition(theshape: TopoDS_Shape, theTolerance: number, thecontext: ShapeBuild_ReShape): boolean
Fix position of the vertices having tolerance more tnan specified one.;.
Parameters (3)theshape—Mutated in place; read the updated value from this argument after the call.theTolerancethecontext
- LeastEdgeSize(theshape: TopoDS_Shape): number
Calculate size of least edge;.
Parameters (1)theshape—Mutated in place; read the updated value from this argument after the call.
ShapeFix_ComposeShell
This class is intended to create a shell from the composite surface (grid of surfaces) and set of wires. It may be either division of the supporting surface of the face, or creating a shape corresponding to face on composite surface which is missing in CAS.CADE but exists in some other systems.
It splits (if necessary) original face to several ones by splitting lines which are joint lines on a supplied grid of surfaces (U- and V- isolines of the composite surface). There are two modes of work, which differ in the way of handling faces on periodic surfaces:
- if ClosedMode is False (default), when splitting itself is done as if surface were not periodic. The periodicity of the underlying surface is taken into account by duplicating splitting lines in the periodic direction, as necessary to split all the wires (whole parametrical range of a face) In this mode, some regularization procedures are performed (indexation of split segments by patch numbers), and it is expected to be more reliable and robust in case of bad shapes
- if ClosedMode is True, when everything on a periodic surfaces is considered as modulo period. This allows to deal with wires which are closed in 3d but not in 2d, with wires which may be shifted on several periods in 2d etc. However, this mode is less reliable since some regularizations do not work for it.
The work is made basing on pcurves of the edges. These pcurves should already exist (for example, in the case of division of existing face), then they are taken as is. The existing pcurves should be assigned to one surface (face) for all edges, this surface (face) will be used only for accessing pcurves, and it may have any geometry.
All the modifications are recorded in the context tool (ShapeBuild_ReShape).
Constructors(1)
Creates empty tool.
Static methods(2)
- get_type_name(): string
Instance methods(8)
- ClosedMode(): boolean
Returns (modifiable) flag for special 'closed' mode which forces ComposeShell to consider all pcurves on closed surface as modulo period. This can reduce reliability, but allows to deal with wires closed in 3d but open in 2d (missing seam) Default is False.
- Perform(): boolean
Performs the work on already loaded data.
- SplitEdges(): void
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 split, it is replaced by wire, and order of edges in the wire corresponds to FORWARD orientation of the edge. Returns resulting shell or face (or Null shape if not done).
- Status(status: ShapeExtend_Status): boolean
Queries status of last call to
Perform()OK : nothing 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).Parameters (1)status
- SetTransferParamTool(TransferParam: ShapeAnalysis_TransferParameters): void
Sets tool for transfer parameters from 3d to 2d and vice versa.
Parameters (1)TransferParam
Gets tool for transfer parameters from 3d to 2d and vice versa.
ShapeFix_Edge
Fixing invalid edge. Geometrical and/or topological inconsistency:
- no 3d curve or pcurve,
- mismatching orientation of 3d curve and pcurve,
- incorrect SameParameter flag (curve deviation is greater than edge tolerance),
- not adjacent curves (3d or pcurve) to the vertices.
Constructors(1)
Empty constructor.
Static methods(2)
- get_type_name(): string
Instance methods(19)
Returns the projector used for recomputing missing pcurves Can be used for adjusting parameters of projector.
- FixRemovePCurve(edge: TopoDS_Edge, face: TopoDS_Face): booleanParameters (2)
edgeface
- FixRemovePCurve(edge: TopoDS_Edge, surface: Geom_Surface, location: TopLoc_Location): boolean
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.
Parameters (3)edgesurfacelocation
- FixRemoveCurve3d(edge: TopoDS_Edge): boolean
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.
Parameters (1)edge
- FixAddPCurve(edge: TopoDS_Edge, face: TopoDS_Face, isSeam: boolean, prec: number): boolean
See method below for information.
Parameters (4)edgefaceisSeamprec
- FixAddPCurve(edge: TopoDS_Edge, surface: Geom_Surface, location: TopLoc_Location, isSeam: boolean, prec: number): boolean
See method below for information.
Parameters (5)edgesurfacelocationisSeamprec
- FixAddPCurve(edge: TopoDS_Edge, face: TopoDS_Face, isSeam: boolean, surfana: ShapeAnalysis_Surface, prec: number): boolean
See method below for information.
Parameters (5)edgefaceisSeamsurfanaprec
- FixAddPCurve(edge: TopoDS_Edge, surface: Geom_Surface, location: TopLoc_Location, isSeam: boolean, surfana: ShapeAnalysis_Surface, prec: number): boolean
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 classShapeConstruct_ProjectCurveOnSurfacefor more info).Parameters (6)edgesurfacelocationisSeamsurfanaprec
- FixAddCurve3d(edge: TopoDS_Edge): boolean
Tries to build 3d curve of the edge if missing Use : It 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 Status : OK : 3d curve exists FAIL1:
BRepLib::BuildCurve3d()has failed DONE1: 3d curve was added.Parameters (1)edge
- FixVertexTolerance(edge: TopoDS_Edge, face: TopoDS_Face): booleanParameters (2)
edgeface
- FixVertexTolerance(edge: TopoDS_Edge): boolean
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.
Parameters (1)edge
- FixReversed2d(edge: TopoDS_Edge, face: TopoDS_Face): booleanParameters (2)
edgeface
- FixReversed2d(edge: TopoDS_Edge, surface: Geom_Surface, location: TopLoc_Location): boolean
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.Parameters (3)edgesurfacelocation
- FixSameParameter(edge: TopoDS_Edge, tolerance: number): boolean
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 functionShapeAnalysis_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 procedureBRepLib::SameParameterand computing deviation (as above). If <tolerance> > 0, it is used as parameter forBRepLib::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 ifBRepLib::SameParameter()did not set it) DONE3 - edge was modified byBRepLib::SameParameter()to SameParameter DONE4 - not used anymore DONE5 - if the edge resulting fromBRepLibhas been chosen, i.e. variant b. above (only for edges with not set SameParameter)Parameters (2)edgetolerance
- FixSameParameter(edge: TopoDS_Edge, face: TopoDS_Face, tolerance: number): boolean
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 functionShapeAnalysis_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 procedureBRepLib::SameParameterand computing deviation (as above). If <tolerance> > 0, it is used as parameter forBRepLib::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 ifBRepLib::SameParameter()did not set it) DONE3 - edge was modified byBRepLib::SameParameter()to SameParameter DONE4 - not used anymore DONE5 - if the edge resulting fromBRepLibhas been chosen, i.e. variant b. above (only for edges with not set SameParameter)Parameters (3)edgefacetolerance
- Status(status: ShapeExtend_Status): boolean
Returns the status (in the form of True/False) of last Fix.
Parameters (1)status
- SetContext(context: ShapeBuild_ReShape): void
Sets context.
Parameters (1)context
Returns context.
ShapeFix_EdgeConnect
Rebuilds edges to connect with new vertices, was moved from ShapeBuild. Makes vertices to be shared to connect edges, updates positions and tolerances for shared vertices. Accepts edges bounded by two vertices each.
Constructors(1)
Instance methods(4)
- Add(aFirst: TopoDS_Edge, aSecond: TopoDS_Edge): void
Adds information on connectivity between start vertex of second edge and end vertex of first edge, taking edges orientation into account.
Parameters (2)aFirstaSecond
- Add(aShape: TopoDS_Shape): void
Adds connectivity information for the whole shape. Note: edges in wires must be well ordered Note: flag Closed should be set for closed wires.
Parameters (1)aShape
- Build(): void
Builds shared vertices, updates their positions and tolerances.
- Clear(): void
Clears internal data structure.
ShapeFix_EdgeProjAux
Project 3D point (vertex) on pcurves to find Vertex Parameter on parametric representation of an edge.
Constructors(2)
- Parameters (2)
FE
Static methods(2)
- get_type_name(): string
Instance methods(8)
- Init(F: TopoDS_Face, E: TopoDS_Edge): voidParameters (2)
FE
- Compute(preci: number): voidParameters (1)
preci
- IsFirstDone(): boolean
- IsLastDone(): boolean
- FirstParam(): number
- LastParam(): number
- IsIso(C: Geom2d_Curve): booleanParameters (1)
C
ShapeFix_Face
This operator allows to perform various fixes on face and its wires: fixes provided by ShapeFix_Wire, fixing orientation of wires, addition of natural bounds, fixing of missing seam edge, and detection and removal of null-area wires.
Constructors(2)
Creates an empty tool.
- constructor(face: TopoDS_Face): ShapeFix_Face
Creates a tool and loads a face.
Parameters (1)face
Static methods(2)
- get_type_name(): string
Instance methods(36)
- ClearModes(): void
Sets all modes to default.
- Init(face: TopoDS_Face): void
Loads a whole face already created, with its wires, sense and location.
Parameters (1)face
- Init(surf: Geom_Surface, preci: number, fwd: boolean): void
Starts the creation of the face By default it will be FORWARD, or REVERSED if <fwd> is False.
Parameters (3)surfprecifwd
- Init(surf: ShapeAnalysis_Surface, preci: number, fwd: boolean): void
Starts the creation of the face By default it will be FORWARD, or REVERSED if <fwd> is False.
Parameters (3)surfprecifwd
- SetMsgRegistrator(msgreg: ShapeExtend_BasicMsgRegistrator): void
Sets message registrator.
Parameters (1)msgreg
- SetPrecision(preci: number): void
Sets basic precision value (also to FixWireTool).
Parameters (1)preci
- SetMinTolerance(mintol: number): void
Sets minimal allowed tolerance (also to FixWireTool).
Parameters (1)mintol
- SetMaxTolerance(maxtol: number): void
Sets maximal allowed tolerance (also to FixWireTool).
Parameters (1)maxtol
- FixWireMode(): number
Returns (modifiable) the mode for applying fixes of
ShapeFix_Wire, by default True. - FixOrientationMode(): number
Returns (modifiable) the fix orientation mode, by default True. If True, wires oriented to border limited square.
- FixAddNaturalBoundMode(): number
Returns (modifiable) the add natural bound mode. If true, natural boundary is added on faces that miss them. Default is False for faces with single wire (they are handled by FixOrientation in that case) and True for others.
- FixMissingSeamMode(): number
Returns (modifiable) the fix missing seam mode, by default True. If True, tries to insert seam is missed.
- FixSmallAreaWireMode(): number
Returns (modifiable) the fix small area wire mode, by default False. If True, drops small wires.
- RemoveSmallAreaFaceMode(): number
Returns (modifiable) the remove face with small area, by default False. If True, drops faces with small outer wires.
- FixIntersectingWiresMode(): number
Returns (modifiable) the fix intersecting wires mode by default True.
- FixLoopWiresMode(): number
Returns (modifiable) the fix loop wires mode by default True.
- FixSplitFaceMode(): number
Returns (modifiable) the fix split face mode by default True.
- AutoCorrectPrecisionMode(): number
Returns (modifiable) the auto-correct precision mode by default False.
- FixPeriodicDegeneratedMode(): number
Returns (modifiable) the activation flag for periodic degenerated fix. False by default.
- Face(): TopoDS_Face
Returns a face which corresponds to the current state Warning: The finally produced face may be another one ... but with the same support.
Returns resulting shape (Face or Shell if split) To be used instead of
Face()if FixMissingSeam involved.- Add(wire: TopoDS_Wire): void
Add a wire to current face using
BRep_Builder. Wire is added without taking into account orientation of face (as if face were FORWARD).Parameters (1)wire
- Perform(theProgress?: Message_ProgressRange): boolean
Performs all the fixes, depending on modes Function Status returns the status of last call to
Perform()ShapeExtend_OK : face 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.Parameters (1)theProgress
- FixOrientation(): boolean
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.
- FixOrientation(MapWires: NCollection_DataMap_TopoDS_Shape_NCollection_List_TopoDS_Shape_TopTools_ShapeMapHasher): boolean
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).
Parameters (1)MapWires—Mutated in place; read the updated value from this argument after the call.
- FixAddNaturalBound(): boolean
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
- FixMissingSeam(): boolean
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.
- FixSmallAreaWire(theIsRemoveSmallFace: boolean): boolean
Detects wires with small area (that is less than 100*Precision::PConfusion(). Removes these wires if they are internal. Returns : True if at least one small wire removed, False if does nothing.
Parameters (1)theIsRemoveSmallFace
- FixLoopWire(aResWires: NCollection_Sequence_TopoDS_Shape): boolean
Detects if wire has a loop and fixes this situation by splitting on the few parts. if wire has a loops and it was split Status was set to value ShapeExtend_DONE6.
Parameters (1)aResWires—Mutated in place; read the updated value from this argument after the call.
- FixIntersectingWires(): boolean
Detects and fixes the special case when face has more than one wire and this wires have intersection point.
- FixWiresTwoCoincEdges(): boolean
If wire contains two coincidence edges it must be removed Queries on status after
Perform(). - FixSplitFace(MapWires: NCollection_DataMap_TopoDS_Shape_NCollection_List_TopoDS_Shape_TopTools_ShapeMapHasher): boolean
Split face if there are more than one out wire using inrormation after
FixOrientation().Parameters (1)MapWires
- FixPeriodicDegenerated(): boolean
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.
- Status(status: ShapeExtend_Status): boolean
Returns the status of last call to
Perform()ShapeExtend_OK : face 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.Parameters (1)status
Returns tool for fixing wires.
ShapeFix_FaceConnect
Rebuilds connectivity between faces in shell.
Constructors(1)
Instance methods(3)
- Add(aFirst: TopoDS_Face, aSecond: TopoDS_Face): booleanParameters (2)
aFirstaSecond
- Build(shell: TopoDS_Shell, sewtoler: number, fixtoler: number): TopoDS_ShellParameters (3)
shellsewtolerfixtoler
- Clear(): void
Clears internal data structure.
ShapeFix_FixSmallFace
Fixing face with small size.
Constructors(1)
Static methods(2)
- get_type_name(): string
Instance methods(16)
- Init(S: TopoDS_Shape): voidParameters (1)
S
- Perform(): void
Fixing case of spot face.
Fixing case of spot face, if tol = -1 used local tolerance.
- ReplaceVerticesInCaseOfSpot(F: TopoDS_Face, tol: number): boolean
Compute average vertex and replacing vertices by new one.
Parameters (2)F—Mutated in place; read the updated value from this argument after the call.tol
- RemoveFacesInCaseOfSpot(F: TopoDS_Face): boolean
Remove spot face from compound.
Parameters (1)F
- FixStripFace(wasdone?: boolean): TopoDS_Shape
Fixing case of strip face, if tol = -1 used local tolerance.
Parameters (1)wasdone
- ReplaceInCaseOfStrip(F: TopoDS_Face, E1: TopoDS_Edge, E2: TopoDS_Edge, tol: number): boolean
Replace veretces and edges.
Parameters (4)F—Mutated in place; read the updated value from this argument after the call.E1—Mutated in place; read the updated value from this argument after the call.E2—Mutated in place; read the updated value from this argument after the call.tol
- RemoveFacesInCaseOfStrip(F: TopoDS_Face): boolean
Remove strip face from compound.
Parameters (1)F
- Parameters (1)
S
- SplitOneFace(F: TopoDS_Face, theSplittedFaces: TopoDS_Compound): boolean
Compute data for face splitting.
Parameters (2)F—Mutated in place; read the updated value from this argument after the call.theSplittedFaces—Mutated in place; read the updated value from this argument after the call.
- Parameters (1)
F
- FixPinFace(F: TopoDS_Face): booleanParameters (1)
F
ShapeFix_FixSmallSolid
Fixing solids with small size.
Constructors(1)
Construct.
Static methods(2)
- get_type_name(): string
Instance methods(6)
- SetFixMode(theMode: number): void
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
Parameters (1)theMode
- SetVolumeThreshold(theThreshold?: number): void
Set or clear volume threshold for small solids.
Parameters (1)theThreshold
- SetWidthFactorThreshold(theThreshold?: number): void
Set or clear width factor threshold for small solids.
Parameters (1)theThreshold
- Remove(theShape: TopoDS_Shape, theContext: ShapeBuild_ReShape): TopoDS_Shape
Remove small solids from the given shape.
Parameters (2)theShapetheContext
- Merge(theShape: TopoDS_Shape, theContext: ShapeBuild_ReShape): TopoDS_Shape
Merge small solids in the given shape to adjacent non-small ones.
Parameters (2)theShapetheContext
ShapeFix_FreeBounds
This class is intended to output free bounds of the shape (free bounds are the wires consisting of edges referenced by the only face). For building free bounds it uses ShapeAnalysis_FreeBounds class. This class complements it with the feature to reduce the number of open wires. This reduction is performed with help of connecting several adjacent open wires one to another what can lead to:
- making an open wire with greater length out of several open wires
- making closed wire out of several open wires
The connecting open wires is performed with a user-given tolerance.
When connecting several open wires into one wire their previous end vertices are replaced with new connecting vertices. After that all the edges in the shape sharing previous vertices inside the shape are updated with new vertices. Thus source shape can be modified.
Since interface of this class is the same as one ofShapeAnalysis_FreeBoundsrefer to its CDL for details.
Constructors(3)
Empty constructor.
- constructor(shape: TopoDS_Shape, closetoler: number, splitclosed: boolean, splitopen: boolean): ShapeFix_FreeBounds
Builds actual free bounds of the <shape> and connects open wires with tolerance <closetoler>. <shape> should be a compound of shells.
Parameters (4)shapeclosetolersplitclosedsplitopen
- constructor(shape: TopoDS_Shape, sewtoler: number, closetoler: number, splitclosed: boolean, splitopen: boolean): ShapeFix_FreeBounds
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.
Parameters (5)shapesewtolerclosetolersplitclosedsplitopen
Instance methods(3)
Returns compound of closed wires out of free edges.
Returns compound of open wires out of free edges.
Returns modified source shape.
ShapeFix_IntersectionTool
Tool for fixing selfintersecting wire and intersecting wires.
Constructors(1)
- constructor(context: ShapeBuild_ReShape, preci: number, maxtol?: number): ShapeFix_IntersectionTool
Constructor.
Parameters (3)contextprecimaxtol
Instance methods(5)
Returns context.
- SplitEdge(edge: TopoDS_Edge, param: number, vert: TopoDS_Vertex, face: TopoDS_Face, newE1: TopoDS_Edge, newE2: TopoDS_Edge, preci: number): boolean
Split edge on two new edges using new vertex "vert" and "param" - parameter for splitting The "face" is necessary for pcurves and using TransferParameterProj.
Parameters (7)edgeparamvertfacenewE1—Mutated in place; read the updated value from this argument after the call.newE2—Mutated in place; read the updated value from this argument after the call.preci
- CutEdge(edge: TopoDS_Edge, pend: number, cut: number, face: TopoDS_Face, iscutline: boolean): { returnValue: boolean; iscutline: boolean }
Cut edge by parameters pend and cut.
Parameters (5)edgependcutfaceiscutline
ReturnsA result object with fields:
returnValue: the C++ return valueiscutline: updated value from the call.
- FixSelfIntersectWire(face: TopoDS_Face, NbSplit: number, NbCut: number, NbRemoved: number): { returnValue: boolean; sewd: ShapeExtend_WireData; NbSplit: number; NbCut: number; NbRemoved: number; [Symbol.dispose](): void }Parameters (4)
faceNbSplitNbCutNbRemoved
- FixIntersectingWires(face: TopoDS_Face): booleanParameters (1)
face
ShapeFix_Root
Root class for fixing operations Provides context for recording changes (optional), basic precision value and limit (minimal and maximal) values for tolerances, and message registrator.
Constructors(1)
Empty Constructor (no context is created).
Static methods(2)
- get_type_name(): string
Instance methods(19)
- Set(Root: ShapeFix_Root): void
Copy all fields from another Root object.
Parameters (1)Root
- SetContext(context: ShapeBuild_ReShape): void
Sets context.
Parameters (1)context
Returns context.
- SetMsgRegistrator(msgreg: ShapeExtend_BasicMsgRegistrator): void
Sets message registrator.
Parameters (1)msgreg
Returns message registrator.
- SetPrecision(preci: number): void
Sets basic precision value.
Parameters (1)preci
- Precision(): number
Returns basic precision value.
- SetMinTolerance(mintol: number): void
Sets minimal allowed tolerance.
Parameters (1)mintol
- MinTolerance(): number
Returns minimal allowed tolerance.
- SetMaxTolerance(maxtol: number): void
Sets maximal allowed tolerance.
Parameters (1)maxtol
- MaxTolerance(): number
Returns maximal allowed tolerance.
- LimitTolerance(toler: number): number
Returns tolerance limited by [myMinTol,myMaxTol].
Parameters (1)toler
- SendMsg(shape: TopoDS_Shape, message: Message_Msg, gravity: Message_Gravity): void
Sends a message to be attached to the shape. Calls corresponding message of message registrator.
Parameters (3)shapemessagegravity
- SendMsg(message: Message_Msg, gravity: Message_Gravity): void
Sends a message to be attached to myShape. Calls previous method.
Parameters (2)messagegravity
- SendWarning(shape: TopoDS_Shape, message: Message_Msg): void
Sends a warning to be attached to the shape. Calls SendMsg with gravity set to Message_Warning.
Parameters (2)shapemessage
- SendWarning(message: Message_Msg): void
Calls previous method for myShape.
Parameters (1)message
- SendFail(shape: TopoDS_Shape, message: Message_Msg): void
Sends a fail to be attached to the shape. Calls SendMsg with gravity set to Message_Fail.
Parameters (2)shapemessage
- SendFail(message: Message_Msg): void
Calls previous method for myShape.
Parameters (1)message
ShapeFix_Shape
Fixing shape in general.
Constructors(2)
Empty Constructor.
- constructor(shape: TopoDS_Shape): ShapeFix_Shape
Initislises by shape.
Parameters (1)shape
Static methods(2)
- get_type_name(): string
Instance methods(21)
- Init(shape: TopoDS_Shape): void
Initislises by shape.
Parameters (1)shape
- Perform(theProgress?: Message_ProgressRange): boolean
Iterates on sub- shape and performs fixes.
Parameters (1)theProgress
Returns resulting shape.
Returns tool for fixing solids.
Returns tool for fixing shells.
Returns tool for fixing faces.
Returns tool for fixing wires.
Returns tool for fixing edges.
- Status(status: ShapeExtend_Status): boolean
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.
Parameters (1)status
- SetMsgRegistrator(msgreg: ShapeExtend_BasicMsgRegistrator): void
Sets message registrator.
Parameters (1)msgreg
- SetPrecision(preci: number): void
Sets basic precision value (also to FixSolidTool).
Parameters (1)preci
- SetMinTolerance(mintol: number): void
Sets minimal allowed tolerance (also to FixSolidTool).
Parameters (1)mintol
- SetMaxTolerance(maxtol: number): void
Sets maximal allowed tolerance (also to FixSolidTool).
Parameters (1)maxtol
- FixSolidMode(): number
Returns (modifiable) the mode for applying fixes of
ShapeFix_Solid, by default True. - FixFreeShellMode(): number
Returns (modifiable) the mode for applying fixes of
ShapeFix_Shell, by default True. - FixFreeFaceMode(): number
Returns (modifiable) the mode for applying fixes of
ShapeFix_Face, by default True. - FixFreeWireMode(): number
Returns (modifiable) the mode for applying fixes of
ShapeFix_Wire, by default True. - FixSameParameterMode(): number
Returns (modifiable) the mode for applying
ShapeFix::SameParameterafter all fixes, by default True. - FixVertexPositionMode(): number
Returns (modifiable) the mode for applying
ShapeFix::FixVertexPositionbefore all fixes, by default False. - FixVertexTolMode(): number
Returns (modifiable) the mode for fixing tolerances of vertices on whole shape after performing all fixes.
ShapeFix_ShapeTolerance
Modifies tolerances of sub-shapes (vertices, edges, faces).
Constructors(1)
Instance methods(2)
- LimitTolerance(shape: TopoDS_Shape, tmin: number, tmax?: number, styp?: TopAbs_ShapeEnum): boolean
Limits tolerances in a shape as follows : tmin = 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 = VERTEX : only vertices are set styp = EDGE : only edges are set styp = FACE : only faces are set styp = WIRE : to have edges and their vertices set styp = other value : all (vertices,edges,faces) are set Returns True if at least one tolerance of the sub-shape has been modified.
Parameters (4)shapetmintmaxstyp
- SetTolerance(shape: TopoDS_Shape, preci: number, styp?: TopAbs_ShapeEnum): void
Sets (enforces) tolerances in a shape to the given value styp = VERTEX : only vertices are set styp = EDGE : only edges are set styp = FACE : only faces are set styp = WIRE : to have edges and their vertices set styp = other value : all (vertices,edges,faces) are set.
Parameters (3)shapeprecistyp
ShapeFix_Shell
Fixing orientation of faces in shell.
Constructors(2)
Empty constructor.
- constructor(shape: TopoDS_Shell): ShapeFix_Shell
Initializes by shell.
Parameters (1)shape
Static methods(2)
- get_type_name(): string
Instance methods(17)
- Init(shell: TopoDS_Shell): void
Initializes by shell.
Parameters (1)shell
- Perform(theProgress?: Message_ProgressRange): boolean
Iterates on subshapes and performs fixes (for each face calls
ShapeFix_Face::Performand then calls FixFaceOrientation). The passed progress indicator allows user to consult the current progress stage and abort algorithm if needed.Parameters (1)theProgress
- FixFaceOrientation(shell: TopoDS_Shell, isAccountMultiConex?: boolean, NonManifold?: boolean): boolean
Fixes orientation of faces in shell. Changes orientation of face in the shell, if it is oriented opposite to neighbouring 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. Modes : isAccountMultiConex - mode for account cases of multiconnexity. If this mode is equal to true, separate shells will be created in the cases of multiconnexity.
If this mode is equal to false, one shell will be created without account of multiconnexity.By default - true; NonManifold - mode for creation of non-manifold shells. If this mode is equal to true one non-manifold will be created from shell contains multishared edges. Else if this mode is equal to false only manifold shells will be created. By default - false.Parameters (3)shellisAccountMultiConexNonManifold
Returns fixed shell (or subset of oriented faces).
In case of multiconnexity returns compound of fixed shells else returns one shell..
- NbShells(): number
Returns Number of obtainrd shells;.
Returns not oriented subset of faces.
- Status(status: ShapeExtend_Status): boolean
Returns the status of the last Fix.
Parameters (1)status
Returns tool for fixing faces.
- SetMsgRegistrator(msgreg: ShapeExtend_BasicMsgRegistrator): void
Sets message registrator.
Parameters (1)msgreg
- SetPrecision(preci: number): void
Sets basic precision value (also to FixWireTool).
Parameters (1)preci
- SetMinTolerance(mintol: number): void
Sets minimal allowed tolerance (also to FixWireTool).
Parameters (1)mintol
- SetMaxTolerance(maxtol: number): void
Sets maximal allowed tolerance (also to FixWireTool).
Parameters (1)maxtol
- FixFaceMode(): number
Returns (modifiable) the mode for applying fixes of
ShapeFix_Face, by default True. - FixOrientationMode(): number
Returns (modifiable) the mode for applying FixFaceOrientation, by default True.
- SetNonManifoldFlag(isNonManifold: boolean): void
Sets NonManifold flag.
Parameters (1)isNonManifold
ShapeFix_Solid
Provides method to build a solid from a shells and orients them in order to have a valid solid with finite volume.
Constructors(2)
Empty constructor;.
- constructor(solid: TopoDS_Solid): ShapeFix_Solid
Initializes by solid.
Parameters (1)solid
Static methods(2)
- get_type_name(): string
Instance methods(15)
- Init(solid: TopoDS_Solid): void
Initializes by solid .
Parameters (1)solid
- Perform(theProgress?: Message_ProgressRange): boolean
Iterates on shells and performs fixes (calls
ShapeFix_Shellfor each subshell). The passed progress indicator allows user to consult the current progress stage and abort algorithm if needed.Parameters (1)theProgress
- SolidFromShell(shell: TopoDS_Shell): TopoDS_Solid
Calls MakeSolid and orients the solid to be "not infinite".
Parameters (1)shell
- Status(status: ShapeExtend_Status): boolean
Returns the status of the last Fix.
Parameters (1)status
Returns resulting solid.
Returns tool for fixing shells.
- SetMsgRegistrator(msgreg: ShapeExtend_BasicMsgRegistrator): void
Sets message registrator.
Parameters (1)msgreg
- SetPrecision(preci: number): void
Sets basic precision value (also to FixShellTool).
Parameters (1)preci
- SetMinTolerance(mintol: number): void
Sets minimal allowed tolerance (also to FixShellTool).
Parameters (1)mintol
- SetMaxTolerance(maxtol: number): void
Sets maximal allowed tolerance (also to FixShellTool).
Parameters (1)maxtol
- FixShellMode(): number
Returns (modifiable) the mode for applying fixes of
ShapeFix_Shell, by default True. - FixShellOrientationMode(): number
Returns (modifiable) the mode for applying analysis and fixes of orientation of shells in the solid; by default True.
- CreateOpenSolidMode(): boolean
Returns (modifiable) the mode for creation of solids. If mode myCreateOpenSolidMode is equal to true solids are created from open shells else solids are created from closed shells only.
ShapeFix_Shell, by default False. In case of multiconnexity returns compound of fixed solids else returns one solid.
ShapeFix_SplitCommonVertex
Two wires have common vertex - this case is valid in BRep model and isn't valid in STEP => before writing into STEP it is necessary to split this vertex (each wire must has one vertex).
Constructors(1)
Static methods(2)
- get_type_name(): string
Instance methods(4)
- Init(S: TopoDS_Shape): voidParameters (1)
S
- Perform(): void
ShapeFix_SplitTool
Tool for splitting and cutting edges; includes methods used in OverlappingTool and IntersectionTool.
Constructors(1)
Empty constructor.
Instance methods(4)
- SplitEdge(edge: TopoDS_Edge, param: number, vert: TopoDS_Vertex, face: TopoDS_Face, newE1: TopoDS_Edge, newE2: TopoDS_Edge, tol3d: number, tol2d: number): boolean
Split edge on two new edges using new vertex "vert" and "param" - parameter for splitting The "face" is necessary for pcurves and using TransferParameterProj.
Parameters (8)edgeparamvertfacenewE1—Mutated in place; read the updated value from this argument after the call.newE2—Mutated in place; read the updated value from this argument after the call.tol3dtol2d
- SplitEdge(edge: TopoDS_Edge, param1: number, param2: number, vert: TopoDS_Vertex, face: TopoDS_Face, newE1: TopoDS_Edge, newE2: TopoDS_Edge, tol3d: number, tol2d: number): boolean
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.
Parameters (9)edgeparam1param2vertfacenewE1—Mutated in place; read the updated value from this argument after the call.newE2—Mutated in place; read the updated value from this argument after the call.tol3dtol2d
- SplitEdge(edge: TopoDS_Edge, fp: number, V1: TopoDS_Vertex, lp: number, V2: TopoDS_Vertex, face: TopoDS_Face, SeqE: NCollection_Sequence_TopoDS_Shape, aNum: number, context: ShapeBuild_ReShape, tol3d: number, tol2d: number): { returnValue: boolean; aNum: number }
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].
Parameters (11)edgefpV1lpV2faceSeqE—Mutated in place; read the updated value from this argument after the call.aNumcontexttol3dtol2d
ReturnsA result object with fields:
returnValue: the C++ return valueaNum: updated value from the call.
- CutEdge(edge: TopoDS_Edge, pend: number, cut: number, face: TopoDS_Face, iscutline: boolean): { returnValue: boolean; iscutline: boolean }
Cut edge by parameters pend and cut.
Parameters (5)edgependcutfaceiscutline
ReturnsA result object with fields:
returnValue: the C++ return valueiscutline: updated value from the call.
ShapeFix_Wire
This class provides a set of tools for repairing a wire.
These are methods Fix...(), organised in two levels:
Level 1: Advanced - each method in this level fixes one separate problem, usually dealing with either single edge or connection of the two adjacent edges. These methods should be used carefully and called in right sequence, because some of them depend on others.
Level 2: Public (API) - methods which group several methods of level 1 and call them in a proper sequence in order to make some consistent set of fixes for a whole wire. It is possible to control calls to methods of the advanced level from methods of the public level by use of flags Fix..Mode() (see below).
Fixes can be made in three ways:
- Increasing tolerance of an edge or a vertex
- Changing topology (adding/removing/replacing edge in the wire and/or replacing the vertex in the edge)
- Changing geometry (shifting vertex or adjusting ends of edge curve to vertices, or recomputing curves of the edge)
When fix can be made in more than one way (e.g., either by increasing tolerance or shifting a vertex), it is chosen according to the flags: ModifyTopologyMode - allows modification of the topology. This flag can be set when fixing a wire on the separate (free) face, and should be unset for face which is part of shell. ModifyGeometryMode - allows modification of the geometry.
The order of descriptions of Fix() methods in this CDL approximately corresponds to the optimal order of calls.
NOTE: most of fixing methods expect edges in theShapeExtend_WireDatato be ordered, so it is necessary to make call toFixReorder()before any other fixes
ShapeFix_Wireshould be initialized prior to any fix by the following data: a) Wire (etherTopoDS_Wireor ShapeExtend_Wire) b) Face or surface c)Precisiond) Maximal tail angle and width This can be done either by calling corresponding methods (LoadWire, SetFace or SetSurface, SetPrecision, SetMaxTailAngle and SetMaxTailWidth), or by loading already filled ShapeAnalisis_Wire with method Load
Constructors(2)
Empty Constructor, creates clear object with default flags.
- constructor(wire: TopoDS_Wire, face: TopoDS_Face, prec: number): ShapeFix_Wire
Create new object with default flags and prepare it for use (Loads analyzer with all the data for the wire and face).
Parameters (3)wirefaceprec
Static methods(2)
- get_type_name(): string
Instance methods(89)
- ClearModes(): void
Sets all modes to default.
- ClearStatuses(): void
Clears all statuses.
- Init(wire: TopoDS_Wire, face: TopoDS_Face, prec: number): void
Load analyzer with all the data for the wire and face and drops all fixing statuses.
Parameters (3)wirefaceprec
- Init(saw: ShapeAnalysis_Wire): void
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.
Parameters (1)saw
- Load(wire: TopoDS_Wire): void
Load data for the wire, and drops all fixing statuses.
Parameters (1)wire
- Load(sbwd: ShapeExtend_WireData): void
Load data for the wire, and drops all fixing statuses.
Parameters (1)sbwd
- SetFace(face: TopoDS_Face): void
Set working face for the wire.
Parameters (1)face
- SetFace(theFace: TopoDS_Face, theSurfaceAnalysis: ShapeAnalysis_Surface): void
Set working face for the wire and surface analysis object.
Parameters (2)theFacetheSurfaceAnalysis
- SetSurface(theSurfaceAnalysis: ShapeAnalysis_Surface): void
Set surface analysis for the wire.
Parameters (1)theSurfaceAnalysis
- SetSurface(surf: Geom_Surface): void
Set surface for the wire.
Parameters (1)surf
- SetSurface(surf: Geom_Surface, loc: TopLoc_Location): void
Set surface for the wire.
Parameters (2)surfloc
- SetPrecision(preci: number): void
Set working precision (to root and to analyzer).
Parameters (1)preci
- SetMaxTailAngle(theMaxTailAngle: number): void
Sets the maximal allowed angle of the tails in radians.
Parameters (1)theMaxTailAngle
- SetMaxTailWidth(theMaxTailWidth: number): void
Sets the maximal allowed width of the tails.
Parameters (1)theMaxTailWidth
- IsLoaded(): boolean
Tells if the wire is loaded.
- IsReady(): boolean
Tells if the wire and face are loaded.
- NbEdges(): number
returns number of edges in the working wire
- Wire(): TopoDS_Wire
Makes the resulting Wire (by basic Brep_Builder).
Makes the resulting Wire (by BRepAPI_MakeWire).
returns field Analyzer (working tool)
returns working wire
- Face(): TopoDS_Face
returns working face (Analyzer.Face())
- ModifyTopologyMode(): boolean
Returns (modifiable) the flag which defines whether it is allowed to modify topology of the wire during fixing (adding/removing edges etc.).
- ModifyGeometryMode(): boolean
Returns (modifiable) the flag which defines whether the Fix..() methods are allowed to modify geometry of the edges and vertices.
- ModifyRemoveLoopMode(): number
Returns (modifiable) the flag which defines whether the Fix..() methods are allowed to modify RemoveLoop of the edges.
- ClosedWireMode(): boolean
Returns (modifiable) the flag which defines whether the wire is to be closed (by calling methods like
FixDegenerated()andFixConnected()for last and first edges). - PreferencePCurveMode(): boolean
Returns (modifiable) the flag which defines whether the 2d (True) representation of the wire is preferable over 3d one (in the case of ambiguity in FixEdgeCurves).
- FixGapsByRangesMode(): boolean
Returns (modifiable) the flag which defines whether tool tries to fix gaps first by changing curves ranges (i.e. using intersection, extrema, projections) or not.
- FixReorderMode(): number
- FixSmallMode(): number
- FixConnectedMode(): number
- FixEdgeCurvesMode(): number
- FixDegeneratedMode(): number
- FixSelfIntersectionMode(): number
- FixLackingMode(): number
- FixGaps3dMode(): number
- FixGaps2dMode(): number
Returns (modifiable) the flag for corresponding Fix..() method which defines whether this method will be called from the method APIFix(): -1 default 1 method will be called 0 method will not be called.
- FixReversed2dMode(): number
- FixRemovePCurveMode(): number
- FixAddPCurveMode(): number
- FixRemoveCurve3dMode(): number
- FixAddCurve3dMode(): number
- FixSeamMode(): number
- FixShiftedMode(): number
- FixSameParameterMode(): number
- FixVertexToleranceMode(): number
- FixNotchedEdgesMode(): number
- FixSelfIntersectingEdgeMode(): number
- FixIntersectingEdgesMode(): number
- FixNonAdjacentIntersectingEdgesMode(): number
Returns (modifiable) the flag for corresponding Fix..() method which defines whether this method will be called from the corresponding Fix..() method of the public level: -1 default 1 method will be called 0 method will not be called.
- FixTailMode(): number
- Perform(theProgress?: Message_ProgressRange): boolean
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 ofPerform()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)Parameters (1)theProgress
- FixReorder(theModeBoth: boolean): boolean
Performs an analysis and reorders edges in the wire using class WireOrder. Flag <theModeBoth> determines the use of miscible mode if necessary.
Parameters (1)theModeBoth
- FixReorder(wi: ShapeAnalysis_WireOrder): boolean
Reorder edges in the wire as determined by WireOrder that should be filled and computed before.
Parameters (1)wi
- FixSmall(lockvtx: boolean, precsmall: number): number
Applies FixSmall(num) to all edges in the wire.
Parameters (2)lockvtxprecsmall
- FixSmall(num: number, lockvtx: boolean, precsmall: number): boolean
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 preceding edge But if lockvtx is True, this edge must be kept ...
Parameters (3)numlockvtxprecsmall
- FixConnected(prec: number): boolean
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.Parameters (1)prec
- FixConnected(num: number, prec: number, theUpdateWire: boolean): boolean
Fixes connected edges (preceding and current) Forces Vertices (end of preceding-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. If <theUpdateWire> is true, synchronizes wire data with context replacements.Parameters (3)numprectheUpdateWire
- FixEdgeCurves(): boolean
Groups the fixes dealing with 3d and pcurves of the edges. The order of the fixes and the default behaviour are:
ShapeFix_Edge::FixReversed2dShapeFix_Edge::FixRemovePCurve(only if forced)ShapeFix_Edge::FixAddPCurveShapeFix_Edge::FixRemoveCurve3d(only if forced)ShapeFix_Edge::FixAddCurve3dFixSeam, FixShifted,ShapeFix_Edge::FixSameParameter. - FixDegenerated(): boolean
Applies FixDegenerated(num) to all edges in the wire Connection between first and last edges is treated only if flag ClosedMode is True.
- FixDegenerated(num: number): boolean
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.
Parameters (1)num
- FixSelfIntersection(): boolean
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.
- FixLacking(force: boolean): boolean
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.
Parameters (1)force
- FixLacking(num: number, force: boolean): boolean
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.
Parameters (2)numforce
- FixClosed(prec?: number): boolean
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.Parameters (1)prec
- FixGaps3d(): boolean
Fixes gaps between ends of 3d curves on adjacent edges myPrecision is used to detect the gaps.
- FixGaps2d(): boolean
Fixes gaps between ends of pcurves on adjacent edges myPrecision is used to detect the gaps.
- FixSeam(num: number): boolean
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 theShapeExtend_WireDatais always forward (orientation is accounted by edges), it will work correct if:- Wire created from
ShapeExtend_WireDatawith methodsShapeExtend_WireData::Wire..() is added into the FORWARD face (orientation can be applied later) - Wire is extracted from the face with orientation not composed with orientation of the face
Parameters (1)num
- Wire created from
- FixShifted(): boolean
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 fromShapeFix_Wire, more sophisticated check of degenerate points is performed, and special cases like sphere given by two meridians are treated. - FixNotchedEdges(): boolean
- FixGap3d(num: number, convert?: boolean): boolean
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.
Parameters (2)numconvert
- FixGap2d(num: number, convert?: boolean): boolean
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.
Parameters (2)numconvert
- FixTails(): boolean
- StatusReorder(status: ShapeExtend_Status): booleanParameters (1)
status
- StatusSmall(status: ShapeExtend_Status): booleanParameters (1)
status
- StatusConnected(status: ShapeExtend_Status): booleanParameters (1)
status
- StatusEdgeCurves(status: ShapeExtend_Status): booleanParameters (1)
status
- StatusDegenerated(status: ShapeExtend_Status): booleanParameters (1)
status
- StatusSelfIntersection(status: ShapeExtend_Status): booleanParameters (1)
status
- StatusLacking(status: ShapeExtend_Status): booleanParameters (1)
status
- StatusClosed(status: ShapeExtend_Status): booleanParameters (1)
status
- StatusGaps3d(status: ShapeExtend_Status): booleanParameters (1)
status
- StatusGaps2d(status: ShapeExtend_Status): booleanParameters (1)
status
- StatusNotches(status: ShapeExtend_Status): booleanParameters (1)
status
- StatusRemovedSegment(): boolean
Querying the status of performed API fixing procedures Each Status..() methods gives information about the last call to the corresponding Fix..() method of API level: OK : no problems detected; nothing done DONE: some problem(s) was(were) detected and successfully fixed FAIL: some problem(s) cannot be fixed.
- StatusFixTails(status: ShapeExtend_Status): booleanParameters (1)
status
- LastFixStatus(status: ShapeExtend_Status): boolean
Queries the status of last call to methods Fix... of advanced level For details see corresponding methods; universal statuses are: OK : problem not detected; nothing done DONE: problem was detected and successfully fixed FAIL: problem cannot be fixed.
Parameters (1)status
Returns tool for fixing wires.
ShapeFix_Wireframe
Provides methods for fixing wireframe of shape.
Constructors(2)
- constructor(shape: TopoDS_Shape): ShapeFix_WireframeParameters (1)
shape
Static methods(2)
- get_type_name(): string
Instance methods(13)
- ClearStatuses(): void
Clears all statuses.
- Load(shape: TopoDS_Shape): void
Loads a shape, resets statuses.
Parameters (1)shape
- FixWireGaps(): boolean
Fixes gaps between ends of curves of adjacent edges (both 3d and pcurves) in wires If precision is 0.0, uses
Precision::Confusion(). - FixSmallEdges(): boolean
Fixes small edges in shape by merging adjacent edges If precision is 0.0, uses
Precision::Confusion(). - CheckSmallEdges(theSmallEdges: NCollection_Map_TopoDS_Shape_TopTools_ShapeMapHasher, theEdgeToFaces: NCollection_DataMap_TopoDS_Shape_NCollection_List_TopoDS_Shape_TopTools_ShapeMapHasher, theFaceWithSmall: NCollection_DataMap_TopoDS_Shape_NCollection_List_TopoDS_Shape_TopTools_ShapeMapHasher, theMultyEdges: NCollection_Map_TopoDS_Shape_TopTools_ShapeMapHasher): boolean
Auxiliary tool for FixSmallEdges which checks for small edges and fills the maps. Returns True if at least one small edge has been found.
Parameters (4)theSmallEdges—Mutated in place; read the updated value from this argument after the call.theEdgeToFaces—Mutated in place; read the updated value from this argument after the call.theFaceWithSmall—Mutated in place; read the updated value from this argument after the call.theMultyEdges—Mutated in place; read the updated value from this argument after the call.
- MergeSmallEdges(theSmallEdges: NCollection_Map_TopoDS_Shape_TopTools_ShapeMapHasher, theEdgeToFaces: NCollection_DataMap_TopoDS_Shape_NCollection_List_TopoDS_Shape_TopTools_ShapeMapHasher, theFaceWithSmall: NCollection_DataMap_TopoDS_Shape_NCollection_List_TopoDS_Shape_TopTools_ShapeMapHasher, theMultyEdges: NCollection_Map_TopoDS_Shape_TopTools_ShapeMapHasher, theModeDrop: boolean, theLimitAngle: number): boolean
Auxiliary tool for FixSmallEdges which merges small edges. If theModeDrop is equal to 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.
Parameters (6)theSmallEdges—Mutated in place; read the updated value from this argument after the call.theEdgeToFaces—Mutated in place; read the updated value from this argument after the call.theFaceWithSmall—Mutated in place; read the updated value from this argument after the call.theMultyEdges—Mutated in place; read the updated value from this argument after the call.theModeDroptheLimitAngle
- StatusWireGaps(status: ShapeExtend_Status): boolean
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.
Parameters (1)status
- StatusSmallEdges(status: ShapeExtend_Status): boolean
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.
Parameters (1)status
- ModeDropSmallEdges(): boolean
Returns mode managing removing small edges.
- SetLimitAngle(theLimitAngle: number): void
Set limit angle for merging edges.
Parameters (1)theLimitAngle
- LimitAngle(): number
Get limit angle for merging edges.
ShapeFix_WireVertex
Fixing disconnected edges in the wire Fixes vertices in the wire on the basis of pre-analysis made by ShapeAnalysis_WireVertex (given as argument). The Wire has formerly been loaded in a ShapeExtend_WireData.
Constructors(1)
Instance methods(8)
- Init(sawv: ShapeAnalysis_WireVertex): void
Loads all the data on wire, already analysed by
ShapeAnalysis_WireVertex.Parameters (1)sawv
- Init(wire: TopoDS_Wire, preci: number): void
Loads the wire, ininializes internal analyzer (
ShapeAnalysis_WireVertex) with the given precision, and performs analysis.Parameters (2)wirepreci
- Init(sbwd: ShapeExtend_WireData, preci: number): void
Loads the wire, ininializes internal analyzer (
ShapeAnalysis_WireVertex) with the given precision, and performs analysis.Parameters (2)sbwdpreci
returns internal analyzer
returns data on wire (fixed)
- Wire(): TopoDS_Wire
returns resulting wire (fixed)
- FixSame(): number
Fixes "Same" or "Close" status (same vertex may be set, without changing parameters) Returns the count of fixed vertices, 0 if none.
- Fix(): number
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.
ShapeExtend
OCCT package ShapeExtend: ShapeExtend, ShapeExtend_BasicMsgRegistrator, ShapeExtend_ComplexCurve, ShapeExtend_CompositeSurface, and 5 more bound classes.
ShapeProcess
OCCT package ShapeProcess: ShapeProcess, ShapeProcess_Context, ShapeProcess_Operator, ShapeProcess_OperLibrary, and 2 more bound classes.