POV-Ray : Newsgroups : povray.general : Doing data-visualization...But HowTo do it ??? : Re: Doing data-visualization...But HowTo do it ??? Server Time
9 Aug 2024 13:26:27 EDT (-0400)
  Re: Doing data-visualization...But HowTo do it ???  
From: Chris Huff
Date: 16 Jul 2000 18:04:03
Message: <chrishuff-82F3B1.17043216072000@news.povray.org>
In article <chrishuff-4C2D1E.16483616072000@news.povray.org>, Chris 
Huff <chr### [at] maccom> wrote:

> In article <397220e1@news.povray.org>, "Jan Walzer" 
> <wal### [at] informatikuni-hallede> 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] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

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