[python] add color property to FaceDescriptor

This commit is contained in:
Matthias Hochsteger 2019-11-26 17:50:06 +01:00
parent de1932227b
commit 9ccb140ffb

View File

@ -492,7 +492,13 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
[](FaceDescriptor & self) -> string { return self.GetBCName(); }, [](FaceDescriptor & self) -> string { return self.GetBCName(); },
[](FaceDescriptor & self, string name) { self.SetBCName(new string(name)); } // memleak [](FaceDescriptor & self, string name) { self.SetBCName(new string(name)); } // memleak
) )
.def("SetSurfaceColor", [](FaceDescriptor & self, py::list color ) .def_property("color",
[](FaceDescriptor & self)
{
auto c = self.SurfColour();
return py::make_tuple( c.X(), c.Y(), c.Z() );
},
[](FaceDescriptor & self, py::tuple color)
{ {
Vec3d c; Vec3d c;
c.X() = py::extract<double>(color[0])(); c.X() = py::extract<double>(color[0])();