Step import: Color of first face missing

Hi all,
I have a problem with the import of step files to NGSolve when they are coming from the new FreeCAD version 1.0. It works fine with step files from FreeCAD version 0.xx. I can provide this minimal example:
FreeCAD version 0.21:
Cube21.step (9.4 KB)
FreeCAD version 1.0:
Cube.step (9.0 KB)
You can see that there are slight differences in the step files beginning in line 187. However, both carry the color information for all 6 faces, especially the first face of the cube is colored in yellow in both files. And if I import the step files again to FreeCAD, all colors are available. I also tried pythonocc, it also correctly reads the colors for all faces for both step files.
With the script
Geometry_FreeCAD1.ipynb (2.6 KB) you can see that the first face gets no color in NGSolve for FreeCAD 1.0 export, however, it works nicely for FreeCAD 0.21 export. All other face colors coincide.
There are also issues with the color during step export (STEP: Export missing color when exporting body or part · Issue #19336 · FreeCAD/FreeCAD · GitHub and STEP: export creates files which don't show up in other applications · Issue #18569 · FreeCAD/FreeCAD · GitHub) but they are not related to the issue I am mentioning here.
I am using NGSolve 2501.

I have a hint: FreeCAD seems to automatically set the color of the first face to the default color of the model and this is not read by NGSolve. If I color any other face with the same color as the first face, the color for both is None.
Is there a possibility to also read the default model color by NGSolve?

Hi Christoph,
Thanks for the hint. occ can now assign colors to solids and then their subshapes have the color. We were ignoring this and only reading shape colors. The first color here is assigned to the solid and then the face doesn’t have a color but gets it from its solid.
I implemented this now in current master, running through pipelines and fix should be published soon.
Best

1 Like