DiscussionsIssue archiveOCCT:Visualization

Archived issue #0031809

Regression v.6.9.1-7.4.0: colors no longer showing on certain STEP files

CommunityOCCT:Visualizationclosed15 public notes

Search issues

Description

Opening the 3D view of a layout that worked fine in KiCad version v5.0.2 shows a one of the models in grey only on KiCad v.5.1.6. This specific model (attached) was created by and downloaded from SnapEDA. All the other components (from the KiCad 3D library) are having no issues at all as far as I can see.
The issue was initially reported here:
https://gitlab.com/kicad/code/kicad/-/issues/5163
Turns out that FreeCAD (versions 0.19-16540 and 0.18-16110 AppImages) has the same problem with this file, so turning to OpenCascade now.

Steps to reproduce

pload XDE OCAF VISUALIZATION
ReadStep D Attachment 12 (STEP)
#XShow D; vsetdispmode 1
XDisplay -dispMode 1 D
vfit
vviewparams -scale 36 -proj 0.5 0.8 0.3 -up -0.4 0.5 -0.8 -at 0.7 3.1 0.3


Always the same issue after opening the layout file in KiCad's 3D viewer.
Also checked the 3D preview in the footprint editor (Footprint Properties -> 3D Settings), and there the model is grey-colored too.
I've already reset the Viewer settings (Preferences -> Reset to Default Settings), to no avail.

Public activity

15 archived notes

Participants are labeled by their role within this record.

01Commenter 2
I'm unable reproducing the issue using OCCT viewer - colors present in OCCT 7.4.0+ in Draw Harness (XCAFPrs_AISObject presentation)
and in CAD Assistant (see attached screenshots), although OCCT versions 7.1.0-7.3.0 (but not OCCT 7.0.0) lose some colors:

pload XDE OCAF VISUALIZATION
ReadStep D Attachment 12 (STEP)
vclear
vinit View1
XDisplay -dispMode 1 D
vfit


