|
|
Paul Bourke wrote:
> I've created the first three platonic solids as "solid" objects
> in POVRay so I do CSG operations on them. Before I give myself a
> headache doing the icosahedron and dodecahedron I though I would
> ask if someome has already done it.....and would care to share them.
// why not
intersection {
#local sX=-1;#while(sX<2)
#local sY=-1;#while(sY<2)
#local sZ=-1;#while(sZ<2)
plane { <sX,sY,sZ>,sqrt(1/3) }
bounded_by { box { -1,1 } }
}
for the octohedron?
For the other two:
#local sA=sqrt(.3125)+.25;
#local sB=.5;
#declare Dodecahedron= intersection {
plane { < sA, sB,0>,.5 }
plane { <0, sA, sB>,.5 }
plane { < sB,0, sA>,.5 }
plane { <-sA, sB,0>,.5 }
plane { <0,-sA, sB>,.5 }
plane { < sB,0,-sA>,.5 }
plane { < sA,-sB,0>,.5 }
plane { <0, sA,-sB>,.5 }
plane { <-sB,0, sA>,.5 }
plane { <-sA,-sB,0>,.5 }
plane { <0,-sA,-sB>,.5 }
plane { <-sB,0,-sA>,.5 }
}
#declare Icosahedron = intersection {
plane { < sA+sB, sB,0>,.5 }
plane { <0, sA+sB, sB>,.5 }
plane { < sB,0, sA+sB>,.5 }
plane { <-sA-sB, sB,0>,.5 }
plane { <0,-sA-sB, sB>,.5 }
plane { < sB,0,-sA-sB>,.5 }
plane { < sA+sB,-sB,0>,.5 }
plane { <0, sA+sB,-sB>,.5 }
plane { <-sB,0, sA+sB>,.5 }
plane { <-sA-sB,-sB,0>,.5 }
plane { <0,-sA-sB,-sB>,.5 }
plane { <-sB,0,-sA-sB>,.5 }
plane { <-sA,-sA,-sA>,.5 }
plane { < sA,-sA,-sA>,.5 }
plane { <-sA, sA,-sA>,.5 }
plane { < sA, sA,-sA>,.5 }
plane { <-sA,-sA, sA>,.5 }
plane { < sA,-sA, sA>,.5 }
plane { <-sA, sA, sA>,.5 }
plane { < sA, sA, sA>,.5 }
}
Hope this helps,
John
Post a reply to this message
|
|