From: akaftase <168822067+akaftase@users.noreply.github.com> Date: Sun, 7 Jul 2024 18:54:59 +0000 (+0100) Subject: 0033541: Modeling Algorithms - Simple sphere cut from cylinder fails X-Git-Tag: V7_9_0_beta1~196 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=b8288141311ee5aaa1848f26d0018c2c4007ef5c;p=occt.git 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). --- 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