mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-11 21:50:34 +05:00
[python] add color property to FaceDescriptor
This commit is contained in:
parent
de1932227b
commit
9ccb140ffb
@ -492,14 +492,20 @@ 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)
|
||||||
Vec3d c;
|
{
|
||||||
c.X() = py::extract<double>(color[0])();
|
auto c = self.SurfColour();
|
||||||
c.Y() = py::extract<double>(color[1])();
|
return py::make_tuple( c.X(), c.Y(), c.Z() );
|
||||||
c.Z() = py::extract<double>(color[2])();
|
},
|
||||||
self.SetSurfColour(c);
|
[](FaceDescriptor & self, py::tuple color)
|
||||||
})
|
{
|
||||||
|
Vec3d c;
|
||||||
|
c.X() = py::extract<double>(color[0])();
|
||||||
|
c.Y() = py::extract<double>(color[1])();
|
||||||
|
c.Z() = py::extract<double>(color[2])();
|
||||||
|
self.SetSurfColour(c);
|
||||||
|
})
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user