|
|
Hi all,
I'd like to cut a torus off from a sphere or cylinder
(difference{sphere{}torus{}}). It works ok, but I'd also like it to work
when the torus intersects itself, i.e., when its "minor" radius is larger
than the "major" one. If I do as before, I get two cusps shapes joined by
an elongated shape, and I want to get rid of this last one, keeping only
the two cusps. Is there some "trick" to get this other than further
differentiating out this elongated shape or defining an isosurface?
I'm talking of something like this, but without having to use and calculate
the box:
camera { location <0,0,-5> }
light_source { <10,10,-10>, rgb 1 }
#declare Rmin=1.1;
#declare Rmaj=1.0;
#if(Rmin>Rmaj)
#declare X=Rmin*sqrt(1-Rmaj*Rmaj/(Rmin*Rmin));
#else
#declare X=0;
#end
difference {
sphere { 0, 1 pigment { color rgb 1 } }
torus { Rmaj, Rmin pigment { color rgb <1,0,0> } }
box { -X,X }
}
I could also use "clipped_by { box { -X,X inverse } }". Would this be more
efficent than differentiating?
--
light_source{9+9*x,1}camera{orthographic look_at(1-y)/4angle 30location
9/4-z*4}light_source{-9*z,1}union{box{.9-z.1+x clipped_by{plane{2+y-4*x
0}}}box{z-y-.1.1+z}box{-.1.1+x}box{.1z-.1}pigment{rgb<.8.2,1>}}//Jellby
Post a reply to this message
|
|