
Thu, 11/23/2017 - 17:56
Forums:
Hi,
I'm trying to make a fuse boolean operation (Fuse) between 2 boxes.
OdDbEntityPtr MdModelisationTools::booleanFuse(QList<OdDbEntityPtr> &qlEntity)
{
OdDbEntityPtr pEntRet;
TopoDS_Shape fusedShape;
try
{
int iCount = qlEntity.size();
for(int i = 0; i < iCount; i++)
{
OdDbEntityPtr pEntity = qlEntity[i];
TopoDS_Shape pTempShape = MdOCCACIS::entityToTopoDS_Shape(pEntity);
if(!pTempShape.IsNull())
{
if(!fusedShape.IsNull())
{
fusedShape = BRepAlgoAPI_Fuse(fusedShape, pTempShape);
if(!fusedShape.IsNull())
{
BRepTools::Update(fusedShape);
}
}
else
{
fusedShape = pTempShape;
}
}
else
{
// ne pas traiter
qlEntity.removeAll(pEntity);
i--;
iCount--;
}
}
if(!fusedShape.IsNull())
{
// conversion en solid ODA
pEntRet = MdOCCACIS::entityFromOCCShape(fusedShape);
}
}
catch(Standard_Failure &failure)
{
MdCoreApplication::Instance()->getPrompt()->writeError(failure.GetMessageString());
}
return pEntRet;
}
My mistake is the result object has useless edges (see image).
What I do wrong ?
thanks.
Attachments:
Wed, 12/27/2017 - 09:58
You need to apply ShapeUpgrade_UnifySameDomain to the result of Boolean operation. It should remove the "useless edges".