mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0026609: Wrong result obtained by solid classifier algorithm.
Test case for issue CR26609 Correction of test cases for issue CR26609
This commit is contained in:
parent
b4b2ecca89
commit
a0258acdd2
@ -247,13 +247,23 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
|
|||||||
Standard_Real v,dv = (V2-V1)/6.0;
|
Standard_Real v,dv = (V2-V1)/6.0;
|
||||||
if(du<1e-12) du=1e-12;
|
if(du<1e-12) du=1e-12;
|
||||||
if(dv<1e-12) dv=1e-12;
|
if(dv<1e-12) dv=1e-12;
|
||||||
|
Standard_Boolean IsNotUper = !surf->IsUPeriodic(), IsNotVper = !surf->IsVPeriodic();
|
||||||
Standard_Integer NbPntCalc=0;
|
Standard_Integer NbPntCalc=0;
|
||||||
if(myMapOfInter.IsBound(Face)) {
|
if(myMapOfInter.IsBound(Face)) {
|
||||||
void *ptr = (void*)(myMapOfInter.Find(Face));
|
void *ptr = (void*)(myMapOfInter.Find(Face));
|
||||||
|
Standard_Boolean IsInside = Standard_True;
|
||||||
|
if(IsNotUper)
|
||||||
|
{
|
||||||
|
IsInside = (u_ >= U1) && (u_ <= U2);
|
||||||
|
}
|
||||||
|
if(IsNotVper)
|
||||||
|
{
|
||||||
|
IsInside &= (v_ >= V1) && (v_ <= V2);
|
||||||
|
}
|
||||||
if(ptr) {
|
if(ptr) {
|
||||||
const IntCurvesFace_Intersector& TheIntersector = (*((IntCurvesFace_Intersector *)ptr));
|
const IntCurvesFace_Intersector& TheIntersector = (*((IntCurvesFace_Intersector *)ptr));
|
||||||
// Check if the point is already in the face
|
// Check if the point is already in the face
|
||||||
if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u_,v_))==TopAbs_IN) {
|
if(IsInside && (TheIntersector.ClassifyUVPoint(gp_Pnt2d(u_,v_))==TopAbs_IN)) {
|
||||||
gp_Pnt aPnt;
|
gp_Pnt aPnt;
|
||||||
surf->D1(u_, v_, aPnt, theVecD1U, theVecD1V);
|
surf->D1(u_, v_, aPnt, theVecD1U, theVecD1V);
|
||||||
if (aPnt.SquareDistance(APoint_) < Precision::Confusion() * Precision::Confusion())
|
if (aPnt.SquareDistance(APoint_) < Precision::Confusion() * Precision::Confusion())
|
||||||
@ -429,6 +439,8 @@ Standard_Integer BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P,
|
|||||||
Standard_Integer IndexPoint=0;
|
Standard_Integer IndexPoint=0;
|
||||||
Standard_Integer NbPointsOK=0;
|
Standard_Integer NbPointsOK=0;
|
||||||
Standard_Integer NbFacesInSolid=0;
|
Standard_Integer NbFacesInSolid=0;
|
||||||
|
Standard_Boolean aRestr = Standard_True;
|
||||||
|
Standard_Boolean aTestInvert = Standard_False;
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
myFirstFace++;
|
myFirstFace++;
|
||||||
@ -436,6 +448,7 @@ Standard_Integer BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P,
|
|||||||
// look for point on face starting from myFirstFace
|
// look for point on face starting from myFirstFace
|
||||||
// Modified by skv - Thu Sep 4 14:31:12 2003 OCC578 Begin
|
// Modified by skv - Thu Sep 4 14:31:12 2003 OCC578 Begin
|
||||||
// while (faceexplorer.More()) {
|
// while (faceexplorer.More()) {
|
||||||
|
NbFacesInSolid = 0;
|
||||||
for (; faceexplorer.More(); faceexplorer.Next()) {
|
for (; faceexplorer.More(); faceexplorer.Next()) {
|
||||||
// Modified by skv - Thu Sep 4 14:31:12 2003 OCC578 End
|
// Modified by skv - Thu Sep 4 14:31:12 2003 OCC578 End
|
||||||
NbFacesInSolid++;
|
NbFacesInSolid++;
|
||||||
@ -443,7 +456,26 @@ Standard_Integer BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P,
|
|||||||
face = TopoDS::Face(faceexplorer.Current());
|
face = TopoDS::Face(faceexplorer.Current());
|
||||||
|
|
||||||
Handle(BRepAdaptor_HSurface) surf = new BRepAdaptor_HSurface();
|
Handle(BRepAdaptor_HSurface) surf = new BRepAdaptor_HSurface();
|
||||||
surf->ChangeSurface().Initialize(face);
|
if(aTestInvert)
|
||||||
|
{
|
||||||
|
BRepTopAdaptor_FClass2d aClass(face, Precision::Confusion());
|
||||||
|
if(aClass.PerformInfinitePoint() == TopAbs_IN)
|
||||||
|
{
|
||||||
|
aRestr = Standard_False;
|
||||||
|
if(myMapOfInter.IsBound(face))
|
||||||
|
{
|
||||||
|
myMapOfInter.UnBind(face);
|
||||||
|
void *ptr = (void *)(new IntCurvesFace_Intersector(face, Precision::Confusion(),
|
||||||
|
aRestr));
|
||||||
|
myMapOfInter.Bind(face,ptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
aRestr = Standard_True;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
surf->ChangeSurface().Initialize(face, aRestr);
|
||||||
Standard_Real U1,V1,U2,V2;
|
Standard_Real U1,V1,U2,V2;
|
||||||
U1 = surf->FirstUParameter();
|
U1 = surf->FirstUParameter();
|
||||||
V1 = surf->FirstVParameter();
|
V1 = surf->FirstVParameter();
|
||||||
@ -452,7 +484,10 @@ Standard_Integer BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P,
|
|||||||
face.Orientation(TopAbs_FORWARD);
|
face.Orientation(TopAbs_FORWARD);
|
||||||
//
|
//
|
||||||
//avoid process faces from uncorrected shells
|
//avoid process faces from uncorrected shells
|
||||||
if( Abs (U2 - U1) < 1.e-12 || Abs(V2 - V1) < 1.e-12) {
|
const Standard_Real eps = Precision::PConfusion();
|
||||||
|
Standard_Real epsU = Max(eps * Max(Abs(U2), Abs(U1)), eps);
|
||||||
|
Standard_Real epsV = Max(eps * Max(Abs(V2), Abs(V1)), eps);
|
||||||
|
if( Abs (U2 - U1) < epsU || Abs(V2 - V1) < epsV) {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@ -622,6 +657,7 @@ Standard_Integer BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
aTestInvert = Standard_True;
|
||||||
} //-- for(;;) { ... }
|
} //-- for(;;) { ... }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,8 @@ GeomAbs_SurfaceType IntCurvesFace_Intersector::SurfaceType() const
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
IntCurvesFace_Intersector::IntCurvesFace_Intersector(const TopoDS_Face& Face,
|
IntCurvesFace_Intersector::IntCurvesFace_Intersector(const TopoDS_Face& Face,
|
||||||
const Standard_Real aTol)
|
const Standard_Real aTol,
|
||||||
|
const Standard_Boolean aRestr)
|
||||||
:
|
:
|
||||||
Tol(aTol),
|
Tol(aTol),
|
||||||
done(Standard_False),
|
done(Standard_False),
|
||||||
@ -65,7 +66,7 @@ IntCurvesFace_Intersector::IntCurvesFace_Intersector(const TopoDS_Face& Face,
|
|||||||
{
|
{
|
||||||
BRepAdaptor_Surface surface;
|
BRepAdaptor_Surface surface;
|
||||||
face = Face;
|
face = Face;
|
||||||
surface.Initialize(Face,Standard_True);
|
surface.Initialize(Face, aRestr);
|
||||||
Hsurface = new BRepAdaptor_HSurface(surface);
|
Hsurface = new BRepAdaptor_HSurface(surface);
|
||||||
myTopolTool = new BRepTopAdaptor_TopolTool(Hsurface);
|
myTopolTool = new BRepTopAdaptor_TopolTool(Hsurface);
|
||||||
|
|
||||||
|
@ -56,7 +56,11 @@ public:
|
|||||||
//! first point of the segment is near the face. In
|
//! first point of the segment is near the face. In
|
||||||
//! that case, the parameter of the intersection point
|
//! that case, the parameter of the intersection point
|
||||||
//! on the line can be a negative value (greater than -Tol).
|
//! on the line can be a negative value (greater than -Tol).
|
||||||
Standard_EXPORT IntCurvesFace_Intersector(const TopoDS_Face& F, const Standard_Real aTol);
|
//! If aRestr = true UV bounding box of face is used to restrict
|
||||||
|
//! it's underlined surface,
|
||||||
|
//! otherwise surface is not restricted
|
||||||
|
Standard_EXPORT IntCurvesFace_Intersector(const TopoDS_Face& F, const Standard_Real aTol,
|
||||||
|
const Standard_Boolean aRestr = Standard_True);
|
||||||
|
|
||||||
//! Perform the intersection between the
|
//! Perform the intersection between the
|
||||||
//! segment L and the loaded face.
|
//! segment L and the loaded face.
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
puts "TODO OCC26018 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
puts "TODO OCC26018 Windows: Faulty shapes in variables faulty_1 to faulty_"
|
||||||
source [locate_data_file 20000_salle-experience.asm.4.gdml.tcl]
|
source [locate_data_file 20000_salle-experience.asm.4.gdml.tcl]
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
puts "TODO OCC26018 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
puts "TODO OCC26018 Windows: Faulty shapes in variables faulty_1 to faulty_"
|
||||||
source [locate_data_file mos2014-po-modif.prt.1.gdml.tcl]
|
source [locate_data_file mos2014-po-modif.prt.1.gdml.tcl]
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
puts "TODO OCC26018 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
puts "TODO OCC26018 Windows: Faulty shapes in variables faulty_1 to faulty_"
|
||||||
source [locate_data_file mos2014-po-modif.prt.15.gdml.tcl]
|
source [locate_data_file mos2014-po-modif.prt.15.gdml.tcl]
|
||||||
|
|
||||||
|
@ -47,5 +47,5 @@ mkface f8 cyl_f8 0 6.2831853071795862 -1000000 1000000
|
|||||||
# make volume operation
|
# make volume operation
|
||||||
mkvolume result f1 f2 f3 f4 f5 f6 f7 f8
|
mkvolume result f1 f2 f3 f4 f5 f6 f7 f8
|
||||||
|
|
||||||
set square 5.00014e+007
|
set square 1.99784e+007
|
||||||
|
|
||||||
|
21
tests/bugs/modalg_6/bug26609
Executable file
21
tests/bugs/modalg_6/bug26609
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC26609"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
############################################################################
|
||||||
|
# Wrong result obtained by solid classifier algorithm.
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug26609_p.draw] p
|
||||||
|
restore [locate_data_file bug26609_z.brep] z
|
||||||
|
|
||||||
|
set cls1 [bclassify z p]
|
||||||
|
if { [regexp {OUT} $cls1] } {
|
||||||
|
puts "Error : Wrong result obtained by solid classifier algorithm"
|
||||||
|
} else {
|
||||||
|
puts "OK : Good result obtained by solid classifier algorithm"
|
||||||
|
}
|
||||||
|
|
||||||
|
smallview
|
||||||
|
fit
|
||||||
|
set only_screen_axo 1
|
Loading…
x
Reference in New Issue
Block a user