From 111f90939eb9fe3e93b3323dd1be4b9e00fec47f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Sat, 2 Sep 2017 22:13:36 +0200 Subject: [PATCH] init color, add transparent --- libsrc/csg/python_csg.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libsrc/csg/python_csg.cpp b/libsrc/csg/python_csg.cpp index e6ac3499..1208962f 100644 --- a/libsrc/csg/python_csg.cpp +++ b/libsrc/csg/python_csg.cpp @@ -24,7 +24,7 @@ class SPSolid double maxh = -1; string material; bool owner; - double red, green, blue; + double red = 0, green = 0, blue = 1; bool transp = false; public: enum optyp { TERM, SECTION, UNION, SUB }; @@ -375,14 +375,15 @@ DLL_HEADER void ExportCSG(py::module &m) })) .def("Add", [] (CSGeometry & self, shared_ptr solid, py::list bcmod, double maxh, - py::tuple col) + py::tuple col, bool transparent) { solid->AddSurfaces (self); solid->GiveUpOwner(); int tlonr = self.SetTopLevelObject (solid->GetSolid()); self.GetTopLevelObject(tlonr) -> SetMaterial(solid->GetMaterial()); self.GetTopLevelObject(tlonr) -> SetRGB(solid->GetRed(),solid->GetGreen(),solid->GetBlue()); - self.GetTopLevelObject(tlonr)->SetTransparent(solid->IsTransparent()); + // self.GetTopLevelObject(tlonr)->SetTransparent(solid->IsTransparent()); + self.GetTopLevelObject(tlonr)->SetTransparent(transparent); self.GetTopLevelObject(tlonr)->SetMaxH(maxh); // cout << "rgb = " << py::len(rgb) << endl; @@ -420,7 +421,7 @@ DLL_HEADER void ExportCSG(py::module &m) return tlonr; }, py::arg("solid"), py::arg("bcmod")=py::list(), py::arg("maxh")=1e99, - py::arg("col")=py::tuple() + py::arg("col")=py::tuple(), py::arg("transparent")=false ) .def("AddSurface", FunctionPointer