occ shapes _webgui_data - export color alpha values

Also
- don't create ShapeProperties objects for faces with default values
- use default name/color from ShapeProperties
This commit is contained in:
Matthias Hochsteger 2024-01-22 10:57:58 +01:00
parent d7ffc68a30
commit 2024a67c74

View File

@ -1233,20 +1233,14 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
// Handle(TopoDS_Face) face = e.Current(); // Handle(TopoDS_Face) face = e.Current();
fmap.Add(face); fmap.Add(face);
ExtractFaceData(face, index, p, n, box); ExtractFaceData(face, index, p, n, box);
auto & props = OCCGeometry::GetProperties(face);
if(props.col) ShapeProperties props;
{ if(OCCGeometry::HaveProperties(face))
auto & c = *props.col; props = OCCGeometry::GetProperties(face);
colors.append(py::make_tuple(c[0], c[1], c[2]));
} auto c = props.GetColor();
else colors.append(py::make_tuple(c[0], c[1], c[2], c[3]));
colors.append(py::make_tuple(0.0, 1.0, 0.0)); names.append(props.GetName());
if(props.name)
{
names.append(*props.name);
}
else
names.append("");
index++; index++;
} }