From c7264397508042ff121205d58940cb06c97ac926 Mon Sep 17 00:00:00 2001 From: akaftasev Date: Mon, 20 May 2024 10:50:28 +0100 Subject: [PATCH] 0033541: Modeling Algorithms - Simple sphere cut from cylinder fails Changed condition for combination of WLines into one. WLine would be excluded from consideration for merging, if one of its middle points between vertices is out of domain (does not lie on both surfaces). --- src/IntPatch/IntPatch_WLineTool.cxx | 8 +++----- tests/bugs/modalg_8/bug33541 | 12 ++++++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 tests/bugs/modalg_8/bug33541 diff --git a/src/IntPatch/IntPatch_WLineTool.cxx b/src/IntPatch/IntPatch_WLineTool.cxx index 6530d7d4b3..766aca20e9 100644 --- a/src/IntPatch/IntPatch_WLineTool.cxx +++ b/src/IntPatch/IntPatch_WLineTool.cxx @@ -1728,7 +1728,6 @@ static Standard_Boolean IsNeedSkipWL(const Handle(IntPatch_WLine)& theWL, { Standard_Real aFirstp, aLastp; Standard_Integer aNbVtx = theWL->NbVertex(); - Standard_Boolean isNeedSkip = Standard_True; for (Standard_Integer i = 1; i < aNbVtx; i++) { aFirstp = theWL->Vertex (i).ParameterOnLine(); @@ -1739,14 +1738,13 @@ static Standard_Boolean IsNeedSkipWL(const Handle(IntPatch_WLine)& theWL, const IntSurf_PntOn2S& aPmid = theWL->Point (pmid); aPmid.Parameters (aU1, aV1, aU2, aV2); - if (!IsOutOfDomain (theBoxS1, theBoxS2, aPmid, theArrPeriods)) + if (IsOutOfDomain (theBoxS1, theBoxS2, aPmid, theArrPeriods)) { - isNeedSkip = Standard_False; - break; + return Standard_True; } } - return isNeedSkip; + return Standard_False; } //======================================================================= diff --git a/tests/bugs/modalg_8/bug33541 b/tests/bugs/modalg_8/bug33541 new file mode 100644 index 0000000000..4af9e791a5 --- /dev/null +++ b/tests/bugs/modalg_8/bug33541 @@ -0,0 +1,12 @@ +puts "================================" +puts "0033541: Modeling Algorithms - Simple sphere cut from cylinder fails" +puts "================================" +puts "" + +pcylinder c 1 1 +psphere s 1 +ttranslate s 1 1 1 +bcut result c s + +checknbshapes result -vertex 3 -edge 5 -wire 4 -face 4 +checkview -display result -2d -path ${imagedir}/${test_image}.png -- 2.39.5