#include <Standard_Version.hxx>
#include <NMTTools_PaveFiller.hxx>
+#include <NMTTools_Tools.hxx>
#include <Basics_OCCTVersion.hxx>
}
// Edge
aE2=TopoDS::Edge(myDS->Shape(aWith));
- if (BRep_Tool::Degenerated(aE2)){
+ if (NMTTools_Tools::IsDegenerated(aE2)){
continue;
}
// Vertex
if (myDS->GetShapeType(i)==TopAbs_EDGE) {
aE=TopoDS::Edge(myDS->Shape(i));
//
- if (BRep_Tool::Degenerated(aE)){
+ if (NMTTools_Tools::IsDegenerated(aE)){
continue;
}
//
// Author: Peter KURNEV
#include <NMTTools_PaveFiller.hxx>
+#include <NMTTools_Tools.hxx>
#include <stdio.h>
#include <Precision.hxx>
const TopoDS_Edge aE1=TopoDS::Edge(myDS->Shape(nE1));//mpv
const TopoDS_Edge aE2=TopoDS::Edge(myDS->Shape(nE2));//mpv
//
- if (BRep_Tool::Degenerated(aE1) || BRep_Tool::Degenerated(aE2)){
+ if (NMTTools_Tools::IsDegenerated(aE1) ||
+ NMTTools_Tools::IsDegenerated(aE2)){
continue;
}
//
BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
// Edge
aE=TopoDS::Edge(myDS->Shape(nE));
- if (BRep_Tool::Degenerated(aE)) {
+ if (NMTTools_Tools::IsDegenerated(aE)) {
myIsDone=Standard_True;
return;
}
#include <BOPTools_ESInterference.hxx>
#include <BOPTools_IDMapOfPaveBlockIMapOfInteger.hxx>
#include <BOPTools_IMapOfPaveBlock.hxx>
+#include <BRepTools.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTDS_Iterator.hxx>
#include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
#include <NMTTools_CommonBlockAPI.hxx>
#include <NMTTools_ListOfCommonBlock.hxx>
+#include <NMTTools_Tools.hxx>
static
//
// Edge
const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE));
- if (BRep_Tool::Degenerated(aE)){
+ if (NMTTools_Tools::IsDegenerated(aE)){
continue;
}
//
BOPTools_Tools::CorrectRange(aE, aF, aSR, anewSR);
aEF.SetRange (anewSR);
//
+ BRepTools::Write(aE, "/dn20/salome/skv/SALOME/scripts/Dumps/edge");
+ BRepTools::Write(aF, "/dn20/salome/skv/SALOME/scripts/Dumps/face");
aEF.Perform();
//
if (aEF.IsDone()) {
}
const TopoDS_Edge& aE=TopoDS::Edge(aS);
//
- if (BRep_Tool::Degenerated(aE)) {
+ if (NMTTools_Tools::IsDegenerated(aE)) {
continue;
}
//
// Author: Peter KURNEV
#include <NMTTools_PaveFiller.hxx>
+#include <NMTTools_Tools.hxx>
#include <Bnd_HArray1OfBox.hxx>
#include <Bnd_BoundSortBox.hxx>
//
// Original Edge
aE=TopoDS::Edge(myDS->Shape(i));
- if (BRep_Tool::Degenerated(aE)){
+ if (NMTTools_Tools::IsDegenerated(aE)){
continue;
}
//
}
//
const TopoDS_Edge& aE=*((TopoDS_Edge*)&myDS->Shape(nE));
- if (BRep_Tool::Degenerated(aE)){
+ if (NMTTools_Tools::IsDegenerated(aE)){
continue;
}
//
if (myDS->GetShapeType(nE)!=TopAbs_EDGE){
continue;
}
- if (BRep_Tool::Degenerated(TopoDS::Edge(myDS->Shape(nE)))){
+ if (NMTTools_Tools::IsDegenerated(TopoDS::Edge(myDS->Shape(nE)))){
continue;
}
//
for(; aExp.More(); aExp.Next()) {
aE=TopoDS::Edge(aExp.Current());
//
- if (BRep_Tool::Degenerated(aE)) {
+ if (NMTTools_Tools::IsDegenerated(aE)) {
continue;
}
//
#include <TopTools_MapOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopoDS_Iterator.hxx>
+#include <Precision.hxx>
static
void ProcessBlock(const Standard_Integer iV,
ProcessBlock(aFx, aMCV, aProcessed, aChain);
}
}
+
+//=======================================================================
+// function: IsDegenerated
+// purpose :
+//=======================================================================
+Standard_Boolean NMTTools_Tools::IsDegenerated(const TopoDS_Edge &theEdge)
+{
+ Standard_Boolean aResult = BRep_Tool::Degenerated(theEdge);
+
+ if (!aResult) {
+ // Check if there is a null-length 3d curve.
+ Standard_Real aF;
+ Standard_Real aL;
+ Handle(Geom_Curve) aCrv = BRep_Tool::Curve(theEdge, aF, aL);
+
+ aResult = aCrv.IsNull();
+
+ if (!aResult) {
+ const Standard_Real aTolConf2 =
+ Precision::Confusion()*Precision::Confusion();
+ gp_Pnt aPnt[2] = { aCrv->Value(aF), aCrv->Value(aL) };
+
+ if (aPnt[0].SquareDistance(aPnt[1]) <= aTolConf2) {
+ // Check the middle point.
+ const gp_Pnt aPMid = aCrv->Value(0.5*(aF + aL));
+
+ if (aPnt[0].SquareDistance(aPMid) <= aTolConf2) {
+ // 3D curve is degenerated.
+ aResult = Standard_True;
+ }
+ }
+ }
+ }
+
+ return aResult;
+}
static void UpdateEdge(const TopoDS_Edge& aE,
const Standard_Real aTol) ;
+ Standard_EXPORT
+ static Standard_Boolean IsDegenerated(const TopoDS_Edge &theEdge);
+
};
#endif