add property setter for index and edgenr for segment

This commit is contained in:
Christopher Lackner 2024-08-26 16:37:50 +02:00
parent 1772e01edb
commit c032ad58ca

View File

@ -568,14 +568,24 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
li.append (py::cast(self.surfnr2));
return li;
}))
.def_property_readonly("index", FunctionPointer([](const Segment &self) -> size_t
.def_property("index",
[](const Segment &self) -> size_t
{
return self.si;
}))
.def_property_readonly("edgenr", FunctionPointer([](const Segment & self) -> size_t
},
[](Segment& self, int index)
{
self.si = index;
})
.def_property("edgenr",
[](const Segment & self) -> size_t
{
return self.edgenr;
}))
},
[](Segment& self, int edgenr)
{
self.edgenr = edgenr;
})
.def_property("singular",
[](const Segment & seg) { return seg.singedge_left; },
[](Segment & seg, double sing) { seg.singedge_left = sing; seg.singedge_right=sing; })