diff --git a/src/IntPatch/IntPatch_Intersection.cxx b/src/IntPatch/IntPatch_Intersection.cxx index d5e6296a72..26e73129f9 100644 --- a/src/IntPatch/IntPatch_Intersection.cxx +++ b/src/IntPatch/IntPatch_Intersection.cxx @@ -1204,6 +1204,9 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1, if(aWL.IsNull()) continue; + if(!aWL->IsPurgingAllowed()) + continue; + Handle(IntPatch_WLine) aRW = IntPatch_WLineTool::ComputePurgedWLine(aWL, theS1, theS2, theD1, theD2); if(aRW.IsNull()) @@ -1414,7 +1417,8 @@ void IntPatch_Intersection::GeomGeomPerfom(const Handle(Adaptor3d_HSurface)& the } IntPatch_ALineToWLine AToW(Quad1,Quad2,0.01,0.05,aNbPointsInALine); - Handle(IntPatch_Line) wlin=AToW.MakeWLine((*((Handle(IntPatch_ALine) *)(&line)))); + Handle(IntPatch_WLine) wlin=AToW.MakeWLine((*((Handle(IntPatch_ALine) *)(&line)))); + wlin->EnablePurging(Standard_False); slin.Append(wlin); } else diff --git a/src/IntPatch/IntPatch_WLine.cxx b/src/IntPatch/IntPatch_WLine.cxx index 67046f6f9d..e8da3d78d6 100644 --- a/src/IntPatch/IntPatch_WLine.cxx +++ b/src/IntPatch/IntPatch_WLine.cxx @@ -41,7 +41,8 @@ IntPatch_WLine::IntPatch_WLine (const Handle(IntSurf_LineOn2S)& Line, const IntSurf_TypeTrans Trans1, const IntSurf_TypeTrans Trans2) : IntPatch_PointLine(Tang,Trans1,Trans2),fipt(Standard_False),lapt(Standard_False), - hasArcOnS1(Standard_False),hasArcOnS2(Standard_False) + hasArcOnS1(Standard_False),hasArcOnS2(Standard_False), + myIsPurgerAllowed(Standard_True) { typ = IntPatch_Walking; curv = Line; @@ -57,7 +58,8 @@ IntPatch_WLine::IntPatch_WLine (const Handle(IntSurf_LineOn2S)& Line, const IntSurf_Situation Situ1, const IntSurf_Situation Situ2) : IntPatch_PointLine(Tang,Situ1,Situ2),fipt(Standard_False),lapt(Standard_False), - hasArcOnS1(Standard_False),hasArcOnS2(Standard_False) + hasArcOnS1(Standard_False),hasArcOnS2(Standard_False), + myIsPurgerAllowed(Standard_True) { typ = IntPatch_Walking; curv = Line; @@ -71,7 +73,8 @@ IntPatch_WLine::IntPatch_WLine (const Handle(IntSurf_LineOn2S)& Line, IntPatch_WLine::IntPatch_WLine (const Handle(IntSurf_LineOn2S)& Line, const Standard_Boolean Tang) : IntPatch_PointLine(Tang),fipt(Standard_False),lapt(Standard_False), - hasArcOnS1(Standard_False),hasArcOnS2(Standard_False) + hasArcOnS1(Standard_False),hasArcOnS2(Standard_False), + myIsPurgerAllowed(Standard_True) { typ = IntPatch_Walking; curv = Line; diff --git a/src/IntPatch/IntPatch_WLine.hxx b/src/IntPatch/IntPatch_WLine.hxx index f8faf0c8ce..ba64bff7d0 100644 --- a/src/IntPatch/IntPatch_WLine.hxx +++ b/src/IntPatch/IntPatch_WLine.hxx @@ -164,7 +164,17 @@ public: //! Otherwise, prints list of 2d-points on the 2nd surface Standard_EXPORT void Dump(const Standard_Integer theMode) const; + //! Allows or forbides purging of existing WLine + void EnablePurging(const Standard_Boolean theIsEnabled) + { + myIsPurgerAllowed = theIsEnabled; + } + //! Returns TRUE if purging is allowed or forbiden for existing WLine + Standard_Boolean IsPurgingAllowed() + { + return myIsPurgerAllowed; + } DEFINE_STANDARD_RTTIEXT(IntPatch_WLine,IntPatch_PointLine) @@ -194,6 +204,7 @@ private: Handle(Adaptor2d_HCurve2d) theArcOnS1; Standard_Boolean hasArcOnS2; Handle(Adaptor2d_HCurve2d) theArcOnS2; + Standard_Boolean myIsPurgerAllowed; }; diff --git a/tests/bugs/modalg_6/bug27267 b/tests/bugs/modalg_6/bug27267 new file mode 100644 index 0000000000..20db1ea5ed --- /dev/null +++ b/tests/bugs/modalg_6/bug27267 @@ -0,0 +1,22 @@ +puts "================" +puts "OCC27267" +puts "================" +puts "" +####################################################################### +# [Regression to 6.9.1] geom/boolean_operations_06/G3: Cut produces invalid shape +####################################################################### + +restore [locate_data_file bug27267_cmpd.brep] a +explode a + +bcut result a_1 a_2 +checkshape result +checknbshapes result -solid 1 -shell 1 -face 7 +checkprops result -s 0.00128248 + +smallview +don a_2 +fit +don result + +checkview -screenshot -2d -path ${imagedir}/${test_image}.png \ No newline at end of file