Salome HOME
Fix for stability of TestMovePart1 unit-test.
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Offset.cpp
index 886bca14bbb8e7f7417bc70d8987a390865d5b8f..6032c421aaf471469f421c16d637947292a3164d 100644 (file)
@@ -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();