From c93109fe434bd3fa4b33f27dc89e8e66c4a57392 Mon Sep 17 00:00:00 2001 From: jgv Date: Wed, 29 Jul 2015 16:10:53 +0300 Subject: [PATCH] 0026481: Incorrect result of BRepOffsetAPI_MakeOffset: excess hanging arcs in the open result with join type GeomAbs_Arc Test-case for issue #26481 --- src/BRepFill/BRepFill_OffsetWire.cxx | 18 ++++++++++++++++++ tests/bugs/modalg_6/bug26481 | 16 ++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 tests/bugs/modalg_6/bug26481 diff --git a/src/BRepFill/BRepFill_OffsetWire.cxx b/src/BRepFill/BRepFill_OffsetWire.cxx index a3f62ceb00..0cec1a38e2 100644 --- a/src/BRepFill/BRepFill_OffsetWire.cxx +++ b/src/BRepFill/BRepFill_OffsetWire.cxx @@ -808,6 +808,24 @@ void BRepFill_OffsetWire::PerformWithBiLo } } + //Remove possible hanging arcs on vertices + if (myIsOpenResult && myJoinType == GeomAbs_Arc) + { + if (!myMap.IsEmpty() && + myMap.FindKey(1).ShapeType() == TopAbs_VERTEX) + { + //myMap.RemoveFirst(); + TopoDS_Shape LastShape = myMap.FindKey(myMap.Extent()); + TopTools_ListOfShape LastList; + LastList.Append(myMap(myMap.Extent())); + myMap.RemoveLast(); + if (!myMap.IsEmpty()) + myMap.Substitute(1, LastShape, LastList); + } + if (!myMap.IsEmpty() && + myMap.FindKey(myMap.Extent()).ShapeType() == TopAbs_VERTEX) + myMap.RemoveLast(); + } #ifdef OCCT_DEBUG #ifdef DRAW diff --git a/tests/bugs/modalg_6/bug26481 b/tests/bugs/modalg_6/bug26481 new file mode 100644 index 0000000000..36b76c5e40 --- /dev/null +++ b/tests/bugs/modalg_6/bug26481 @@ -0,0 +1,16 @@ +puts "========" +puts "OCC26481" +puts "========" +puts "" +################################################################################################################### +# Incorrect result of BRepOffsetAPI_MakeOffset: excess hanging arcs in the open result with join type GeomAbs_Arc +################################################################################################################### + +smallview + +restore [locate_data_file OCC26481-linesarc.brep] a +fit +openoffset r a 4 10. +fit + +set only_screen_axo 1