Importing Step with Colors

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
NF6X
Posts: 6
Joined: Thu Sep 17, 2020 6:30 pm
Location: Riverside, CA, USA
Contact:

Importing Step with Colors

Post by NF6X »

Hi, everybody! This is my first post here, and I hope I'm doing it properly. I'm an electrical engineer who sometimes LARPs as a mechanical engineer. I've been using Fusion 360 for CAD/CAM (I have separate paid accounts for both personal stuff and my day job), but I'd sure like to get away from that locked-in cloud-based stuff. I'm giving FreeCAD v0.19 a look, but the first issue I've encountered is a show-stopper for me. I hope I'm just doing something wrong and it's not a FreeCAD 0.19 limitation.

First, for background, my main use cases for CAD/CAM are:

1) Preparing component CAD models for use in KiCad for PCB layout. Sometimes I make them from scratch, and sometimes I can get them from component manufacturers. Even when I can get them from others, I'll almost always need to do at least some minimal editing to position the model vs. the coordinate origin. Including face colors is critical for this application, and STEP is the necessary interchange format.

2) Designing stuff for 3D printing. I export to STL and slice in Simplify 3D.

3) Designing stuff for CNC milling. I use the CAM features in Fusion 360 to generate my G-code.

My issue here is that when I import a STEP model into FreeCAD, all of the face color details appear to be lost. I'm attaching a STEP model that I downloaded from a component manufacturer. It would need some CAD work to orient it properly for use in KiCad, but I'm showing it here just as I downloaded it after import into each tool.

When I import the STEP model into Fusion 360, I'm pleased to see that the manufacturer applied face colors to mimic the visual appearance of the real component. Model quality from manufacturers varies a lot, and this is one of the better examples. My next step would normally be to rotate and translate the model to be in the right position vs. the coordinate origin, which is also the component placement centroid in the PCB CAD tool.
Manufacturer's STEP model imported into Fusion 360.
Manufacturer's STEP model imported into Fusion 360.
Fusion360.png (284.42 KiB) Viewed 5963 times

Here's the same STEP model imported into KiCad. The orientation is all wrong, but that's OK. I'm just showing that KiCad recognizes the face colors.
Manufacturer's STEP model imported into KiCad.
Manufacturer's STEP model imported into KiCad.
KiCAD.png (201.94 KiB) Viewed 5963 times

Now, when I import the exact same file into FreeCAD 0.19, it appears as a plain gray object.
Manufacturer's STEP model imported into FreeCAD 0.19.
Manufacturer's STEP model imported into FreeCAD 0.19.
FreeCAD.png (226.18 KiB) Viewed 5963 times

Let's see if it's a display issue vs. the face color information really being lost: I'll export the object from FreeCAD in STEP format and then import that into KiCad.
STEP model re-exported from FreeCAD and then imported into KiCad.
STEP model re-exported from FreeCAD and then imported into KiCad.
KiCAD2.png (198.01 KiB) Viewed 5963 times

Indeed, the face color information seems to be gone. Am I doing something wrong (i.e., is this a help request?), or is this a a FreeCAD 0.19 limitation (i.e., is this a bug report or feature request?). I sure hope it's the former, because this would be a show-stopper for me to switch from Fusion 360 to FreeCAD today.

I really do hope to switch to FreeCAD someday when we're ready for each other! While it would be nice to not have to spend $500 per year on Fusion 360, the money isn't my main motivation. The real reasons I'd like to be able to switch are:

1) Remove vendor lock-in, and replace it with an open codebase that I could hypothetically maintain myself if it got orphaned for my use case.

2) No cloud-based shenanigans. I have a bad rural last-mile Internet connectivity problem at home. It's not such a big deal at work, but I've been holed up at home for six months due to the pandemic and my connectivity here is bad!

3) Linux support. I'm currently mostly happy with macOS, but I have reasons to suspect that Apple and I will have to part ways eventually. Fusion 360 currently only supports Windows and macOS, and I hate Windows. I can work happily in Linux if I have to with some minor changes in which specifc things I complain about vs. macOS. :)

It'll be great if we can start to see FcStd support in more places, and KiCad would naturally be a good candidate to join that club. But the fact remains that today, if I get a CAD model from a manufacturer, it's almost certainly going to have been created in SolidWorks or one of its direct competitors, and the most common cross-platform interchange format is STEP. Good STEP support is necessary today, even with the limitations of it being closer to binary object code than to source code.

Here are the details of the FreeCAD version I'm using:
OS: macOS 10.15
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22039 (Git)
Build type: Release
Branch: master
Hash: 2bfc6301bc80c0344cbf13dbfe041fbd78cac93d
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: C/Default (C)
Attachments
mps_dcdc_mtu1_mc_a.step.zip
STEP model downloaded from component manufacturer.
(746.32 KiB) Downloaded 79 times
chrisb
Veteran
Posts: 54075
Joined: Tue Mar 17, 2015 9:14 am

Re: Importing Step with Colors

Post by chrisb »

And this is how it looks in FreeCAD. As it may have to do with your preferences, I show them as well:
Bildschirmfoto 2020-09-17 um 23.06.10.png
Bildschirmfoto 2020-09-17 um 23.06.10.png (69.77 KiB) Viewed 5938 times
OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22411 (Git)
Build type: Release
Branch: master
Hash: d4519d5aec15bc08f029da5ed15410a494b57b2c
Python version: 3.8.5
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: C/Default (C)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
NF6X
Posts: 6
Joined: Thu Sep 17, 2020 6:30 pm
Location: Riverside, CA, USA
Contact:

