diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index 2debe2132..f482fd70c 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -1347,7 +1347,8 @@ TopoDS_Shape TopoShape::makePipe(const TopoDS_Shape& profile) const TopoDS_Shape TopoShape::makePipeShell(const TopTools_ListOfShape& profiles, const Standard_Boolean make_solid, - const Standard_Boolean isFrenet) const + const Standard_Boolean isFrenet, + int transition) const { if (this->_Shape.IsNull()) Standard_Failure::Raise("Cannot sweep along empty spine"); @@ -1355,7 +1356,17 @@ TopoDS_Shape TopoShape::makePipeShell(const TopTools_ListOfShape& profiles, Standard_Failure::Raise("Spine shape is not a wire"); BRepOffsetAPI_MakePipeShell mkPipeShell(TopoDS::Wire(this->_Shape)); + BRepBuilderAPI_TransitionMode transMode; + switch (transition) { + case 1: transMode = BRepBuilderAPI_RightCorner; + break; + case 2: transMode = BRepBuilderAPI_RoundCorner; + break; + default: transMode = BRepBuilderAPI_Transformed; + break; + } mkPipeShell.SetMode(isFrenet); + mkPipeShell.SetTransitionMode(transMode); TopTools_ListIteratorOfListOfShape it; for (it.Initialize(profiles); it.More(); it.Next()) { mkPipeShell.Add(TopoDS_Shape(it.Value())); diff --git a/src/Mod/Part/App/TopoShape.h b/src/Mod/Part/App/TopoShape.h index 9e7ecd9a1..dcd94d53a 100644 --- a/src/Mod/Part/App/TopoShape.h +++ b/src/Mod/Part/App/TopoShape.h @@ -155,7 +155,7 @@ public: //@{ TopoDS_Shape makePipe(const TopoDS_Shape& profile) const; TopoDS_Shape makePipeShell(const TopTools_ListOfShape& profiles, const Standard_Boolean make_solid, - const Standard_Boolean isFrenet = Standard_False) const; + const Standard_Boolean isFrenet = Standard_False, int transition=0) const; TopoDS_Shape makePrism(const gp_Vec&) const; TopoDS_Shape revolve(const gp_Ax1&, double d) const; TopoDS_Shape makeSweep(const TopoDS_Shape& profile, double, int) const; diff --git a/src/Mod/Part/App/TopoShapeWirePy.xml b/src/Mod/Part/App/TopoShapeWirePy.xml index 057bfc9c9..58f83ce82 100644 --- a/src/Mod/Part/App/TopoShapeWirePy.xml +++ b/src/Mod/Part/App/TopoShapeWirePy.xml @@ -41,7 +41,9 @@ - Make a loft defined by profiles along a wire. + makePipeShell(shapeList,[isSolid,isFrenet,transition]) +Make a loft defined by a list of profiles along a wire. Transition can be +0 (default), 1 (right corners) or 2 (rounded corners). diff --git a/src/Mod/Part/App/TopoShapeWirePyImp.cpp b/src/Mod/Part/App/TopoShapeWirePyImp.cpp index 0f24b5861..70af3afa0 100644 --- a/src/Mod/Part/App/TopoShapeWirePyImp.cpp +++ b/src/Mod/Part/App/TopoShapeWirePyImp.cpp @@ -244,8 +244,9 @@ PyObject* TopoShapeWirePy::makePipeShell(PyObject *args) PyObject *obj; int make_solid = 0; int is_Frenet = 0; + int transition = 0; - if (PyArg_ParseTuple(args, "O!|ii", &(PyList_Type), &obj, &make_solid, &is_Frenet)) { + if (PyArg_ParseTuple(args, "O!|iii", &(PyList_Type), &obj, &make_solid, &is_Frenet, &transition)) { try { TopTools_ListOfShape sections; Py::List list(obj); @@ -255,7 +256,7 @@ PyObject* TopoShapeWirePy::makePipeShell(PyObject *args) sections.Append(shape); } } - TopoDS_Shape shape = this->getTopoShapePtr()->makePipeShell(sections, make_solid, is_Frenet); + TopoDS_Shape shape = this->getTopoShapePtr()->makePipeShell(sections, make_solid, is_Frenet, transition); return new TopoShapePy(new TopoShape(shape)); } catch (Standard_Failure) {