Merge branch 'master' of github.com:FreeCAD/FreeCAD

This commit is contained in:
Yorik van Havre 2016-05-12 23:16:59 -03:00
commit 0e4132a7d5
2 changed files with 12 additions and 0 deletions

View File

@ -27,6 +27,7 @@
# include <BRep_Tool.hxx>
# include <BRepCheck_Analyzer.hxx>
# include <BRepTools.hxx>
# include <BRepBuilderAPI_FindPlane.hxx>
# include <BRepBuilderAPI_MakeFace.hxx>
# include <ShapeAnalysis.hxx>
# include <BRepAdaptor_Surface.hxx>
@ -254,6 +255,11 @@ PyObject* TopoShapeFacePy::makeOffset(PyObject *args)
if (!PyArg_ParseTuple(args, "d",&dist))
return 0;
const TopoDS_Face& f = TopoDS::Face(getTopoShapePtr()->_Shape);
BRepBuilderAPI_FindPlane findPlane(f);
if (!findPlane.Found()) {
PyErr_SetString(PartExceptionOCCError, "No planar face");
return 0;
}
BRepOffsetAPI_MakeOffset mkOffset(f);
mkOffset.Perform(dist);

View File

@ -26,6 +26,7 @@
# include <Approx_Curve3d.hxx>
# include <ShapeAlgo_AlgoContainer.hxx>
# include <BRepAdaptor_CompCurve.hxx>
# include <BRepBuilderAPI_FindPlane.hxx>
# include <BRepBuilderAPI_MakeWire.hxx>
# include <BRepOffsetAPI_MakeOffset.hxx>
# include <Precision.hxx>
@ -225,6 +226,11 @@ PyObject* TopoShapeWirePy::makeOffset(PyObject *args)
if (!PyArg_ParseTuple(args, "d",&dist))
return 0;
const TopoDS_Wire& w = TopoDS::Wire(getTopoShapePtr()->_Shape);
BRepBuilderAPI_FindPlane findPlane(w);
if (!findPlane.Found()) {
PyErr_SetString(PartExceptionOCCError, "No planar wire");
return 0;
}
BRepOffsetAPI_MakeOffset mkOffset(w);
mkOffset.Perform(dist);