Message Boards Message Boards

1
|
3175 Views
|
2 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Change ColorFunction in imported stl file into graphics3D expression?

Posted 3 years ago

I have a .stl file that I want to import into a Graphics3D expression, for which I use the command

Import["ExampleData/seashell.stl", "Graphics3D"]

enter image description here

As you can see, the color function mainly consists of pink and purple, and I want to change it.

Adding the ColorFunction option to the Import command doesn't make any change:

Import["ExampleData/seashell.stl", "Graphics3D", 
 ColorFunction -> "TemperatureMap"(*for example*)]

How can I change the color appearance of the 3D object?

POSTED BY: Ehud Behar
2 Replies
Posted 3 years ago

Thanks!

POSTED BY: Ehud Behar

Ehud,

what you basically need is Show. From documentation:

[Show] shows graphics with the specified options added.

The imported object is a Graphics3D, so you can apply the respective options like so (as an example):

shell = Import["ExampleData/seashell.stl", "Graphics3D"];
Show[shell, BaseStyle -> {Gray, Opacity[.6], Specularity[Red, 8]}, Lighting -> Automatic]

enter image description here

POSTED BY: Henrik Schachner
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract