mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 22:00:33 +05:00
Fix reading face_colors and face_transparencies for faces without attached geometry surface
This commit is contained in:
parent
78832cb7c5
commit
da743467fb
@ -1207,6 +1207,8 @@ namespace netgen
|
|||||||
facedecoding.SetSize(0);
|
facedecoding.SetSize(0);
|
||||||
|
|
||||||
bool endmesh = false;
|
bool endmesh = false;
|
||||||
|
|
||||||
|
bool has_facedescriptors = false;
|
||||||
|
|
||||||
|
|
||||||
while (infile.good() && !endmesh)
|
while (infile.good() && !endmesh)
|
||||||
@ -1226,6 +1228,7 @@ namespace netgen
|
|||||||
|
|
||||||
if (strcmp (str, "facedescriptors") == 0)
|
if (strcmp (str, "facedescriptors") == 0)
|
||||||
{
|
{
|
||||||
|
has_facedescriptors = true;
|
||||||
int nfd;
|
int nfd;
|
||||||
infile >> nfd;
|
infile >> nfd;
|
||||||
for([[maybe_unused]] auto i : Range(nfd))
|
for([[maybe_unused]] auto i : Range(nfd))
|
||||||
@ -1610,7 +1613,11 @@ namespace netgen
|
|||||||
|
|
||||||
surfnr--;
|
surfnr--;
|
||||||
|
|
||||||
if(surfnr > 0)
|
if(has_facedescriptors)
|
||||||
|
{
|
||||||
|
GetFaceDescriptor(i).SetSurfColour(surfcolour);
|
||||||
|
}
|
||||||
|
else if(surfnr > 0)
|
||||||
{
|
{
|
||||||
for(int facedesc = 1; facedesc <= cnt_facedesc; facedesc++)
|
for(int facedesc = 1; facedesc <= cnt_facedesc; facedesc++)
|
||||||
{
|
{
|
||||||
@ -1637,7 +1644,14 @@ namespace netgen
|
|||||||
double transp;
|
double transp;
|
||||||
infile >> surfnr >> transp;
|
infile >> surfnr >> transp;
|
||||||
surfnr--;
|
surfnr--;
|
||||||
if(surfnr > 0)
|
if(has_facedescriptors)
|
||||||
|
{
|
||||||
|
auto& fd = GetFaceDescriptor(index);
|
||||||
|
auto scol = fd.SurfColour();
|
||||||
|
scol[3] = transp;
|
||||||
|
fd.SetSurfColour(scol);
|
||||||
|
}
|
||||||
|
else if(surfnr > 0)
|
||||||
{
|
{
|
||||||
for(int facedesc = 1; facedesc <= cnt_facedesc; facedesc++)
|
for(int facedesc = 1; facedesc <= cnt_facedesc; facedesc++)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user