1
$\begingroup$

I know how to put a sphere inside a dodecahedron but instead of a sphere I would like it to be another dodecahedron. How can I do it?

Graphics3D[{{Opacity[.3], FaceForm[Yellow], 
   PolyhedronData["Dodecahedron", "Faces"]}, Brown, Sphere[{0, 0, 0}],
   Boxed -> False}]

enter image description here

$\endgroup$
1
  • 3
    $\begingroup$ Graphics3D[{{Opacity[.3], FaceForm[Yellow], Scale[PolyhedronData["Dodecahedron", "Faces"], #] & /@ Range[.1, 1, .1]}}] $\endgroup$
    – Kuba
    Mar 26, 2014 at 22:24

2 Answers 2

6
$\begingroup$

Kuba has identified the missing piece of the puzzle in his comment, Scale. With Scale you can make the dodecahedron smaller or larger. Other than that it's just a matter of replacing Sphere.

Graphics3D[{{Opacity[.3], FaceForm[Yellow], 
   PolyhedronData["Dodecahedron", "Faces"]}, Brown, 
  Scale[PolyhedronData["Dodecahedron", "Faces"], 0.5]},Boxed -> False]

dodec

Note where I placed Boxed. You include Boxed -> False but because its position is wrong it doesn't actually do anything in your example.

$\endgroup$
1
$\begingroup$

I personally tend to avoid using things like Scale[] when applying transformations to primitives. Instead, I just apply TransformationFunction[] objects directly to primitives, one way or another. As an example,

dod = PolyhedronData["Dodecahedron", "GraphicsComplex"];
ir = PolyhedronData["Dodecahedron", "Inradius"];
sc = ScalingTransform[RootReduce[ir/PolyhedronData["Dodecahedron", "Circumradius"]]
                      {1, 1, 1}];

Graphics3D[{{Opacity[0.4, Yellow], dod}, {Opacity[0.6, LightBlue], Sphere[{0, 0, 0}, ir]},
            {Green, MapAt[sc, dod, 1]}}, Boxed -> False]

inscribed dodecahedron

Graphics3D[{EdgeForm[GrayLevel[0, 1]], {Opacity[0.3, Orange], dod},
            {Yellow, MapAt[sc, dod, 1]}}, Boxed -> False]

two dodecahedra

$\endgroup$
1
  • $\begingroup$ @Christopher, sorry about that; should be fixed now. $\endgroup$ May 8, 2020 at 0:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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