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

조회 수: 23 (최근 30일)
alexs
alexs 2023년 3월 16일
댓글: alexs 2023년 3월 18일
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.

채택된 답변

Jan Houska
Jan Houska 2023년 3월 17일
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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by