Exporting STEP loses color

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!
Post Reply
FredB
Posts: 9
Joined: Fri Feb 07, 2020 10:34 pm

Exporting STEP loses color

Post by FredB »

Hi,

Problem: I have a simple model with some colored elements, but when I export the model as a STEP file, the color disappears and the entire model is default gray.

Details:
I have test file where I'm trying to create colored text on the surface of an object. This was the approach:

1 - Used the Draft workbench to create a Shapestring
2 - Used the Part workbench to extrude Shapestring (tried Part Design WB but it failed due to multiple solids)
3 - Used Part Design Workbench to make a rectangular body
4 - Created a clone of the extruded text and made the clone red
5 - Performed a boolean of the original extruded text (not clone) from the rectangular body
6 - Result is red text flush with the surface of the rectangular body

All seemed to work fine. I then exported the cloned red text and the rectangular body as a STEP file. The problem is that when I load the STEP file, the red is gone from the text and it's the same gray as the body. I have tried exporting the STEP file a number of times and it always loses the red of the text. I have built other models that don't have text and exported them and they have retained the color, so I can't figure out what's going on here.

Questions:
1 - Any ideas why the red is disappearing and how to keep it?

2 - Does my approach for creating colored text flush with a surface seem a reasonable way to do it in FreeCAD?

I have attached the FreeCAD and the STEP file I exported.

Thanks


OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4 (GitTag)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
Attachments
Text on Surface.step
(451.9 KiB) Downloaded 27 times
Text on Surface.FCStd
(141.46 KiB) Downloaded 25 times
User avatar
Roy_043
Veteran
Posts: 4802
Joined: Thu Dec 27, 2018 12:28 pm

Re: Exporting STEP loses color

Post by Roy_043 »

#1:
The problem seems to be related to to the multi solid extrusion of the ShapeString. The only solution I can think of is to Draft_Downgrade the ShapeString to get individual faces, and extrude these as separate extrusions.
User avatar
easyw-fc
Veteran
Posts: 3120
Joined: Thu Jul 09, 2015 9:34 am

Re: Exporting STEP loses color

Post by easyw-fc »

FredB wrote: Thu Mar 12, 2020 11:37 pm Problem: I have a simple model with some colored elements, but when I export the model as a STEP file, the color disappears and the entire model is default gray.
your issue is related to the STEP import settings...
just disable 'Enable STEP Compound merge' checkbox and your colour will be displayed

-
step-import.png
step-import.png (81.08 KiB) Viewed 2558 times
fc_tofu
Posts: 654
Joined: Sun Jan 05, 2020 4:56 pm

Re: Exporting STEP loses color

Post by fc_tofu »

FredB wrote: Thu Mar 12, 2020 11:37 pm ...
I have attached the FreeCAD and the STEP file I exported.
...
I can confirm @easy-fc said, both 0.18.4/0.19pre (win10 x64).
FredB
Posts: 9
Joined: Fri Feb 07, 2020 10:34 pm

Re: Exporting STEP loses color

Post by FredB »

easyw-fc wrote: Fri Mar 13, 2020 2:48 pm your issue is related to the STEP import settings...
just disable 'Enable STEP Compound merge' checkbox and your colour will be displayed
Thanks, easyw-fc! As fc_tofu also confirmed, that fixes the problem. But it then raises the question of why does enabling STEP compound merge cause the color to disappear? The tooltip for it says that having it checked results in slower loading but higher details. I assumed higher details was better, but not at the loss of colors. What is the right choice here?

My primary use case for this is creating components for KiCAD that have text on them. KiCAD loads the STEP files and displays the color correctly, but I hate having a file that only loads correctly if a preference is set a certain way. My workaround now is to create a union of the parts, and then re-export the result as a new STEP file. That STEP file will then load and display colors properly regardless of the the option setting.
User avatar
easyw-fc
Veteran
Posts: 3120
Joined: Thu Jul 09, 2015 9:34 am

Re: Exporting STEP loses color

Post by easyw-fc »

FredB wrote: Fri Mar 13, 2020 6:42 pm But it then raises the question of why does enabling STEP compound merge cause the color to disappear? The tooltip for it says that having it checked results in slower loading but higher details. I assumed higher details was better, but not at the loss of colors. What is the right choice here?
that was an old option to speed up the loading time... with FC0.19 this is even less important
FredB wrote: Fri Mar 13, 2020 6:42 pm My primary use case for this is creating components for KiCAD that have text on them. KiCAD loads the STEP files and displays the color correctly, but I hate having a file that only loads correctly if a preference is set a certain way.
it loads as you ask to be loaded ... if you ask for a compound you get a compound
FredB wrote: Fri Mar 13, 2020 6:42 pm My workaround now is to create a union of the parts, and then re-export the result as a new STEP file. That STEP file will then load and display colors properly regardless of the the option setting.
I would suggest to have a look at kicadStepUp WB and its cheatsheet
LuighiV
Posts: 1
Joined: Thu Jul 23, 2020 4:18 am

Re: Exporting STEP loses color

Post by LuighiV »

easyw-fc wrote: Fri Mar 13, 2020 2:48 pm
FredB wrote: Thu Mar 12, 2020 11:37 pm Problem: I have a simple model with some colored elements, but when I export the model as a STEP file, the color disappears and the entire model is default gray.
your issue is related to the STEP import settings...
just disable 'Enable STEP Compound merge' checkbox and your colour will be displayed

-
step-import.png
I had the same problem and the suggestion of @easyw-fc has solved it. However, something to pointing out is that to see these options for STEP export/import preferences, it is required to be in the Part, Part Design or OpenSCAD workbench, otherwise it won't appear. Reference: https://wiki.freecadweb.org/Import_Export_Preferences
Post Reply