From 7e187d6b22e782161450fbf09c5c7563faaecc66 Mon Sep 17 00:00:00 2001 From: akaftasev Date: Thu, 26 Aug 2021 14:33:56 +0300 Subject: [PATCH] 0028687: Offset for open wire is built with incorrect direction Added new condition to exclude offsetting non closed part of circle as complete circle --- src/BRepFill/BRepFill_OffsetWire.cxx | 4 ++++ tests/bugs/modalg_5/bug25334_1 | 2 +- tests/bugs/modalg_5/bug25334_2 | 2 +- tests/bugs/modalg_5/bug25334_3 | 2 +- tests/bugs/modalg_5/bug25334_4 | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/BRepFill/BRepFill_OffsetWire.cxx b/src/BRepFill/BRepFill_OffsetWire.cxx index be82150111..a1a1699211 100644 --- a/src/BRepFill/BRepFill_OffsetWire.cxx +++ b/src/BRepFill/BRepFill_OffsetWire.cxx @@ -283,6 +283,10 @@ static Standard_Boolean KPartCircle { if (E.Orientation() == TopAbs_FORWARD) anOffset *= -1; + if (!BRep_Tool::IsClosed(E)) + { + anOffset *= -1; + } gp_Circ2d theCirc = AHC->Circle(); if (anOffset > 0. || Abs(anOffset) < theCirc.Radius()) OC = new Geom2d_Circle (theCirc.Position(), theCirc.Radius() + anOffset); diff --git a/tests/bugs/modalg_5/bug25334_1 b/tests/bugs/modalg_5/bug25334_1 index 550317e322..f4d7734dcd 100644 --- a/tests/bugs/modalg_5/bug25334_1 +++ b/tests/bugs/modalg_5/bug25334_1 @@ -23,7 +23,7 @@ vori result fit -checkprops result -l 613.39 +checkprops result -l 644.509 checkshape result checksection result diff --git a/tests/bugs/modalg_5/bug25334_2 b/tests/bugs/modalg_5/bug25334_2 index 3f16c789c7..b5f90d7539 100644 --- a/tests/bugs/modalg_5/bug25334_2 +++ b/tests/bugs/modalg_5/bug25334_2 @@ -23,7 +23,7 @@ vori result fit -checkprops result -l 644.509 +checkprops result -l 613.39 checkshape result checksection result diff --git a/tests/bugs/modalg_5/bug25334_3 b/tests/bugs/modalg_5/bug25334_3 index 8659654ede..e045bc1b6a 100644 --- a/tests/bugs/modalg_5/bug25334_3 +++ b/tests/bugs/modalg_5/bug25334_3 @@ -23,7 +23,7 @@ vori result fit -checkprops result -l 354.958 +checkprops result -l 386.077 checkshape result checksection result diff --git a/tests/bugs/modalg_5/bug25334_4 b/tests/bugs/modalg_5/bug25334_4 index d22bb01edc..40b13eb67e 100644 --- a/tests/bugs/modalg_5/bug25334_4 +++ b/tests/bugs/modalg_5/bug25334_4 @@ -23,7 +23,7 @@ vori result fit -checkprops result -l 386.077 +checkprops result -l 354.958 checkshape result checksection result -- 2.39.5