mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0025937: Failed Cut Edge or Face by HalfSpace.
Addressing the causes of warnings. Test cases for issue CR25937
This commit is contained in:
@@ -25,13 +25,15 @@ class Context from IntTools
|
||||
|
||||
|
||||
uses
|
||||
|
||||
|
||||
Box from Bnd,
|
||||
Pnt2d from gp,
|
||||
Pnt from gp,
|
||||
State from TopAbs,
|
||||
Curve from Geom,
|
||||
ProjectPointOnCurve from GeomAPI,
|
||||
ProjectPointOnSurf from GeomAPI,
|
||||
Shape from TopoDS,
|
||||
Vertex from TopoDS,
|
||||
Face from TopoDS,
|
||||
Edge from TopoDS,
|
||||
@@ -300,7 +302,19 @@ is
|
||||
--- Returns false if projection algorithm failed
|
||||
--- other wiese returns true.
|
||||
---
|
||||
|
||||
BndBox(me:mutable;
|
||||
theS:Shape from TopoDS)
|
||||
returns Box from Bnd;
|
||||
---C++: return &
|
||||
--- Returns a reference to boundong box
|
||||
--- for given shape <theS>
|
||||
---
|
||||
IsInfiniteFace(me:mutable;
|
||||
theFace:Face from TopoDS)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns true if the solid <theFace> has
|
||||
-- infinite bounds
|
||||
|
||||
fields
|
||||
myAllocator : BaseAllocator from BOPCol is protected;
|
||||
myFClass2dMap:DataMapOfShapeAddress from BOPCol is protected;
|
||||
@@ -309,7 +323,8 @@ fields
|
||||
mySClassMap :DataMapOfShapeAddress from BOPCol is protected;
|
||||
myProjPTMap :DataMapOfTransientAddress from BOPCol is protected;
|
||||
myHatcherMap :DataMapOfShapeAddress from BOPCol is protected;
|
||||
myProjSDataMap:DataMapOfShapeAddress from BOPCol is protected;
|
||||
myProjSDataMap:DataMapOfShapeAddress from BOPCol is protected;
|
||||
myBndBoxDataMap:DataMapOfShapeAddress from BOPCol is protected;
|
||||
myCreateFlag :Integer from Standard is protected;
|
||||
|
||||
end Context;
|
||||
|
@@ -31,6 +31,7 @@
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRepBndLib.hxx>
|
||||
|
||||
#include <IntTools_Tools.hxx>
|
||||
#include <IntTools_FClass2d.hxx>
|
||||
@@ -56,6 +57,7 @@ IntTools_Context::IntTools_Context()
|
||||
myProjPTMap(100, myAllocator),
|
||||
myHatcherMap(100, myAllocator),
|
||||
myProjSDataMap(100, myAllocator),
|
||||
myBndBoxDataMap(100, myAllocator),
|
||||
myCreateFlag(0)
|
||||
{
|
||||
}
|
||||
@@ -74,6 +76,7 @@ IntTools_Context::IntTools_Context
|
||||
myProjPTMap(100, myAllocator),
|
||||
myHatcherMap(100, myAllocator),
|
||||
myProjSDataMap(100, myAllocator),
|
||||
myBndBoxDataMap(100, myAllocator),
|
||||
myCreateFlag(1)
|
||||
{
|
||||
}
|
||||
@@ -158,6 +161,69 @@ IntTools_Context::~IntTools_Context()
|
||||
myAllocator->Free(anAdr);
|
||||
}
|
||||
myProjSDataMap.Clear();
|
||||
//
|
||||
Bnd_Box* pBox;
|
||||
aIt.Initialize(myBndBoxDataMap);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
anAdr=aIt.Value();
|
||||
pBox=(Bnd_Box*)anAdr;
|
||||
(*pBox).~Bnd_Box();
|
||||
myAllocator->Free(anAdr);
|
||||
}
|
||||
myBndBoxDataMap.Clear();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : BndBox
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Bnd_Box& IntTools_Context::BndBox(const TopoDS_Shape& aS)
|
||||
{
|
||||
Standard_Address anAdr;
|
||||
Bnd_Box* pBox;
|
||||
//
|
||||
if (!myBndBoxDataMap.IsBound(aS)) {
|
||||
//
|
||||
pBox=(Bnd_Box*)myAllocator->Allocate(sizeof(Bnd_Box));
|
||||
new (pBox) Bnd_Box();
|
||||
//
|
||||
Bnd_Box &aBox=*pBox;
|
||||
BRepBndLib::Add(aS, aBox);
|
||||
//
|
||||
anAdr=(Standard_Address)pBox;
|
||||
myBndBoxDataMap.Bind(aS, anAdr);
|
||||
}
|
||||
else {
|
||||
anAdr=myBndBoxDataMap.Find(aS);
|
||||
pBox=(Bnd_Box*)anAdr;
|
||||
}
|
||||
return *pBox;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsInfiniteFace
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean IntTools_Context::IsInfiniteFace
|
||||
(const TopoDS_Face& aFace)
|
||||
{
|
||||
Standard_Boolean bRet;
|
||||
Standard_Integer i;
|
||||
Standard_Real aX[6];
|
||||
//
|
||||
bRet=Standard_False;
|
||||
//
|
||||
if (!BRep_Tool::NaturalRestriction(aFace)) {
|
||||
return bRet;
|
||||
}
|
||||
//
|
||||
Bnd_Box& aBox=BndBox(aFace);
|
||||
//
|
||||
aBox.Get(aX[0], aX[1], aX[2], aX[3], aX[4], aX[5]);
|
||||
//
|
||||
for (i=0; (i<6) && (!bRet); ++i) {
|
||||
bRet=Precision::IsInfinite(aX[i]);
|
||||
}
|
||||
//
|
||||
return bRet;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : FClass2d
|
||||
|
Reference in New Issue
Block a user