fixes 0003020: 2D offset of circle are not in the right place

This commit is contained in:
wmayer
2019-01-26 22:51:29 +01:00
parent 9f96254e7e
commit dbc09e3a23
4 changed files with 289 additions and 8 deletions

View File

@@ -196,6 +196,7 @@
#include "Tools.h"
#include "encodeFilename.h"
#include "FaceMakerBullseye.h"
#include "BRepOffsetAPI_MakeOffsetFix.h"
using namespace Part;
@@ -2618,14 +2619,9 @@ TopoDS_Shape TopoShape::makeOffset2D(double offset, short joinType, bool fill, b
//do the offset..
TopoDS_Shape offsetShape;
BRepOffsetAPI_MakeOffset mkOffset(sourceWires[0], GeomAbs_JoinType(joinType)
#if OCC_VERSION_HEX >= 0x060900
, allowOpenResult
#endif
);
BRepOffsetAPI_MakeOffsetFix mkOffset(GeomAbs_JoinType(joinType), allowOpenResult);
for (TopoDS_Wire &w : sourceWires) {
if (&w != &(sourceWires[0])) //filter out first wire - it's already added
mkOffset.AddWire(w);
mkOffset.AddWire(w);
}
if (fabs(offset) > Precision::Confusion()) {
@@ -2643,7 +2639,7 @@ TopoDS_Shape TopoShape::makeOffset2D(double offset, short joinType, bool fill, b
}
offsetShape = mkOffset.Shape();
if(offsetShape.IsNull())
if (offsetShape.IsNull())
throw Base::CADKernelError("makeOffset2D: result of offsetting is null!");
//Copying shape to fix strange orientation behavior, OCC7.0.0. See bug #2699