4

I would like to remove facets from an octahedron 3-compound - like in the picture below.

octahedron 3-compound with holes

I tried to combine these two graphics:

PolyhedronData["OctahedronThreeCompound"] 

and

Graphics3D[{Opacity[0], EdgeForm[Thickness[.03]], 
           {PolyhedronData["OctahedronThreeCompound", "Faces"]}}]

but I failed - any tips on how to get the desired result?

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
mojo risin
  • 41
  • 1

2 Answers2

7

You can't get what you want with EdgeForm[Thickness[.03]], that's not what EdgeForm is meant for (that is, styles for the 1-dimensional edges).

Here is a quick solution based on post-processing:

Manipulate[
    Normal[PolyhedronData["OctahedronThreeCompound", "Faces"]] /.
            p : Polygon[__] :> (
                    p /. pts : {{_?NumericQ, _, _}, __} :>
                            Module[{cent, innervtx},
                                cent = Mean[pts];
                                innervtx = {1 - δ, δ}.{#, cent} & /@ pts;
                                Join[pts, pts[[{1}]], innervtx, innervtx[[{1}]]]
                                ]
                    ) // Graphics3D[{FaceForm[White], EdgeForm[Blue], #}] &,
    {{δ, .1}, .01, .99}]

hollowed OctahedronThreeCompound

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Silvia
  • 27,556
  • 3
  • 84
  • 164
3

Using Heike's reimplementation of the old routine PerforatePolygons[]:

PerforatePolygons[PolyhedronData["OctahedronThreeCompound"], 3/4]

octahedron 3-compound with hollowed-out faces


Now, here is a Texture[]-based dirty trick:

With[{r = 3/4 (* size of hole *)}, 
     hole = First[ImageData[Image[Graphics[
                  {Polygon[CirclePoints[{1, -π/6}, 3]],
                   {White, Polygon[CirclePoints[{r, -π/6}, 3]]}}, 
                  PlotRangePadding -> None]], Interleaving -> False]]];

tex = Transpose[ConstantArray[1 - hole, 4], {3, 1, 2}];

Graphics3D[Prepend[
           Append[#, VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1/2, 1}}] & /@ 
           First[Normal[N[PolyhedronData["OctahedronThreeCompound", "Faces"]]]], 
           Texture[tex]], Boxed -> False]

Look Ma, holes!

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574