Fix Workplane.Offset for straight lines

This commit is contained in:
Matthias Hochsteger 2024-01-30 17:41:21 +01:00
parent 61366f4c8e
commit 6533663b7f

View File

@ -633,8 +633,12 @@ public:
{
TopoDS_Wire wire = wires.back();
wires.pop_back();
BRepOffsetAPI_MakeOffset builder;
builder.AddWire(wire);
// handle wires containing a single edge correctly, see
// https://dev.opencascade.org/content/brepoffsetapimakeoffset-open-topodswire
BRepBuilderAPI_MakeFace makeFace{gp_Pln{axes}};
makeFace.Add(wire);
BRepOffsetAPI_MakeOffset builder(makeFace.Face());
builder.Perform(d);
auto shape = builder.Shape();
wires.push_back (TopoDS::Wire(shape.Reversed()));