|
![](/i/fill.gif) |
If I do this:
======================================
#declare H = 2;
#declare X = 90;
#declare R = .2;
#declare Fletxa = object {
intersection {
torus {
// we want X/360 * circumference of torus to equal H
#declare MajorRad = H*360/(X*2*pi);
MajorRad,
// minor radius = cylinder's radius
R }
#if (X < 180)
intersection {
#else
union {
#end
// cut off the bottom
plane { -z, 0 }
// cut off the other end
plane { z, 0
rotate X*y } }
translate MajorRad*x
rotate -90*x
pigment { rgb 1 }
rotate 90*x
translate <1.06, -0.7, 0> + Direction*3
rotate <180, 0, 0>
}}
#declare Punta = object {
cone { <0,0,0>,0.5,<1.5,0,0>,0
pigment { rgb 1 } }
scale 0.5
translate <1.5, 3, 0> + Direction*3
rotate <0, 180, 180>
}
union {
object { Fletxa }
object { Punta }
translate <6, 0, 0> + Direction }
======================================
When I translate all the union, the cylinder isn't moving following the
torus. Why? They are into an union, so, the translate vector should move all
the object. Isn't it?
Regards,
Oleguer
news:42edea9c@news.povray.org...
> Hi Slime and all,
>
> Using your code like this:
> ======================================
> #declare H = 2;
> #declare X = 90;
> #declare R = .2;
>
> #declare Fletxa = object {
> intersection {
> torus {
> // we want X/360 * circumference of torus to equal H
> #declare MajorRad = H*360/(X*2*pi);
> MajorRad,
> // minor radius = cylinder's radius
> R }
> #if (X < 180)
> intersection {
> #else
>
> union {
> #end
> // cut off the bottom
> plane { -z, 0 }
> // cut off the other end
> plane { z, 0
> rotate X*y } }
>
> translate MajorRad*x
> rotate -90*x
> pigment { rgb 1 }
> rotate 90*x
> translate <0, 0, 0> + Direction
> }}
>
> #declare Punta = object {
> cone { <0,0,0>,0.5,<1.5,0,0>,0
> pigment { rgb 1 } }
> scale 0.5
> translate <0, 6, 0> + Direction
> }
>
> union {
> object { Fletxa }
> object { Punta rotate <0, 90, 0> } }
> ======================================
> How can I calculate the position of the cone the place it exactly on the
> end of the torus?
>
> Regards,
> Oleguer
>
>
> news:42ebcc73@news.povray.org...
>> Hi all,
>>
>> Yeah, you've used a torus to do it.
>>
>> Sorry for the late reply, I was outside of Lleida.
>>
>> Thanks,
>> Oleguer
>>
>>
>>
>>
>> news:42e2ca2c$1@news.povray.org...
>>>> But, should be a way to turn the cylinder like a half torus and I don't
>>> know
>>>> how can I do it.
>>>
>>> I'm not quite sure what you're asking if my reply didn't answer it.
>>>
>>> Let's say you had a cylinder, along the Y axis from <0,0,0> to <0,H,0>
>>> with
>>> radius R. You want to curl the cylinder by X degrees towards the x-axis.
>>> You
>>> could do it like this:
>>>
>>> #declare H = 2;
>>> #declare X = 90;
>>> #declare R = .2;
>>>
>>> intersection {
>>> torus {
>>> // we want X/360 * circumference of torus to equal H
>>> #declare MajorRad = H*360/(X*2*pi);
>>> MajorRad,
>>> // minor radius = cylinder's radius
>>> R
>>>
>>> }
>>>
>>> #if (X < 180)
>>> intersection {
>>> #else
>>> union {
>>> #end
>>> // cut off the bottom
>>> plane {
>>> -z,0
>>> }
>>> // cut off the other end
>>> plane {
>>> z,0
>>> rotate X*y
>>> }
>>> }
>>>
>>> translate MajorRad*x
>>> rotate -90*x
>>>
>>> pigment {rgb 1}
>>>
>>> rotate 90*x
>>> }
>>>
>>> It sounds like you want X = 180 if you want "half a torus." Watch what
>>> happens as you bring X from 0 to 90, 180 and even up to 360.
>>>
>>> - Slime
>>> [ http://www.slimeland.com/ ]
>>>
>>>
>>
>>
>
>
Post a reply to this message
|
![](/i/fill.gif) |