|
![](/i/fill.gif) |
Le 07/12/2009 21:17, Chris nous fit lire :
> Hi all,
>
> I am running into a problem, I was wondering if POV-Ray had a command similar to
> cylinder, but rather than making rounded edges, the edges were at 90 degree
> angles. And the Radius would be the distance from the center of the square to
> the closest corner?
Nope.
But you can probably make a macro for that using box.
Now, you might need an additional number: the rotation along the axis
#macro Chris_cylinder(a,b,r,o)
//assuming b != a
#local leng=vlength(b-a);
#local wid=r/sqrt(2);
<0,-wid,-wid>,<leng,wid,wid> rotate o*x
rotate vaxis_rotate(x,vcross(x,b-a),vdot(x,vnormalize(b-a)))
translate a
#end
box { Chris_cylinder(<5,10,20>,<4,6,5>,0.6,45) ... }
Now, if it would be a built-in object, the number of sides could be also
an interesting option (yours defaults to 4!)
Post a reply to this message
|
![](/i/fill.gif) |