# Repairing geometrical objects

Repairing operations are used for adjustment and modification of created geometrical shapes. The are:

- Shape processing

- Suppress faces

- Close contour

- Suppress internal wires

- Suppress holes

- Sewing

- Glue faces

- Add point on edge

- Check free boundaries

The operations Suppress faces, Close contour, Suppress internal wires, Suppress holes and Add point on edge are available only if you are using OCC viewer.

To apply repairing operations:

In the main menu select Repair submenu.

Shape processing

Description: Processes a shape using various operators.

Result: GEOM_Object.

TUI Command: geompy.ProcessShape(Shape, Operators, Parameters, Values), where Shape is a processed shape, Operators is a list of names of operators ("FixShape", "SplitClosedFaces", etc.), Parameters is a list of names of parameters (FixShape.Tolerance3d, etc), Values is a list of values of parameters in the same order as the Parameters list.

Arguments: 1 or more shapes.

1 | SplitAngle this operator is intended for splitting faces based on conical surfaces, surfaces of revolution and cylindrical surfaces by angle SplitAngle.Angle angle (in radians) defining size of result segments. SplitAngle.MaxTolerance maximal possible tolerance on result shape
2 | SplitClosedFaces this operator is intended for dividing all closed faces in the shape according to the number of points. SplitClosedFaces.NbSplitPoints number of points for cutting each closed faces.
3 | FixFaceSize this operator is intended for removing small faces (case of the spot face and strip face) FixFaceSize.Tolerance work tolerance defining which faces will be removed.
4 | DropSmallEdges this operator is intended for removing small edges or merging with neigbour. DropSmallEdges.Tolerance3d work tolerance for detection and removing small edges.
5 | BsplineRestriction this operator is intended for re-approximation BSplines curves and surfaces or conversion of the curves and surfaces to BSplines with specified parameters. BSplineRestriction.SurfaceMode - mode of approximation of surfaces if restriction is necessary BSplineRestriction.Curve3dMode -mode of conversion of any 3D curve to BSpline and approximation. BSplineRestriction.Curve2dMode - mode of conversion of any 2D curve to BSpline and approximation BSplineRestriction.Tolerance3d work tolerance for definition of the possibility of the approximation of the surfaces and 3D curves with specified parameters. BSplineRestriction.Tolerance2d - work tolerance for definition of the possibility of the approximation of the 2D curves with specified parameters. BSplineRestriction.Continuity3d desired continuity of the resultant surfaces and 3D curves. BSplineRestriction.Continuity2d desired continuity of the resultant 2D curves. BSplineRestriction.RequiredDegree - required degree of the resultant BSplines BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6 | SplitContinuity this operator is intended for splitting shapes to achieve continuities of curves and surfaces less than specified ones. SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry. SplitContinuity.SurfaceContinuity - required continuity for surfaces. SplitContinuity.CurveContinuity - required continuity for curves.
7 | ToBezier - this operator is intended for conversion of the curves and surfaces of the all types into Bezier curves and surfaces. ToBezier.SurfaceMode - mode of conversion of the surfaces. ToBezier.Curve3dMode mode for conversion of the 3D curves. ToBezier.Curve2dMode mode for conversion of the 2D curves. ToBezier.MaxTolerance max possible tolerance on the resultant shape.
8 | FixShape this operator is intended for correction of the invalid shapes FixShape.Tolerance3d work tolerance for detection of the problems and correction of them. FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
9 | SameParameter this operator is intended for fixing edges having not same parameter 2D and 3D curves. SameParameter.Tolerance3d tolerance for detection and fix problems.

Dialog Box:

Example:

Shape before applying Shape Processing (FixShape operator).

The same shape after applying Shape Processing.

Suppress faces

Description: Suppresses a face of a shape.

Result: GEOM_Object (ListOfGeomShapes).

TUI Command: geompy.SuppressFaces(Shape, ListOfID), where Shape is a shape to be processed, ListOfID is a list of faces ID's to be removed.

