|
![](/i/fill.gif) |
In article <chrishuff-4C2D1E.16483616072000@news.povray.org>, Chris
Huff <chr### [at] mac com> wrote:
> In article <397220e1@news.povray.org>, "Jan Walzer"
> <wal### [at] informatik uni-halle de> wrote:
>
> > Can't I limit a cylinder to some degrees to use ???
> A macro like this should work: (untested!)
That macro won't work with angles >180 degrees though...try a difference
of an intersection of 2 planes for those cases, something like
this:(also untested!)
#macro PieWedge(minAngle, maxAngle, Radius, Thickness, Separation, Tex)
difference {
cylinder {< 0, 0, 0>, < 0, Thickness, 0>, Radius}
#if(maxAngle - minAngle > 180)
intersection {
plane {-x, 0 rotate y*(maxAngle - minAngle)/2}
plane {x, 0 rotate -y*(maxAngle - minAngle)/2}
}
#else
plane {-x, 0 rotate y*(maxAngle - minAngle)/2}
plane {x, 0 rotate -y*(maxAngle - minAngle)/2}
#end
texture {Tex}
translate z*Separation
rotate y*(minAngle + (maxAngle - minAngle)/2)
}
#end
Basically, this chops off the sides if the wedge angle is <=180, but
removes a wedge shape if it is >180. You may want to account for angles
of exactly 180 degrees, they may cause cooincident surface problems, but
it would be easier to just move one of the planes by 0.0001 or so...and
there may not be any problem.
--
Christopher James Huff - Personal e-mail: chr### [at] mac com
TAG(Technical Assistance Group) e-mail: chr### [at] tag povray org
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |