POV-Ray : Newsgroups : povray.general : torus arrows : Re: torus arrows Server Time
19 Apr 2024 01:00:13 EDT (-0400)
  Re: torus arrows  
From: Alain
Date: 9 Nov 2016 19:28:51
Message: <5823bf43$1@news.povray.org>

> Dear  povray community,
>
> I am totally new to Povray, but am very interested to learn how to draw
> torus arrows, like the second figure on
>  http://www.povray.org/documentation/view/3.6.1/15/
> (Does anyone have the script for this figure?)
>
> I found a script like this
>
> union
> {
> //  cone {-2*z,0.0, -2*z+1*x,0.3 }
>
>   cone {-2*y-2*x,0.0, -2,0.3 }
>   difference {
>     torus { 2,0.1 }
>     box { <1,-1,0>,<-2,1,6> }
>   }
>   pigment { Green  }
>  no_shadow
>  translate <4,4,0>
>   // apply texture as needed
> }
First, the object defined above:
It's a torus with a chunk removed by the box.
To it, is added a cone.

The center of the torus start at the origin and is later moved to the 
location <4,4,0> or 4 unit to the right or +X and 4 units up or +Y. 
There is no displacement along the Z axis, the zero value.
The "no_shadow" purpose is to suppress the casting of a shadow by the 
object. It may not be usefull to you and can be removed.

>
> But the arrow does not go to the location that I want. Also I do not understand
> cone{-2*z,0.0, -2*z+1*x,0.3}.
>
> Any help is greatly appreciated!
>
> Best regards,
>
> Guoping Zhang
>
>
>
>
>
>

For "cone(-2*z,0.0, -2*z+1*x,0.3)", you are seeing an alternate notation 
that take advantage of some shortcuts.
It evaluate as :
  cone{ <0, 0, -2>, 0, <1, 0, -2>, 0.3}
That's a cone pointing right with a base radius of 0.3 unit and tapering 
to a tip of 0 unit radius. It's length is 1 unit parallel to the X axis.
Note : a cone can take a negative radius. In this case, you'll get a 
double cone. You can try this :
cone{2*x, 2, -2*x, -2 pigment{rgb 1} inside_texture{pigment{rgb<0,0,1>}}}
Yes, the left part IS blue.

The complete object is a 3/4 of a torus with a major radius of 2 units 
and a minor radius of 0.1 unit and a cone making a circular arrow 
indicating a clockwise rotation. It start at the origin, but gets mooved 
away from it by the translate<4,4,0>.

Start by removing the translate. This put the object back around the 
origin. Give it a name like :
#declare Circular_Arrow = union{...}

If you need to, use "rotate <XRot, YRot, ZRot> to orient it like you 
want. You may want to first rotate it around the Y axis, then tilt it. 
It can be done as follow :
rotate Angle*y rotate <XTilt, 0, ZTilt>

Finally, move it to where you want it to be using your own translate 
statement.
translate My_Location or translate <XPosition, YPosition, ZPosition>


Alain


Post a reply to this message

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