@@ -41,6 +41,7 @@
|
||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||
#include <BRepBuilderAPI_MakeSolid.hxx>
|
||||
#include <BRepBuilderAPI_Sewing.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <ShapeBuild_ReShape.hxx>
|
||||
#include <ShapeFix_Face.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
@@ -566,6 +567,34 @@ FaceTypedCylinder& ModelRefine::getCylinderObject()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// TODO: change this version after occ fix. Freecad Mantis 1450
|
||||
#if OCC_VERSION_HEX <= 0x070000
|
||||
void collectSphericalEdges(const TopoDS_Shell &shell, TopTools_IndexedMapOfShape &map)
|
||||
{
|
||||
TopTools_IndexedDataMapOfShapeListOfShape edgeToFaceMap;
|
||||
TopExp::MapShapesAndAncestors(shell, TopAbs_EDGE, TopAbs_FACE, edgeToFaceMap);
|
||||
TopTools_IndexedMapOfShape edges;
|
||||
TopExp::MapShapes(shell, TopAbs_EDGE, edges);
|
||||
|
||||
for (int index = 1; index <= edges.Extent(); ++index)
|
||||
{
|
||||
const TopoDS_Edge ¤tEdge = TopoDS::Edge(edges.FindKey(index));
|
||||
const TopTools_ListOfShape &faceList = edgeToFaceMap.FindFromKey(currentEdge);
|
||||
TopTools_ListIteratorOfListOfShape faceListIt;
|
||||
for (faceListIt.Initialize(faceList); faceListIt.More(); faceListIt.Next())
|
||||
{
|
||||
const TopoDS_Face ¤tFace = TopoDS::Face(faceListIt.Value());
|
||||
BRepAdaptor_Surface surface(currentFace);
|
||||
if (surface.GetType() == GeomAbs_Sphere)
|
||||
{
|
||||
map.Add(currentEdge);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
FaceUniter::FaceUniter(const TopoDS_Shell &shellIn) : modifiedSignal(false)
|
||||
{
|
||||
workShell = shellIn;
|
||||
@@ -671,8 +700,14 @@ bool FaceUniter::process()
|
||||
for(sewIt = facesToSew.begin(); sewIt != facesToSew.end(); ++sewIt)
|
||||
builder.Add(workShell, *sewIt);
|
||||
}
|
||||
|
||||
BRepLib_FuseEdges edgeFuse(workShell, Standard_True);
|
||||
|
||||
BRepLib_FuseEdges edgeFuse(workShell);
|
||||
// TODO: change this version after occ fix. Freecad Mantis 1450
|
||||
#if OCC_VERSION_HEX <= 0x070000
|
||||
TopTools_IndexedMapOfShape map;
|
||||
collectSphericalEdges(workShell, map);
|
||||
edgeFuse.AvoidEdges(map);
|
||||
#endif
|
||||
TopTools_DataMapOfShapeShape affectedFaces;
|
||||
edgeFuse.Faces(affectedFaces);
|
||||
TopTools_DataMapIteratorOfDataMapOfShapeShape mapIt;
|
||||
|
||||
Reference in New Issue
Block a user