+ handle special case when removing splitter of a shell
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5245 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
parent
412e25dff1
commit
a7753882d7
|
@ -44,6 +44,7 @@
|
|||
#include <BRepClass_FaceClassifier.hxx>
|
||||
|
||||
#include <BRepTools.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include "modelRefine.h"
|
||||
|
||||
using namespace ModelRefine;
|
||||
|
@ -594,14 +595,33 @@ bool FaceUniter::process()
|
|||
if (facesToSew.size() > 0)
|
||||
{
|
||||
workShell = ModelRefine::removeFaces(workShell, facesToRemove);
|
||||
TopExp_Explorer xp;
|
||||
bool emptyShell = true;
|
||||
for (xp.Init(workShell, TopAbs_FACE); xp.More(); xp.Next())
|
||||
{
|
||||
emptyShell = false;
|
||||
break;
|
||||
}
|
||||
|
||||
BRepBuilderAPI_Sewing sew;
|
||||
sew.Add(workShell);
|
||||
FaceVectorType::iterator sewIt;
|
||||
for(sewIt = facesToSew.begin(); sewIt != facesToSew.end(); ++sewIt)
|
||||
sew.Add(*sewIt);
|
||||
sew.Perform();
|
||||
workShell = TopoDS::Shell(sew.SewedShape());
|
||||
if (!emptyShell || facesToSew.size() > 1)
|
||||
{
|
||||
BRepBuilderAPI_Sewing sew;
|
||||
sew.Add(workShell);
|
||||
FaceVectorType::iterator sewIt;
|
||||
for(sewIt = facesToSew.begin(); sewIt != facesToSew.end(); ++sewIt)
|
||||
sew.Add(*sewIt);
|
||||
sew.Perform();
|
||||
workShell = TopoDS::Shell(sew.SewedShape());
|
||||
}
|
||||
else
|
||||
{
|
||||
// workShell has no more faces and we add exactly one face
|
||||
BRep_Builder builder;
|
||||
builder.MakeShell(workShell);
|
||||
FaceVectorType::iterator sewIt;
|
||||
for(sewIt = facesToSew.begin(); sewIt != facesToSew.end(); ++sewIt)
|
||||
builder.Add(workShell, *sewIt);
|
||||
}
|
||||
|
||||
BRepLib_FuseEdges edgeFuse(workShell, true);
|
||||
workShell = TopoDS::Shell(edgeFuse.Shape());
|
||||
|
|
Loading…
Reference in New Issue
Block a user