8

I'm new to Mathematica and trying to draw a dodecahedron. Here's my code and output:

Show[Graphics3D[{Opacity[0.15], Purple, 
   Dodecahedron[0.72`]}, {Background -> None, ViewPoint -> Above, 
   Boxed -> False}]]

enter image description here

Is there a way I can dash only the invisible edges of this solid? I noticed some examples have shown that we could make all edges have the same property, but I wonder if I could only dash part of them.

Update: I used the function Graphics3DSketch to do that:

Graphics3DSketch[
 Graphics3D[{PolyhedronData["Dodecahedron", "Polygons"], 
   PolyhedronData["Dodecahedron", "Lines"]}, Boxed -> False]
 , ViewPoint -> Above
 ]

Looks like it works, but the graph is out of the range. How can I adjust that? Also, is there a way I can rotate the view clockwise by a certain amount? enter image description here Thanks for the help:)

IGY
  • 247
  • 1
  • 4
  • 2
    Possible duplicate: https://mathematica.stackexchange.com/questions/45410/sketch-type-graphics-with-transparency-and-dashed-hidden-lines/45435#45435. Related: https://mathematica.stackexchange.com/a/21079 – Michael E2 Aug 07 '21 at 02:19
  • @Michael E2 Thanks for the comment, I just updated my question:) – IGY Aug 07 '21 at 04:48

1 Answers1

8

There seems to be no automatic way to get the image range set right, so I used ViewAngle. You can rotate the orientation of the view using ViewVertical.

foo = ResourceFunction["Graphics3DSketch"];

amount = 37.5 Degree; ggg = foo[ Graphics3D[{PolyhedronData["Dodecahedron", "Polygons"], PolyhedronData["Dodecahedron", "Lines"]}, Boxed -> False], ViewPoint -> Above, ViewAngle -> 40 Degree, ViewVertical -> {Cos[amount], Sin[amount], 0}]; ggg

Michael E2
  • 235,386
  • 17
  • 334
  • 747