]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/GeomAlgoAPI/GeomAlgoAPI_Offset.cpp
Salome HOME
Merge branch 'V9_11_BR'
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Offset.cpp
index 176c569ba2614e788cf19e452d90b3af99fcb109..f39936af222ffaebd34413d969695530d4ea68b1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2019-2021  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,9 @@ 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,
+                                       const bool theIsApprox)
 {
   // 1. Make wire from edge, if need
   TopoDS_Wire aWire;
@@ -92,8 +94,15 @@ 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->SetApprox(theIsApprox);
   aParal->Perform(theOffsetValue, 0.);
   if (aParal->IsDone()) {
     TopoDS_Shape anOffset = aParal->Shape();