From 22a251e4fdafafff7591550fd7e5fb8e27ff7fef Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Tue, 5 Nov 2024 14:58:30 +0100 Subject: [PATCH] optional name in wp.Close for last edge --- libsrc/occ/python_occ_shapes.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libsrc/occ/python_occ_shapes.cpp b/libsrc/occ/python_occ_shapes.cpp index 1c4a00ec..0788148b 100644 --- a/libsrc/occ/python_occ_shapes.cpp +++ b/libsrc/occ/python_occ_shapes.cpp @@ -610,11 +610,11 @@ public: return Circle (pos.X(), pos.Y(), r); } - shared_ptr Close () + shared_ptr Close (optional name = nullopt) { if (startpnt.Distance(localpos.Location()) > 1e-10) { - LineTo (startpnt.X(), startpnt.Y()); + LineTo (startpnt.X(), startpnt.Y(), name); return shared_from_this(); } @@ -2635,7 +2635,8 @@ degen_tol : double .def("NameVertex", &WorkPlane::NameVertex, py::arg("name"), "name vertex at current position") .def("Offset", &WorkPlane::Offset, py::arg("d"), "replace current wire by offset curve of distance 'd'") .def("Reverse", &WorkPlane::Reverse, "revert orientation of current wire") - .def("Close", &WorkPlane::Close, "draw line to start point of wire, and finish wire") + .def("Close", &WorkPlane::Close, py::arg("name")=nullopt, + "draw line to start point of wire, and finish wire") .def("Finish", &WorkPlane::Finish, "finish current wire without closing") .def("Last", &WorkPlane::Last, "(deprecated) returns current wire") .def("Wire", &WorkPlane::Last, "returns current wire")