To generate a yellow sphere, I usually write the code without using Style
:
Graphics3D[{Yellow, Sphere[]}]
However, Style
seems to be a more rigorous form in many references:
Graphics3D[Style[Sphere[], Yellow]]
I really seldom use Style
even in more complex and lengthy code project. Should I or not?
Please, your suggestions and comments.
Answer
In Graphics
and Graphics3D
Style
behaves mostly as a grouping construct like List
. You can use List
(instead) for most things, even Options like FontSize
or Antialiasing
Graphics3D[{FontSize -> 40, Text["sample"]}]
Graphics[{Circle[{0, 0}, 1], {Antialiasing -> False, Circle[{0, 0}, 0.8]}}]
There are however directives that only work in Style
, e.g. styles defined in the style sheets:
Graphics3D[Style[Text["sample"], "Title"]]
Graphics3D[Style[Text["sample"], "TI", 40]]
This is not valid input:
Graphics3D[{"TI", 40, Text["sample"]}] (* bad input *)
Comments
Post a Comment