mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-04-12 16:47:26 +05:00
0021835: EDF 2070 GEOM : Problem with detecting Self-intersections
This commit is contained in:
parent
8fe997ae88
commit
6ddc7178e6
@ -27,6 +27,7 @@
|
|||||||
#include <Standard_Version.hxx>
|
#include <Standard_Version.hxx>
|
||||||
|
|
||||||
#include <NMTTools_PaveFiller.hxx>
|
#include <NMTTools_PaveFiller.hxx>
|
||||||
|
#include <NMTTools_Tools.hxx>
|
||||||
|
|
||||||
#include <Basics_OCCTVersion.hxx>
|
#include <Basics_OCCTVersion.hxx>
|
||||||
|
|
||||||
@ -117,7 +118,7 @@ void NMTTools_PaveFiller::PerformVE()
|
|||||||
}
|
}
|
||||||
// Edge
|
// Edge
|
||||||
aE2=TopoDS::Edge(myDS->Shape(aWith));
|
aE2=TopoDS::Edge(myDS->Shape(aWith));
|
||||||
if (BRep_Tool::Degenerated(aE2)){
|
if (NMTTools_Tools::IsDegenerated(aE2)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Vertex
|
// Vertex
|
||||||
@ -221,7 +222,7 @@ void NMTTools_PaveFiller::PrepareEdges()
|
|||||||
if (myDS->GetShapeType(i)==TopAbs_EDGE) {
|
if (myDS->GetShapeType(i)==TopAbs_EDGE) {
|
||||||
aE=TopoDS::Edge(myDS->Shape(i));
|
aE=TopoDS::Edge(myDS->Shape(i));
|
||||||
//
|
//
|
||||||
if (BRep_Tool::Degenerated(aE)){
|
if (NMTTools_Tools::IsDegenerated(aE)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
// Author: Peter KURNEV
|
// Author: Peter KURNEV
|
||||||
|
|
||||||
#include <NMTTools_PaveFiller.hxx>
|
#include <NMTTools_PaveFiller.hxx>
|
||||||
|
#include <NMTTools_Tools.hxx>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
@ -184,7 +185,8 @@ void NMTTools_PaveFiller::PerformEE()
|
|||||||
const TopoDS_Edge aE1=TopoDS::Edge(myDS->Shape(nE1));//mpv
|
const TopoDS_Edge aE1=TopoDS::Edge(myDS->Shape(nE1));//mpv
|
||||||
const TopoDS_Edge aE2=TopoDS::Edge(myDS->Shape(nE2));//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;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@ -955,7 +957,7 @@ void NMTTools_PaveFiller::PreparePaveBlocks(const Standard_Integer nE)
|
|||||||
BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
|
BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
|
||||||
// Edge
|
// Edge
|
||||||
aE=TopoDS::Edge(myDS->Shape(nE));
|
aE=TopoDS::Edge(myDS->Shape(nE));
|
||||||
if (BRep_Tool::Degenerated(aE)) {
|
if (NMTTools_Tools::IsDegenerated(aE)) {
|
||||||
myIsDone=Standard_True;
|
myIsDone=Standard_True;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -74,6 +74,7 @@
|
|||||||
#include <BOPTools_ESInterference.hxx>
|
#include <BOPTools_ESInterference.hxx>
|
||||||
#include <BOPTools_IDMapOfPaveBlockIMapOfInteger.hxx>
|
#include <BOPTools_IDMapOfPaveBlockIMapOfInteger.hxx>
|
||||||
#include <BOPTools_IMapOfPaveBlock.hxx>
|
#include <BOPTools_IMapOfPaveBlock.hxx>
|
||||||
|
#include <BRepTools.hxx>
|
||||||
|
|
||||||
#include <NMTDS_ShapesDataStructure.hxx>
|
#include <NMTDS_ShapesDataStructure.hxx>
|
||||||
#include <NMTDS_Iterator.hxx>
|
#include <NMTDS_Iterator.hxx>
|
||||||
@ -84,6 +85,7 @@
|
|||||||
#include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
|
#include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
|
||||||
#include <NMTTools_CommonBlockAPI.hxx>
|
#include <NMTTools_CommonBlockAPI.hxx>
|
||||||
#include <NMTTools_ListOfCommonBlock.hxx>
|
#include <NMTTools_ListOfCommonBlock.hxx>
|
||||||
|
#include <NMTTools_Tools.hxx>
|
||||||
|
|
||||||
|
|
||||||
static
|
static
|
||||||
@ -146,7 +148,7 @@ static
|
|||||||
//
|
//
|
||||||
// Edge
|
// Edge
|
||||||
const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE));
|
const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE));
|
||||||
if (BRep_Tool::Degenerated(aE)){
|
if (NMTTools_Tools::IsDegenerated(aE)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@ -199,6 +201,8 @@ static
|
|||||||
BOPTools_Tools::CorrectRange(aE, aF, aSR, anewSR);
|
BOPTools_Tools::CorrectRange(aE, aF, aSR, anewSR);
|
||||||
aEF.SetRange (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();
|
aEF.Perform();
|
||||||
//
|
//
|
||||||
if (aEF.IsDone()) {
|
if (aEF.IsDone()) {
|
||||||
|
@ -782,7 +782,7 @@ void NMTTools_PaveFiller::MakePCurves()
|
|||||||
}
|
}
|
||||||
const TopoDS_Edge& aE=TopoDS::Edge(aS);
|
const TopoDS_Edge& aE=TopoDS::Edge(aS);
|
||||||
//
|
//
|
||||||
if (BRep_Tool::Degenerated(aE)) {
|
if (NMTTools_Tools::IsDegenerated(aE)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
// Author: Peter KURNEV
|
// Author: Peter KURNEV
|
||||||
|
|
||||||
#include <NMTTools_PaveFiller.hxx>
|
#include <NMTTools_PaveFiller.hxx>
|
||||||
|
#include <NMTTools_Tools.hxx>
|
||||||
|
|
||||||
#include <Bnd_HArray1OfBox.hxx>
|
#include <Bnd_HArray1OfBox.hxx>
|
||||||
#include <Bnd_BoundSortBox.hxx>
|
#include <Bnd_BoundSortBox.hxx>
|
||||||
@ -108,7 +109,7 @@ void NMTTools_PaveFiller::MakeSplitEdges()
|
|||||||
//
|
//
|
||||||
// Original Edge
|
// Original Edge
|
||||||
aE=TopoDS::Edge(myDS->Shape(i));
|
aE=TopoDS::Edge(myDS->Shape(i));
|
||||||
if (BRep_Tool::Degenerated(aE)){
|
if (NMTTools_Tools::IsDegenerated(aE)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@ -198,7 +199,7 @@ void NMTTools_PaveFiller::UpdateCommonBlocks(const Standard_Integer)
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
const TopoDS_Edge& aE=*((TopoDS_Edge*)&myDS->Shape(nE));
|
const TopoDS_Edge& aE=*((TopoDS_Edge*)&myDS->Shape(nE));
|
||||||
if (BRep_Tool::Degenerated(aE)){
|
if (NMTTools_Tools::IsDegenerated(aE)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@ -371,7 +372,7 @@ void NMTTools_PaveFiller::UpdateCommonBlocks()
|
|||||||
if (myDS->GetShapeType(nE)!=TopAbs_EDGE){
|
if (myDS->GetShapeType(nE)!=TopAbs_EDGE){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (BRep_Tool::Degenerated(TopoDS::Edge(myDS->Shape(nE)))){
|
if (NMTTools_Tools::IsDegenerated(TopoDS::Edge(myDS->Shape(nE)))){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@ -489,7 +490,7 @@ void NMTTools_PaveFiller::UpdatePaveBlocks()
|
|||||||
for(; aExp.More(); aExp.Next()) {
|
for(; aExp.More(); aExp.Next()) {
|
||||||
aE=TopoDS::Edge(aExp.Current());
|
aE=TopoDS::Edge(aExp.Current());
|
||||||
//
|
//
|
||||||
if (BRep_Tool::Degenerated(aE)) {
|
if (NMTTools_Tools::IsDegenerated(aE)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
@ -73,6 +73,7 @@
|
|||||||
#include <TopTools_MapOfShape.hxx>
|
#include <TopTools_MapOfShape.hxx>
|
||||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||||
#include <TopoDS_Iterator.hxx>
|
#include <TopoDS_Iterator.hxx>
|
||||||
|
#include <Precision.hxx>
|
||||||
|
|
||||||
static
|
static
|
||||||
void ProcessBlock(const Standard_Integer iV,
|
void ProcessBlock(const Standard_Integer iV,
|
||||||
@ -612,3 +613,39 @@ void ProcessBlock(const TopoDS_Shape& aF,
|
|||||||
ProcessBlock(aFx, aMCV, aProcessed, aChain);
|
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;
|
||||||
|
}
|
||||||
|
@ -95,5 +95,8 @@ class NMTTools_Tools {
|
|||||||
static void UpdateEdge(const TopoDS_Edge& aE,
|
static void UpdateEdge(const TopoDS_Edge& aE,
|
||||||
const Standard_Real aTol) ;
|
const Standard_Real aTol) ;
|
||||||
|
|
||||||
|
Standard_EXPORT
|
||||||
|
static Standard_Boolean IsDegenerated(const TopoDS_Edge &theEdge);
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user