fix(python): pybind assembly root and cylinder defaults

This commit is contained in:
hm
2026-10-30 00:06:26 +08:00
parent fa570cf928
commit aa7f259f19
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -129,7 +129,10 @@ Example:
"Create an assembly with given name")
.def_readwrite("name", &Assembly::name, "Assembly name")
.def_readwrite("version", &Assembly::version, "Version string")
.def_readwrite("root", &Assembly::root, "Root AssemblyNode (add parts here)")
.def_property_readonly("root",
[](Assembly& a) -> AssemblyNode& { return a.root; },
py::return_value_policy::reference_internal,
"Root AssemblyNode (add parts here)")
.def("part_count", &Assembly::part_count, "Total number of leaf parts")
.def("node_count", &Assembly::node_count, "Total number of tree nodes (including subassemblies)")
.def("visit_parts", [](const Assembly& a) {