1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0027117: BRepClass3d_SolidClassifier doesn't take into account vertex/edge/face tolerances

Various improvements in point-solid classifier:

1) Refactoring.
2) BndBoxTree is extracted into separate class.
3) UB-tree calculation is cashed to improve point-solid classification speed.
4) Ray / curve intersection improved by trimmed parameters and correct order.
5) Fixes in logic.
6) Calculation caching at the classifier level.

3D-claasifier now takes into the account the vertex/edges tolerances. If the given point lays inside the tolerance area of vertex or edge of the solid it's classified as TopAbs_ON.
The behavior of IntCurvesFace_Intersector::Perform was changed. Now it may use optional null-tolerance to classify 2d-point relatively to the given face.
UBTreeFiller is used to speedup intersection process between edges/vertices and the point.
The test case 'boolean gdml_private ZH2' extensively uses the SolidClassifier. After this fix it returns the correct classification statuses, which leads to incorrect result shape (reported by checkshape). Yet the result shape without this fix also seems to be incorrect (one of the isolines goes out of boundary of the face). Thats why it's marked with 'TODO'.

Corrections in test cases.

Test case is added.
This commit is contained in:
isn
2016-03-15 16:38:11 +03:00
committed by bugmaster
parent d658f27576
commit 58e14d59e7
14 changed files with 744 additions and 226 deletions

View File

@@ -29,6 +29,9 @@
#include <TopExp_Explorer.hxx>
#include <BRepClass3d_MapOfInter.hxx>
#include <TopAbs_State.hxx>
#include <BRepClass3d_BndBoxTree.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
class TopoDS_Shape;
class gp_Pnt;
class TopoDS_Face;
@@ -39,9 +42,8 @@ class gp_Lin;
class Bnd_Box;
class IntCurvesFace_Intersector;
//! Provide an exploration of a BRep Shape for the
//! classification.
//! Provide an exploration of a BRep Shape for the classification.
//! Provide access to the special UB tree to obtain fast search.
class BRepClass3d_SolidExplorer
{
public:
@@ -138,8 +140,15 @@ public:
Standard_EXPORT virtual void DumpSegment (const gp_Pnt& P, const gp_Lin& L, const Standard_Real Par, const TopAbs_State S) const;
Standard_EXPORT const Bnd_Box& Box() const;
Standard_EXPORT const TopoDS_Shape& GetShape() const;
Standard_EXPORT IntCurvesFace_Intersector& Intersector (const TopoDS_Face& F) const;
//! Return UB-tree instance which is used for edge / vertex checks.
const BRepClass3d_BndBoxTree& GetTree () {return myTree;}
//! Return edge/vertices map for current shape.
const TopTools_IndexedMapOfShape& GetMapEV () {return myMapEV;}
Standard_EXPORT void Destroy();
@@ -164,6 +173,8 @@ private:
TopExp_Explorer myShellExplorer;
TopExp_Explorer myFaceExplorer;
BRepClass3d_MapOfInter myMapOfInter;
BRepClass3d_BndBoxTree myTree;
TopTools_IndexedMapOfShape myMapEV;
};