Arguments: Name + Faces which should be removed (you can select them in the 3D viewer).

Dialog Box:

Example:

Close contour

Description : Closes an open contour and modifies the underlying face (if needed) in accordance with user specified mode:

- By common vertex a vertex is created between the end points of the contour and its tolerance is increased to a value of the gap between the ends of the contour;

- By new edge a new edge is inserted between the end points of the contour.

Result: GEOM_Object.

TUI Command: geompy.CloseContour(Shape, Wires, IsCommonVertex), where Shape is a shape to be processed, Wires is a list of edges or wires IDs which has to be closed within the shape (if the list contains only one element = -1, the shape itself is considered as a wire), IsCommonVertex if this parameter is True a closure has to be done by creation of a common vertex, otherwise an edge is added between the end vertices.

Arguments: Name + 1 shape + contour (Wire, or a set of Edges) + mode of closure (by vertex or by edge)

Dialog Box:

Example:

Suppress internal wires

Description : Removes all internal wires or specified internal wires from user specified faces.

Result: GEOM_Object.

TUI Command: geompy.SuppressInternalWires(Shape, Wires), where Shape is a shape where wires are to be removed, Wires is a list of wires IDs to be removed; if the list is empty then all internal wires are removed.

Arguments:

- Name of the resulting object

- User specified face

- User specified internal wires (lying on this face except for its boundary), or, in case the Remove all internal wires box is checked, all internal wires

Dialog Box:

Example:

Suppress holes

Description :

- 1st Constructor : Suppresses a hole in a shape.

- 2nd Constructor : Suppresses a hole in a face.

Result: GEOM_Object.

TUI Command: geompy.SuppressHoles(Shape, ListOfWireID), where Shape is a shape where holes must be removed, ListOfWireID is a list of wire sub shapes IDs. If it is empty, then all holes are removed.

Arguments: Name + 1 shape + Wires which should be removed.

Remove all holes checkbox allows to fill all holes of a definite shape.

Detect button allows to display the number of free boundaries in your shape:

Dialog Box:

Example:

Sewing

Description: Sew several shapes.

Result: GEOM_Object.

TUI Command : geompy.MakeSewing(ListOfShape, Precision), where ListOfShape is list of shapes to be sewed, Precision is a precision for sewing.

Arguments: Name + 1 or more shapes + 1 value (sew precision).

Detect button allows to display the number of free boundaries in your shape:

Dialog Box:

Example:

Add point on edge

Description: Splits an edge in two in accordance with the specified mode (by length or by parameter) and a value specifying the position of the point on edge (for example val =0.5; mode = Length).

Result: GEOM_Object.

TUI Command : geompy.DivideEdge(Shape, EdgeID, Value, IsByParameter), where Shape is a shape which contains an edge to be divided, EdgeID is the ID of the edge to be divided, if it = -1, then Shape is an edge, Value is a paramter on the edge or a length. IsByParameter if it is True then Value is the edge parameter in the range [0:1] otherwise it is a length of the edge in the range [0:1]

Arguments: Name + 1 Edge + 1 value setting the position of the point according one of the selected modes

Dialog Box:

Example:

Glue faces

Description: Glues faces that are coincident with respect to the given tolerance

value.

Result: GEOM_Object.

TUI Command : geompy.MakeGlueFaces(theShape, theTolerance), where theShape is a compound of shapesto be glued, theTolerance is a maximum distance between two faces, which can be considered as coincident.

Arguments: Name + 1 Compound + Tolerance value

Dialog Box:

Example:

Check free boundaries

Description: Detects wires and edges that correspond to the shape's boundary, and highlights it

Result: GEOM_Object.

TUI Command : (NoError, ClosedWires, OpenWires) = geompy.GetFreeBoundary(Shape), where Shape is a shape to be checked, NoError is false if an error occurred while checking free boundaries, ClosedWires is a list of closed free boundary wires, OpenWires is a list of open free boundary wires.

Arguments: Shape

Dialog Box:

Example: