Create mesh from shape - missing 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
Sowelu
Posts: 1
Joined: Tue Feb 25, 2020 10:20 pm

Create mesh from shape - missing color

Post by Sowelu »

Hi,

I am trying to export colored step file to a mesh file (such as .obj) with the color retained.

STEP File:
https://drive.google.com/drive/folders/ ... 7rxKrN4xxQ

The problem is that when I go to Mesh Design, select the model, then Meshes -> Create Mesh From shape... -> Standard -> Apply face colors to mesh; the created mesh is one color only, ignoring the color on faces.

I tried pretty much everything in the last seven-ish hours and I am at a loss. I am completely new to FreeCAD so I have hard time figuring out even the basic concepts. From what I read and guessed the STEP file contains a (compound?) shape made from one material and with colored faces. I tried the same process by creating a simple cube and coloring it's sides differently and it worked perfectly.
Therefore I assumed that the problem is in the shape and I need break it down to something simpler. After MANY attempts I came to a very limited success where I used the Explode compound and then painstakingly re-colored some of the faces. It worked, however this is not feasible for my purposes as there are hundreds of faces in this model alone and more models are to follow.

At this point I feel I have exhausted my options and I am unable to progress further. I would really appreciate if you could help me.

Partial success file:
https://we.tl/t-HYzG35kCNK
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Create mesh from shape - missing color

Post by wmayer »

The mapping of the face colors to the mesh triangles fails because the STEP model has two (invalid?) faces that cannot be meshed.
FreeCAD doesn't handle this situation correctly because it counts the number of face colors (here 272) and number of valid faces (here 270) that can be meshed. But because the two numbers are different it just won't do the color mapping.

This is fixed now with git commit 43e6be902
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Create mesh from shape - missing color

Post by wmayer »

Attached is a zip file with the colored obj file.
Attachments
test-file.zip
(268.57 KiB) Downloaded 15 times
PanicPug
Posts: 2
Joined: Sun May 24, 2020 4:48 pm

Re: Create mesh from shape - missing color

Post by PanicPug »

Do you have an idea when this fix might be released? Because if I see it correctly there hasn't been a new release in over half a year.
If not: is there a workaround until then?
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Create mesh from shape - missing color

Post by TheMarkster »

PanicPug wrote: Sun May 24, 2020 4:51 pm Do you have an idea when this fix might be released? Because if I see it correctly there hasn't been a new release in over half a year.
If not: is there a workaround until then?
It should be part of one of the regular 0.19 pre-release builds within a week or so. Scroll down on the downloads page and click the link to the development releases.
PanicPug
Posts: 2
Joined: Sun May 24, 2020 4:48 pm

Re: Create mesh from shape - missing color

Post by PanicPug »

I did that, but if I see correctly this is from November, whereas the fix is from this February, or am I missing something?
https://github.com/FreeCAD/FreeCAD/rele ... g/0.19_pre

I also in the meantime found out, that this is not the only solution to my problem, but with the other way I can try I'm being stopped at another problem (https://forum.freecadweb.org/viewtopic.php?t=38440) So I'd like to ask if there's a way to either change all the shape colors to the material colors, or where I can see and manage the materials or something that'll help me. But this topic is probably not right for that, so if you could tell me where I'd best do that, it'd be much appreciated :)
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Create mesh from shape - missing color

Post by TheMarkster »

Sorry, I didn't notice the date on Werner's post was from February. The update is now in the latest 0.19 builds. To check the release date on your version you are using, go to the Help menu -> about FreeCAD. You can use the copy to clipboard function to paste it to the board. My version information:

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21125 (Git)
Build type: Release
Branch: master
Hash: 40600a55c2fe71ff589be677f6e427ccc937d003
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)

My release date: 2020/05/19

Ensure you have the latest version before proceeding to further troubleshooting, is my suggestion.
Post Reply