|
|
"Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote in
news:Xns### [at] 204213191226:
> I wanted to use sphere_sweep to generate a scalled torus, like
> torus { 10,5 scale <4,1,1>
> *but* I wanted it's section to be a circle (and not to get deformed)
> - so I wanted an cylinder wrapped into elipse shape.
>
> But usig sphere sweep didnt help:
> http://www.raf256.com/3d/torus_as_spline.jpg
>
> as we see in "yellow" segment - section is deformed.
>
> is this a bug or a is this expected behaviour of sphere_sweep?
>
> Sweep is build from points spaced equaly along scalled torus shape:
>
> sphere_sweep {
> linear_spline //cubic_spline
> #local E=45/4; // precission
> (360/E)+3
> #local I=-E; #while (I<=360+E)
> vrotate(<0,0,Major>, <0,I,0>)*Scale, Minor
> #local I=I+E; #end
> }
Try this Rafal:
#declare Major = 5.0;
#declare Minor = 1.5;
#declare Scale = <3.0, 1.0, 0.5>;
difference {
union {
#declare I = 0;
#while (I < 360)
sphere { Scale*vrotate(Major*z, I*y), Minor }
#declare I = I + 1;
#end // while
pigment { color rgb <1, 1, 1> }
}
plane { z, 0 pigment { color rgb <1, 1, 0> } }
}
camera { location -30*z look_at 0*y }
light_source { <1, 4, -4>*100 color rgb <1, 1, 1> shadowless }
background { color rgb <0.5, 0.5, 1> }
Tor Olav
Post a reply to this message
|
|