X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_Offset.cpp;h=bcd5ec60d78e9ff8df924202ed8bad82a82dc953;hb=06e7f5859095193fc7f498bd89a7d28009794f53;hp=dccf9bd131f4df22ed8ac3542869d74fea253cf8;hpb=747178d21dce4fb034ff0e84c1280406ab64d566;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Offset.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Offset.cpp index dccf9bd13..bcd5ec60d 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Offset.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Offset.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2020 CEA/DEN, EDF R&D +// Copyright (C) 2019-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -64,7 +64,8 @@ void GeomAlgoAPI_Offset::generated(const GeomShapePtr theOldShape, GeomAlgoAPI_Offset::GeomAlgoAPI_Offset(const GeomPlanePtr& thePlane, const GeomShapePtr& theEdgeOrWire, - const double theOffsetValue) + const double theOffsetValue, + const GeomAlgoAPI_OffsetJoint theJoint) { // 1. Make wire from edge, if need TopoDS_Wire aWire; @@ -92,8 +93,14 @@ GeomAlgoAPI_Offset::GeomAlgoAPI_Offset(const GeomPlanePtr& thePlane, setImpl(aParal); setBuilderType(OCCT_BRepBuilderAPI_MakeShape); + // Joint type + GeomAbs_JoinType aJoin = GeomAbs_Arc; // default mode, corresponding to KeepDistance + if (theJoint == GeomAlgoAPI_OffsetJoint::Lines) + aJoin = GeomAbs_Intersection; + // for GeomAlgoAPI_OffsetJoint::Arcs do the same as for KeepDistance + Standard_Boolean isOpenResult = !aWire.Closed(); - aParal->Init(aFace, GeomAbs_Arc, isOpenResult); + aParal->Init(aFace, aJoin, isOpenResult); aParal->Perform(theOffsetValue, 0.); if (aParal->IsDone()) { TopoDS_Shape anOffset = aParal->Shape();