POV-Ray : Newsgroups : povray.advanced-users : Ok, seriously, I need help here.. : Re: Ok, seriously, I need help here.. Server Time
5 Jul 2024 16:27:28 EDT (-0400)
  Re: Ok, seriously, I need help here..  
From: Alain
Date: 2 Mar 2008 13:13:10
Message: <47caee36$1@news.povray.org>
Patrick Elliott nous apporta ses lumieres en ce 2008/03/01 23:31:
> To be more specific. This is what it looks like, when everything is 
> where is supposed to be, except the fill in for the sides:
> 
> camera{
>         orthographic
>         location <0,0,-3> look_at <0,0,0> angle 60
>         right x up y
> }
> 
> light_source{<5,5,-10>,1.5}
> 
> #declare octaside = 
> //intersection {
>   union {
>     sphere {<-1,0,0>,0.075}
>     sphere {<1,0,0>,0.075}
>     sphere {<0,sqrt(2),0>,0.075}
>     cylinder {<-1,0,0>,<1,0,0>,0.075}
>     cylinder {<0,sqrt(2),0>,<1,0,0>,0.075}
>     cylinder {<-1,0,0>,<0,sqrt(2),0>,0.075}
>     texture {
>       pigment {rgb <1,1,1>}
>     }
>     //triangle {<-1,0,-0.075>,<0,sqrt(2),-0.075>,<1,0,-0.075>}
>     //triangle {<-1,0,0.075>,<0,sqrt(2),0.075>,<1,0,0.075>}
>   rotate <45,0,0> // test purposes, move to last statement in final 
> object, with translate.
>   translate <0,0,-1>
>   }
> //  box {<-1,0,-0.075>,<1,sqrt(2),0.075>}
> //
> //}}
> 
> union {
>   object {octaside}
>   object {octaside
>     rotate <0,90,0>}
>   object {octaside
>     rotate <0,180,0>}
>   object {octaside
>     rotate <0,270,0>}
>   union {
>     object {octaside}
>     object {octaside
>       rotate <0,90,0>}
>     object {octaside
>       rotate <0,180,0>}
>     object {octaside
>       rotate <0,270,0>}
>     rotate <0,0,180>
>   }  
>   rotate <0,10,0>
> }
As it is now, you construct a single face with 3 spheres, 3 cylinders, a visible 
triangle, and an other triangle that will never show.
You then combine eight of those to form the complete shape, with 4 spheres at 
each summits and 2 sylinders at each edges, resulting in many coincident surfaces.
Triangles are only single faces objects with no inside.

You can create your octaedron from the intersection of 8 planes.
#declare SQ = sqrt(2);
intersection{plane{<0,1,SQ>,1}
	plane{<0,1,SQ>,1 rotate 90*y}
	plane{<0,1,SQ>,1 rotate 180*y}
	plane{<0,1,SQ>,1 rotate 270*y}
	plane{<0,-1,SQ>,1}
	plane{<0,-1,SQ>,1 rotate<0,90,0>}
	plane{<0,-1,SQ>,1 rotate<0,180,0>}
	plane{<0,-1,SQ>,1 rotate<0,270,0>}
	}


This give you an octaedron with sharp edges. You can then chop those edges using 
12 aditional planes. Now, add in an union the spheres and cylinders to create 
the rounded edges. Only add a single sphere per summit and a single sylinder per 
edge.

If you want it to be transparent, use a merge instead of an union.

-- 
Alain
-------------------------------------------------
Laughter is the shortest distance between two people.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.