+ issue #0002542: Part.Wire.makeoffset() doesn't handle circles correctly.

This commit is contained in:
wmayer 2016-05-12 19:03:23 +02:00
parent d7d347b2d6
commit c21888af6c
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);