8
$\begingroup$

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:)

$\endgroup$
2

1 Answer 1

8
$\begingroup$

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
$\endgroup$
1
  • $\begingroup$ Thanks for the help:) $\endgroup$
    – IGY
    Aug 7, 2021 at 5:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.