#include <Precision.hxx>
+#include <Basics_OCCTVersion.hxx>
+
IMPLEMENT_STANDARD_RTTIEXT(BlockFix_BlockFixAPI, Standard_Transient)
//=======================================================================
// faces unification
TopoDS_Shape aResult = myShape;
+#if OCC_VERSION_LARGE < 0x07050301
+ BlockFix_UnionFaces aFaceUnifier;
+ aFaceUnifier.GetTolerance() = myTolerance;
+ aFaceUnifier.GetOptimumNbFaces() = myOptimumNbFaces;
+ aResult = aFaceUnifier.Perform(aResult);
+#else
if (myOptimumNbFaces > 1) {
// use old algo BlockFix_UnionFaces for exactly given resulting number of faces
BlockFix_UnionFaces aFaceUnifier;
else {
// myOptimumNbFaces == -1 means do not union faces
}
+#endif
// avoid problem with degenerated edges appearance
// due to shape quality regress
aResult = RemLoc.GetResult();
// edges unification
- //BlockFix_UnionEdges anEdgeUnifier;
- //myShape = anEdgeUnifier.Perform(aResult,myTolerance);
+#if OCC_VERSION_LARGE < 0x07050301
+ BlockFix_UnionEdges anEdgeUnifier;
+ myShape = anEdgeUnifier.Perform(aResult,myTolerance);
+#else
ShapeUpgrade_UnifySameDomain Unifier;
Standard_Boolean isUnifyEdges = Standard_True;
Standard_Boolean isUnifyFaces = Standard_False; //only edges
Unifier.SetLinearTolerance(myTolerance);
Unifier.Build();
myShape = Unifier.Shape();
+#endif
TopoDS_Shape aRes = BlockFix::FixRanges(myShape,myTolerance);
myShape = aRes;
#include <Standard_TypeMismatch.hxx>
#include <Standard_ConstructionError.hxx>
+#include <Basics_OCCTVersion.hxx>
+
//=======================================================================
//function : GetID
//purpose :
Standard_NullObject::Raise("Null Shape given");
}
- //BlockFix_UnionFaces aFaceUnifier;
- //aFaceUnifier.GetOptimumNbFaces() = 0; // To force union faces.
- //aShape = aFaceUnifier.Perform(aBlockOrComp);
+#if OCC_VERSION_LARGE < 0x07050301
+ BlockFix_UnionFaces aFaceUnifier;
+ aFaceUnifier.GetOptimumNbFaces() = 0; // To force union faces.
+ aShape = aFaceUnifier.Perform(aBlockOrComp);
+#else
// Use OCCT algo ShapeUpgrade_UnifySameDomain instead of BlockFix_UnionFaces:
Standard_Boolean isUnifyEdges = Standard_False;
Standard_Boolean isUnifyFaces = Standard_True;
aUnifier.SetAngularTolerance(Precision::Confusion());
aUnifier.Build();
aShape = aUnifier.Shape();
+#endif
} else { // unknown function type
return 0;
}