02Author
Anything I can do here to better pinpoint this issue?
I don't think the OpenCascade packages for Fedora come with any executable/viewer, just libraries?
03Commenter 2
Could you please point out which release of Fedora you are using and how you have installed Open CASCADE Technology there (regardless of AppImage for FreeCAD, which I suppose is shipped with it's own version of OCCT)?

I'm not very familiar with RPM-based distros...

04Author
Running the latest Fedora F32 here.

These are the OpenCascade packages installed on my fairly basic workstation:
opencascade-foundation.x86_64 7.4.0-3.fc32 @fedora
opencascade-modeling.x86_64 7.4.0-3.fc32 @fedora
opencascade-ocaf.x86_64 7.4.0-3.fc32 @fedora
opencascade-visualization.x86_64 7.4.0-3.fc32 @fedora

KiCad version:
kicad.x86_64 1:5.1.6-1.fc32 @updates
kicad-doc.noarch 1:5.1.6-1.fc32 @updates
kicad-packages3d.noarch 1:5.1.6-1.fc32 @updates

FreeCAD version:
freecad.x86_64 1:0.18.4-10.fc32 @updates
freecad-data.noarch 1:0.18.4-10.fc32 @updates

These versions of KiCad and FreeCAD both have the same issue with this specific STEP file: all colors lost.

In addition, I just checked the latest FreeCAD AppImages, downloaded from here:
https://wiki.freecadweb.org/AppImage
FreeCAD_0.18-16146-Linux-Conda_Py3Qt5_glibc2.12-x86_64.AppImage
FreeCAD_0.19-22522-Linux-Conda_glibc2.12-x86_64.AppImage

I assume they come with their own stand-alone OpenCascade libs included. Same issue in FreeCAD AppImage v.18, but _all_colors_there_ in v.19!

Clicking Help -> About FreeCAD -> Libraries shows:
FreeCAD AppImage v.18: Open CASCADE Technology 7.3.0
FreeCAD AppImage v.19: Open CASCADE Technology 7.4.0

Maybe it's not in the OpenCascade lib itself but in the way it's used/called by these programs?
05Commenter 2
> I assume they come with their own stand-alone OpenCascade libs included.
> Same issue in FreeCAD AppImage v.18, but _all_colors_there_ in v.19!
> - FreeCAD AppImage v.18: Open CASCADE Technology 7.3.0
> - FreeCAD AppImage v.19: Open CASCADE Technology 7.4.0
As you can see on attached screenshots Attachment 10 (PNG) and Attachment 11 (PNG) - there was indeed some issue corrected in OCCT 7.4.0 release affecting colors.
So that newer FreeCAD based on OCCT 7.4.0 seems to be affected by this fix (or has their own bug-fix)...

But what does FreeCAD is not necessary the same as KiCad.
STEP files might define colors in different ways, so that propagating these colors might be tricky and error-prone.
If KiCad uses it's own way for dispatching colors from STEP file, this code might contain a bug.

06Commenter 2
> These are the OpenCascade packages installed on my fairly basic workstation:
> opencascade-foundation.x86_64 7.4.0-3.fc32 @fedora
I cannot find any "opencascade" packages in Software Manager in Fedora - do I need adding some additional repositories?
07Author
> I cannot find any "opencascade" packages in Software Manager in Fedora -
> do I need adding some additional repositories?

The easiest is to install FreeCAD and KiCad from the command line:
  dnf install freecad*
  dnf install kicad*
All dependencies including OpenCascade will be selected for installation as well.
08Author
>> I assume they come with their own stand-alone OpenCascade libs included.
>> Same issue in FreeCAD AppImage v.18, but _all_colors_there_ in v.19!
>> - FreeCAD AppImage v.18: Open CASCADE Technology 7.3.0
>> - FreeCAD AppImage v.19: Open CASCADE Technology 7.4.0
> As you can see on attached screenshots Attachment 10 (PNG) and Attachment 11 (PNG) -
> there was indeed some issue corrected in OCCT 7.4.0 release affecting colors.
> So that newer FreeCAD based on OCCT 7.4.0 seems to be affected by this fix (or has their own bug-fix)...

I haven't seen here what's shown in Attachment 10 (PNG): it's all gray in FreeCAD ImageApp v.0.18 (7.3.0) and fully colored in ImageApp v.0.19 (7.4.0).
In the FreeCAD 0.18 that comes with F32 and uses the shared libraries (7.4.0) everything is gray, just like in KiCad using these shared libs.

Let me check if I can install the KiCad nightly on this system to see what happens.
09Author
> Let me check if I can install the KiCad nightly on this system to see what happens.

Just checked the latest KiCad nightly version:
x86_64 100:r20392-12a30c43.fc32 @copr:copr.fedorainfracloud.org:group_kicad:kicad
Same issue: this specific step component all gray
10Commenter 2
> In the FreeCAD 0.18 that comes with F32 and uses the shared libraries (7.4.0) everything is gray, just like in KiCad using these shared libs.

In that case, I suppose, that FreeCAD team has fixed some bug in their code.
11Author
Going back to the KiCad people with this one...
12Commenter 2
Installed Draw Harness in Fedora 32:
sudo dnf install opencascade-draw
sudo dnf install opencascade-devel 
dnf info opencascade-draw


As Draw Harness package is broken in Fedora, reconstruct minimal environment for loading plugins and start DRAWEXE:
export CSF_OCCTResourcePath=/usr/share/opencascade/resources
export DRAWHOME="${CSF_OCCTResourcePath}/DrawResources"
export CSF_DrawPluginDefaults=${DRAWHOME}
DRAWEXE


Execute Tcl script in Draw:
pload XDE OCAF VISUALIZATION
ReadStep D $::env(HOME)/Downloads/Attachment 12 (STEP)
vinit View1
XDisplay -dispMode 1 D
vfit
vviewparams -scale 36 -proj 0.5 0.8 0.3 -up -0.4 0.5 -0.8 -at 0.7 3.1 0.3
dver


STEP file is opened colored - so either KiCad has error in logic, or it uses some OCCT function affected by problem, but not used by XDisplay (I don't know if such function exists). So it would be useful to find out the code responsible for reading STEP / taking colors in KiCad.

It is weird that OCCT on Fedora is built without FreeImage (necessary for image loading/saving), but with TBB (optional)....
Draw[1]> Draw[2]> dver
Open CASCADE Technology 7.4.0.beta
TBB enabled (HAVE_TBB)
FreeImage disabled
FFmpeg disabled
OpenGL: desktop
RapidJSON disabled
VTK enabled (HAVE_VTK)
Exceptions enabled
Compiler: GCC 10.0.1
Architecture: AMD64
OS: Linux


13Commenter 13
I also remark that it is a beta version!
14Author
Confirming that this issue has been fixed now downstream in the latest releases of KiCad as well as FreeCAD.
Tnx all!
15Commenter 2
Dear Commenter 1,

please close the issue as not reproducible.