mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
0032859: Modeling Algorithms - BRepLib_FindSurface not return an expect plane
BRepLib/BRepLib_FindSurface.cxx = removing very small values from coordinate of normal bug32859 - test case added
This commit is contained in:
parent
2949b238c1
commit
526c506cb0
@ -506,7 +506,14 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S,
|
|||||||
|
|
||||||
if (!isSolved)
|
if (!isSolved)
|
||||||
return;
|
return;
|
||||||
|
//Removing very small values
|
||||||
|
Standard_Real aMaxV = Max(Abs(aVec(1)), Max(Abs(aVec(2)), Abs(aVec(3))));
|
||||||
|
Standard_Real eps = Epsilon(aMaxV);
|
||||||
|
for (i = 1; i <= 3; ++i)
|
||||||
|
{
|
||||||
|
if (Abs(aVec(i)) <= eps)
|
||||||
|
aVec(i) = 0.;
|
||||||
|
}
|
||||||
gp_Vec aN (aVec (1), aVec (2), aVec (3));
|
gp_Vec aN (aVec (1), aVec (2), aVec (3));
|
||||||
Handle(Geom_Plane) aPlane = new Geom_Plane (aBaryCenter, aN);
|
Handle(Geom_Plane) aPlane = new Geom_Plane (aBaryCenter, aN);
|
||||||
myTolReached = Controle (aPoints, aPlane);
|
myTolReached = Controle (aPoints, aPlane);
|
||||||
|
21
tests/bugs/modalg_8/bug32859
Normal file
21
tests/bugs/modalg_8/bug32859
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
puts "============================================================================================="
|
||||||
|
puts "0032859: Modeling Algorithms - BRepLib_FindSurface not return an expect plane"
|
||||||
|
puts "============================================================================================="
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
vertex v1 -500 25 -6
|
||||||
|
vertex v2 -450 -25 -6
|
||||||
|
vertex v3 450 -25 -6
|
||||||
|
vertex v4 500 25 -6
|
||||||
|
edge e1 v1 v2
|
||||||
|
edge e2 v2 v3
|
||||||
|
edge e3 v3 v4
|
||||||
|
edge e4 v4 v1
|
||||||
|
|
||||||
|
wire w e1 e2 e3 e4
|
||||||
|
mkplane p w
|
||||||
|
mksurface s p
|
||||||
|
set log [eval dump s]
|
||||||
|
if {[regexp "Axis :0, 0, 1" ${log}] != 1} {
|
||||||
|
puts "Error: BRepLib_FindSurface algorithm does not return valid result"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user