mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
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:
parent
d7ffc68a30
commit
2024a67c74
@ -1233,20 +1233,14 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
|
||||
// Handle(TopoDS_Face) face = e.Current();
|
||||
fmap.Add(face);
|
||||
ExtractFaceData(face, index, p, n, box);
|
||||
auto & props = OCCGeometry::GetProperties(face);
|
||||
if(props.col)
|
||||
{
|
||||
auto & c = *props.col;
|
||||
colors.append(py::make_tuple(c[0], c[1], c[2]));
|
||||
}
|
||||
else
|
||||
colors.append(py::make_tuple(0.0, 1.0, 0.0));
|
||||
if(props.name)
|
||||
{
|
||||
names.append(*props.name);
|
||||
}
|
||||
else
|
||||
names.append("");
|
||||
|
||||
ShapeProperties props;
|
||||
if(OCCGeometry::HaveProperties(face))
|
||||
props = OCCGeometry::GetProperties(face);
|
||||
|
||||
auto c = props.GetColor();
|
||||
colors.append(py::make_tuple(c[0], c[1], c[2], c[3]));
|
||||
names.append(props.GetName());
|
||||
index++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user