\n This operation removes all seam and degenerated edges from a given
shape. Its main purpose is healing of solids and compounds to obtain
hexahedral solids and compounds of hexahedral solids.
-At the same time, it has an option to unite all faces, sharing one
-surface. With this option not only hexahedral solids could be obtained.
+However, there is an option to unite all faces sharing one
+surface, which produces not only hexahedral solids.
-\n <b>TUI Command:</b> <em>geompy.RemoveExtraEdges(theShape,theOptimumNbFaces)</em>,
-there <em>theShape</em> is a compound or a single solid to remove irregular edges from
-and <em>theOptimumNbFaces</em> is an integer parameter, that regulates,
-whether the faces, sharing common surface, should be united, or not.
+\n <b>TUI Command:</b> <em>geompy.RemoveExtraEdges(theShape,doUnionFaces)</em>,
+where <em>theShape</em> is a compound or a single solid
+and <em>doUnionFaces</em> is a boolean parameter, that regulates,
+whether the faces, sharing a common surface, should be united.
\n <b>Arguments:</b> Name + one shape + a flag.
\n <b>Advanced option:</b>
\ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
-using namespace std;
-
//=============================================================================
/*!
* constructor:
//=============================================================================
Standard_Boolean GEOMImpl_IBlocksOperations::CheckCompoundOfBlocksOld
(Handle(GEOM_Object) theCompound,
- list<BCError>& theErrors)
+ std::list<BCError>& theErrors)
{
SetErrorCode(KO);
//=============================================================================
TCollection_AsciiString GEOMImpl_IBlocksOperations::PrintBCErrors
(Handle(GEOM_Object) theCompound,
- const list<BCError>& theErrors)
+ const std::list<BCError>& theErrors)
{
TCollection_AsciiString aDescr;
- list<BCError>::const_iterator errIt = theErrors.begin();
+ std::list<BCError>::const_iterator errIt = theErrors.begin();
int i = 0;
for (; errIt != theErrors.end(); i++, errIt++) {
BCError errStruct = *errIt;
break;
}
- list<int> sshList = errStruct.incriminated;
- list<int>::iterator sshIt = sshList.begin();
+ std::list<int> sshList = errStruct.incriminated;
+ std::list<int>::iterator sshIt = sshList.begin();
int jj = 0;
for (; sshIt != sshList.end(); jj++, sshIt++) {
if (jj > 0)
//=============================================================================
Standard_Boolean GEOMImpl_IBlocksOperations::CheckCompoundOfBlocks
(Handle(GEOM_Object) theCompound,
- list<BCError>& theErrors)
+ std::list<BCError>& theErrors)
{
SetErrorCode(KO);
}
// 3. Find not glued blocks
- GEOMAlgo_GlueAnalyser aGD;
+ GEOMAlgo_GlueAnalyser aGD;
aGD.SetShape(aComp);
aGD.SetTolerance(Precision::Confusion());
}
//Make a Python command
- GEOM::TPythonDump(aFunction) << aCopy
- << " = geompy.RemoveExtraEdges(" << theObject
- << ", " << theOptimumNbFaces << ")";
+ std::string doUnionFaces = (theOptimumNbFaces < 0) ? "False" : "True";
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.RemoveExtraEdges("
+ << theObject << ", " << doUnionFaces.data() << ")";
SetErrorCode(OK);
return aCopy;
Shell_1 = geompy.MakeShell([Face_1, Rotation_1, Rotation_2, Rotation_3, Rotation_4, Rotation_5])
Solid_1 = geompy.MakeSolid([Shell_1])
- NoExtraEdges_1 = geompy.RemoveExtraEdges(Solid_1, 0)
+ NoExtraEdges_1 = geompy.RemoveExtraEdges(Solid_1, True) # doUnionFaces = True
geompy.addToStudy(Shell_1, "Shell_1")
geompy.addToStudy(Solid_1, "Solid_1")
geompy.addToStudy(NoExtraEdges_1, "NoExtraEdges_1")
- # RemoveExtraEdges
+ # RemoveExtraEdges (by default, doUnionFaces = False)
freeFacesWithoutExtra = geompy.RemoveExtraEdges(freeFaces)
geompy.addToStudy(freeFacesWithoutExtra, "freeFacesWithoutExtra")
v_y, Loc, geompy.GEOM.ST_ON)
for edge_i in edges_on_pln:
geompy.addToStudy(edge_i, "Edge on Plane (N = (0, -1, 0) & Location = (0, -50, 0)")
-
+
# GetShapesOnPlaneWithLocationIDs
edges_on_pln_ids = geompy.GetShapesOnPlaneWithLocationIDs(
blocksComp, geompy.ShapeType["EDGE"], v_y, Loc, geompy.GEOM.ST_ON)
anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
return anObj
-
+
## Create a tangent plane to specified face in the point with specified parameters.
# @param theFace - face for which tangent plane shuold be built.
# @param theParameterU - value of parameter by U
anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
return anObj
-
+
## Create a vector with the given components.
# @param theDX X component of the vector.
# Unite faces and edges, sharing one surface. It means that
# this faces must have references to one C++ surface object (handle).
# @param theShape The compound or single solid to remove irregular edges from.
- # @param theOptimumNbFaces If more than zero, unite faces only for those solids,
- # that have more than theOptimumNbFaces faces. If zero, unite faces always,
- # regardsless their quantity in the solid. If negative (the default value),
- # do not unite faces at all. For blocks repairing recommended value is 6.
+ # @param doUnionFaces If True, then unite faces. If False (the default value),
+ # do not unite faces.
# @return Improved shape.
#
# @ref swig_RemoveExtraEdges "Example"
- def RemoveExtraEdges(self,theShape,theOptimumNbFaces=-1):
+ def RemoveExtraEdges(self, theShape, doUnionFaces=False):
# Example: see GEOM_TestOthers.py
- anObj = self.BlocksOp.RemoveExtraEdges(theShape,theOptimumNbFaces)
+ nbFacesOptimum = -1 # -1 means do not unite faces
+ if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
+ anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
return anObj