realthunder / FreeCAD

Link branch FreeCAD
Other
799 stars 46 forks source link

Vertex color not exported to .step file #629

Open WinstonMechanics opened 2 years ago

WinstonMechanics commented 2 years ago

Hi!

I noticed that face and line color are correctly exported into the .step file but vertex color seems not to be transferred into the .step file.

The exported model should have vertex color as red (255, 0, 0), edge color as green (0, 255, 0) and face color as blue (0, 0, 255). Changing export scheme to AP203, AP214 or AP242 did not seem to have any effect.

Is there a way to enable export of vertex color?

Freecad version: FreeCAD-asm3-Daily-Conda-Py3-Qt5-20221021-glibc2.12-x86_64.AppImage

Body in Part Design: coloredBody Exported Body: exportedBody Step import and export settings: exportSettings

stepColorIssue.zip

realthunder commented 2 years ago

AFAIK, STEP do not support vertex color. Maybe some later version supports it, but OCC has no API to export/import the vertex color.

WinstonMechanics commented 2 years ago

Thanks for the info!

I’ve been mostly using color to automate a preprocessing task for FEA/CFD use which works great with models that have boundary conditions set to faces or lines, but occasionaly there’s a need to work with vertices too. E.g set all green vertices as supports and all red vertices as loads for FEA.

Would there be a way to include some kind of metadata into the step model using OCC if color export is currently not supported for vertices?