POV-Ray : Newsgroups : povray.general : "square" cylinder Server Time
26 Nov 2024 20:50:59 EST (-0500)
  "square" cylinder (Message 1 to 3 of 3)  
From: Chris
Subject: "square" cylinder
Date: 7 Dec 2009 15:20:01
Message: <web.4b1d62c6195d7b0094e9b2120@news.povray.org>
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?

Chris


Post a reply to this message

From: Le Forgeron
Subject: Re: "square" cylinder
Date: 7 Dec 2009 16:53:56
Message: <4b1d7974$1@news.povray.org>
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

From: gregjohn
Subject: Re: "square" cylinder
Date: 21 Dec 2009 12:50:00
Message: <web.4b2fb4b9db6cdf0e279899c60@news.povray.org>
Do you mean something other than superellipsoids or the Rounded Box macros?


Post a reply to this message

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