Re: Importing Step with Colors

Post by NF6X »

I have not managed to find a preference pane with STEP import options yet. Where should I look? This is what my import/export preferences pane looks like:
Import/Export Preferences
Import/Export Preferences
Preferences.png (237.88 KiB) Viewed 5936 times
NF6X
Posts: 6
Joined: Thu Sep 17, 2020 6:30 pm
Location: Riverside, CA, USA
Contact:

Re: Importing Step with Colors

Post by NF6X »

Ok, this is weird. After I imported the model (with face colors lost), I opened Preferences again. This time, some more tabs, including STEP, appeared. I changed the import settings from their initial default values to what you show. Default settings have only the "Enable STEP Compound Merge" import option checked.
Preferences STEP tab appeared after importing a STEP file.
Preferences STEP tab appeared after importing a STEP file.
Preferences2.png (230.56 KiB) Viewed 5934 times

Then I deleted the boring, gray document I had just imported into, and imported the model into a new document:
Model imported again after changing STEP import settings.
Model imported again after changing STEP import settings.
FreeCAD2.png (230.43 KiB) Viewed 5934 times

I exited FreeCAD, restarted it, and opened the Preferences window again. Import/export tabs including STEP were gone again, but the settings I had changed were persistent and the model imported with its colors again. After some more experimentation, it appears to be the "Enable STEP Compound Merge" option (on by default) which makes the colors go away.

This appears to boil down to:

1) Default STEP import settings which apparently have a side effect of eliminating face color information in the models I commonly work with.

2) A bug prevening the IGES and STEP tabs from showing up in the Preferences pane until after a STEP file is imported during the same session.

I'll research and experiment to figure out what the various import options mean, and I'll see if I can report a bug about the IGES and STEP import/export tabs not appearing initially after launch.

Yay!
chrisb
Veteran
Posts: 54075
Joined: Tue Mar 17, 2015 9:14 am

Re: Importing Step with Colors

Post by chrisb »

In FreeCAD not all modules are loaded at startup. And if they arent't loaded their preferences don't show up. This includes the step import. Unlike other workbenches such as Draft or Path you cannot load the step module explicitely.

Concerning the colors: It is plausible that the colors are not preserved when an object consisting of many colored parts is combined into one.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
NF6X
Posts: 6
Joined: Thu Sep 17, 2020 6:30 pm
Location: Riverside, CA, USA
Contact:

Re: Importing Step with Colors

Post by NF6X »

chrisb wrote: Thu Sep 17, 2020 10:11 pm In FreeCAD not all modules are loaded at startup. And if they arent't loaded their preferences don't show up. This includes the step import. Unlike other workbenches such as Draft or Path you cannot load the step module explicitely.
So, the only way to change STEP import/export preferences is to import/export a STEP file first? That seems like a cumbersome and counterintuitive chicken/egg issue to me, but I can work around it now that I know it's there.
chrisb wrote: Thu Sep 17, 2020 10:11 pm Concerning the colors: It is plausible that the colors are not preserved when an object consisting of many colored parts is combined into one.
That makes sense to me. It seems plausible to me that I'm only seeing this side-effect because of characteristics of the particular models I have been working with.

Anyway, thank you for your help in figuring this out! Now I can move ahead with learning FreeCAD and evaluating it to see if it's time for me to make the switch.
User avatar
Roy_043
Veteran
Posts: 8512
Joined: Thu Dec 27, 2018 12:28 pm

Re: Importing Step with Colors

Post by Roy_043 »

NF6X wrote: Thu Sep 17, 2020 10:24 pm So, the only way...
No. See here: Import_Export_Preferences#STEP.
NF6X
Posts: 6
Joined: Thu Sep 17, 2020 6:30 pm
Location: Riverside, CA, USA
Contact:

Re: Importing Step with Colors

Post by NF6X »

Roy_043 wrote: Fri Sep 18, 2020 7:59 am
NF6X wrote: Thu Sep 17, 2020 10:24 pm So, the only way...
No. See here: Import_Export_Preferences#STEP.
Aha! Thank you.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Importing Step with Colors

Post by Kunda1 »

NF6X wrote: Fri Sep 18, 2020 9:45 am
@NF6X, thanks for posting this question. So as you're migrating you're finding that STEP format is the one that works best as a workflow to migrate from Fusion to FC ?
Working on a guide and so this info would be helpful.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
NF6X
Posts: 6
Joined: Thu Sep 17, 2020 6:30 pm
Location: Riverside, CA, USA
Contact:

Re: Importing Step with Colors

Post by NF6X »

Kunda1 wrote: Sun Sep 20, 2020 2:06 pm
NF6X wrote: Fri Sep 18, 2020 9:45 am
@NF6X, thanks for posting this question. So as you're migrating you're finding that STEP format is the one that works best as a workflow to migrate from Fusion to FC ?
In my very limited experience, STEP appears to be the most common exchange format for solid models between different tools. My experience might be biased, because I work with KiCad a lot for PCB design, where STEP and VRML are the only supported formats for component models, and STEP being the only export format for making board models to be be imported into mechanical CAD tools.

As an aside, just yesterday I had trouble exporting a STEP model from Fusion 360 and then importing that model back into Fusion 360. It was corrupted when imported, even though FreeCAD appeared to import it without issues.
Post Reply