Workplane - finish wire without closing

This commit is contained in:
Joachim Schoeberl 2021-08-18 16:40:16 +02:00
parent eda914281a
commit 18c30805ab

View File

@ -193,6 +193,17 @@ public:
}
auto Finish()
{
if (!startvertex.IsNull())
{
wires.push_back (wire_builder.Wire());
wire_builder = BRepBuilderAPI_MakeWire();
startvertex.Nullify();
}
return shared_from_this();
}
auto MoveTo (double h, double v)
{
startpnt = gp_Pnt2d(h,v);
@ -248,7 +259,7 @@ public:
OCCGeometry::global_shape_properties[edge.TShape()].name = name;
wire_builder.Add(edge);
if (closing) Close();
if (closing) Finish();
return shared_from_this();
}
@ -361,11 +372,8 @@ public:
//update localpos.Direction()
Rotate(angle*180/M_PI);
if (closing)
{
cout << "call close from arc" << endl;
Close();
cout << "close is back" << endl;
}
Finish();
return shared_from_this();
}
@ -454,26 +462,17 @@ public:
*/
}
shared_ptr<WorkPlane> Close ()
{
cout << "close called" << endl;
if (startpnt.Distance(localpos.Location()) > 1e-10)
{
cout << "generate closing line" << endl;
LineTo (startpnt.X(), startpnt.Y());
return shared_from_this();
}
if (!startvertex.IsNull())
{
cout << "I am actually closing" << endl;
wires.push_back (wire_builder.Wire());
wire_builder = BRepBuilderAPI_MakeWire();
startvertex.Nullify();
cout << "complete" << endl;
}
cout << "close returning" << endl;
Finish();
return shared_from_this();
}
@ -1613,6 +1612,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
.def("Offset", &WorkPlane::Offset)
.def("Reverse", &WorkPlane::Reverse)
.def("Close", &WorkPlane::Close)
.def("Finish", &WorkPlane::Finish)
.def("Last", &WorkPlane::Last)
.def("Face", &WorkPlane::Face)
.def("Wires", &WorkPlane::Wires)