How to color specific parts of an STL object in 3D World Editor

18 vues (au cours des 30 derniers jours)
alexs
alexs le 16 Mar 2023
Commenté : alexs le 18 Mar 2023
Hi,
I am having trouble coloring a CAD model I designed in Fusion360 in the 3D World Editor (Simulink 3D Animation).
When I import an STL file, the 3D World Editor displays a completely grey model, but the original model has multiple colors in specific parts of the model. I followed the steps outlined here: https://www.mathworks.com/help/sl3d/import-stl-and-physical-modeling-xml-files.html
I found a way to color the model with only one color using the diffuseColor (SFColor) field, but I cannot find a way to color specific parts of the model with different colors.
If I need to import multiply CAD models, color them separately, and assemble them to make the whole model, how can I export multiple STL files and assemble them together in the editor?
Any assistance would be greatly appreciated.
Thank you in advance.

Réponse acceptée

Jan Houska
Jan Houska le 17 Mar 2023
Hi Alex,
your geometry is most probably a hierarchical tree of Transform nodes that contain Shape nodes. These contain Geometry nodes that describe the body geometry and Appearance nodes that describe the body look. To add color, you create a Material node inside the Appearance node and set its diffuseColor field to the desired color. This is described in the X3D standard. You may also want to take a look at the vrmanipul_global shipping example and examine its node hierarchy. The example contains hierarchically organized individually colored objects, maybe similar to what you are trying to achieve.
Jan

Plus de réponses (0)

Catégories

En savoir plus sur Simulation dans Help Center et File Exchange

Tags

Produits


Version

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by