mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
0028496: BOP Cut failed on two attached faces with error "ErrorStatus : 191"
While checking the SurfaceOfExtrusion on closeness (GeomLib::IsClosed()) it is necessary to take into account that the basis curve may be not trimmed. Test case for the issue.
This commit is contained in:
parent
b672545674
commit
7a280da946
@ -2475,6 +2475,12 @@ void GeomLib::IsClosed (const Handle(Geom_Surface)& S,
|
|||||||
GeomAdaptor_Surface aGAS(S);
|
GeomAdaptor_Surface aGAS(S);
|
||||||
GeomAbs_SurfaceType aSType = aGAS.GetType();
|
GeomAbs_SurfaceType aSType = aGAS.GetType();
|
||||||
//
|
//
|
||||||
|
Standard_Real u1, u2, v1, v2;
|
||||||
|
u1 = aGAS.FirstUParameter();
|
||||||
|
u2 = aGAS.LastUParameter();
|
||||||
|
v1 = aGAS.FirstVParameter();
|
||||||
|
v2 = aGAS.LastVParameter();
|
||||||
|
//
|
||||||
Standard_Real Tol2 = Tol * Tol;
|
Standard_Real Tol2 = Tol * Tol;
|
||||||
switch (aSType)
|
switch (aSType)
|
||||||
{
|
{
|
||||||
@ -2482,11 +2488,15 @@ void GeomLib::IsClosed (const Handle(Geom_Surface)& S,
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case GeomAbs_Cylinder:
|
|
||||||
case GeomAbs_SurfaceOfExtrusion:
|
case GeomAbs_SurfaceOfExtrusion:
|
||||||
{
|
{
|
||||||
Standard_Real u1 = aGAS.FirstUParameter(), u2 = aGAS.LastUParameter();
|
if (Precision::IsInfinite(u1) || Precision::IsInfinite(u2)) {
|
||||||
Standard_Real v1 = aGAS.FirstVParameter();
|
// not closed
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case GeomAbs_Cylinder:
|
||||||
|
{
|
||||||
if(Precision::IsInfinite(v1))
|
if(Precision::IsInfinite(v1))
|
||||||
v1 = 0.;
|
v1 = 0.;
|
||||||
gp_Pnt p1 = aGAS.Value(u1, v1);
|
gp_Pnt p1 = aGAS.Value(u1, v1);
|
||||||
@ -2496,8 +2506,6 @@ void GeomLib::IsClosed (const Handle(Geom_Surface)& S,
|
|||||||
}
|
}
|
||||||
case GeomAbs_Cone:
|
case GeomAbs_Cone:
|
||||||
{
|
{
|
||||||
Standard_Real u1 = aGAS.FirstUParameter(), u2 = aGAS.LastUParameter();
|
|
||||||
Standard_Real v1 = aGAS.FirstVParameter(), v2 = aGAS.LastVParameter();
|
|
||||||
//find v with maximal distance from axis
|
//find v with maximal distance from axis
|
||||||
if(!(Precision::IsInfinite(v1) || Precision::IsInfinite(v2)))
|
if(!(Precision::IsInfinite(v1) || Precision::IsInfinite(v2)))
|
||||||
{
|
{
|
||||||
@ -2521,8 +2529,6 @@ void GeomLib::IsClosed (const Handle(Geom_Surface)& S,
|
|||||||
}
|
}
|
||||||
case GeomAbs_Sphere:
|
case GeomAbs_Sphere:
|
||||||
{
|
{
|
||||||
Standard_Real u1 = aGAS.FirstUParameter(), u2 = aGAS.LastUParameter();
|
|
||||||
Standard_Real v1 = aGAS.FirstVParameter(), v2 = aGAS.LastVParameter();
|
|
||||||
//find v with maximal distance from axis
|
//find v with maximal distance from axis
|
||||||
if(v1*v2 <= 0.)
|
if(v1*v2 <= 0.)
|
||||||
{
|
{
|
||||||
@ -2544,8 +2550,6 @@ void GeomLib::IsClosed (const Handle(Geom_Surface)& S,
|
|||||||
{
|
{
|
||||||
Standard_Real ures = aGAS.UResolution(Tol);
|
Standard_Real ures = aGAS.UResolution(Tol);
|
||||||
Standard_Real vres = aGAS.VResolution(Tol);
|
Standard_Real vres = aGAS.VResolution(Tol);
|
||||||
Standard_Real u1 = aGAS.FirstUParameter(), u2 = aGAS.LastUParameter();
|
|
||||||
Standard_Real v1 = aGAS.FirstVParameter(), v2 = aGAS.LastVParameter();
|
|
||||||
//
|
//
|
||||||
isUClosed = (u2 - u1) >= aGAS.UPeriod() - ures;
|
isUClosed = (u2 - u1) >= aGAS.UPeriod() - ures;
|
||||||
isVClosed = (v2 - v1) >= aGAS.VPeriod() - vres;
|
isVClosed = (v2 - v1) >= aGAS.VPeriod() - vres;
|
||||||
@ -2553,8 +2557,6 @@ void GeomLib::IsClosed (const Handle(Geom_Surface)& S,
|
|||||||
}
|
}
|
||||||
case GeomAbs_BSplineSurface:
|
case GeomAbs_BSplineSurface:
|
||||||
{
|
{
|
||||||
Standard_Real u1 = aGAS.FirstUParameter(), u2 = aGAS.LastUParameter();
|
|
||||||
Standard_Real v1 = aGAS.FirstVParameter(), v2 = aGAS.LastVParameter();
|
|
||||||
Handle(Geom_BSplineSurface) aBSpl = aGAS.BSpline();
|
Handle(Geom_BSplineSurface) aBSpl = aGAS.BSpline();
|
||||||
isUClosed = GeomLib::IsBSplUClosed(aBSpl, u1, u2, Tol);
|
isUClosed = GeomLib::IsBSplUClosed(aBSpl, u1, u2, Tol);
|
||||||
isVClosed = GeomLib::IsBSplVClosed(aBSpl, v1, v2, Tol);
|
isVClosed = GeomLib::IsBSplVClosed(aBSpl, v1, v2, Tol);
|
||||||
@ -2562,8 +2564,6 @@ void GeomLib::IsClosed (const Handle(Geom_Surface)& S,
|
|||||||
}
|
}
|
||||||
case GeomAbs_BezierSurface:
|
case GeomAbs_BezierSurface:
|
||||||
{
|
{
|
||||||
Standard_Real u1 = aGAS.FirstUParameter(), u2 = aGAS.LastUParameter();
|
|
||||||
Standard_Real v1 = aGAS.FirstVParameter(), v2 = aGAS.LastVParameter();
|
|
||||||
Handle(Geom_BezierSurface) aBz = aGAS.Bezier();
|
Handle(Geom_BezierSurface) aBz = aGAS.Bezier();
|
||||||
isUClosed = GeomLib::IsBzUClosed(aBz, u1, u2, Tol);
|
isUClosed = GeomLib::IsBzUClosed(aBz, u1, u2, Tol);
|
||||||
isVClosed = GeomLib::IsBzVClosed(aBz, v1, v2, Tol);
|
isVClosed = GeomLib::IsBzVClosed(aBz, v1, v2, Tol);
|
||||||
@ -2574,8 +2574,6 @@ void GeomLib::IsClosed (const Handle(Geom_Surface)& S,
|
|||||||
case GeomAbs_OtherSurface:
|
case GeomAbs_OtherSurface:
|
||||||
{
|
{
|
||||||
Standard_Integer nbp = 23;
|
Standard_Integer nbp = 23;
|
||||||
Standard_Real u1 = aGAS.FirstUParameter(), u2 = aGAS.LastUParameter();
|
|
||||||
Standard_Real v1 = aGAS.FirstVParameter(), v2 = aGAS.LastVParameter();
|
|
||||||
if(Precision::IsInfinite(v1))
|
if(Precision::IsInfinite(v1))
|
||||||
{
|
{
|
||||||
v1 = Sign(1., v1);
|
v1 = Sign(1., v1);
|
||||||
|
27
tests/bugs/modalg_6/bug28496
Normal file
27
tests/bugs/modalg_6/bug28496
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "OCC28496"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
#################################################
|
||||||
|
# BOP Cut failed on two attached faces with error "ErrorStatus : 191"
|
||||||
|
#################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug28496_Face_3.brep] f1
|
||||||
|
restore [locate_data_file bug28496_Face_9.brep] f2
|
||||||
|
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
baddobjects f1
|
||||||
|
baddtools f2
|
||||||
|
bfillds
|
||||||
|
bbuild result
|
||||||
|
|
||||||
|
checkshape result
|
||||||
|
checkprops result -s 499.564
|
||||||
|
checknbshapes result -face 3 -wire 3
|
||||||
|
|
||||||
|
smallview
|
||||||
|
don result
|
||||||
|
fit
|
||||||
|
|
||||||
|
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
Loading…
x
Reference in New Issue
Block a user