POV-Ray : Newsgroups : povray.general : Doing data-visualization...But HowTo do it ??? Server Time
9 Aug 2024 15:22:14 EDT (-0400)
  Doing data-visualization...But HowTo do it ??? (Message 1 to 10 of 10)  
From: Jan Walzer
Subject: Doing data-visualization...But HowTo do it ???
Date: 16 Jul 2000 16:53:53
Message: <397220e1@news.povray.org>
I'm about to write some macros, for making some statistics with
povray ...
Creating diagrams with lines and bars semm quite easy, also for
2D-Diagrams showing surfaces ...

But how can I create a pie-chart ???
I don't want do do it with simple texturing on a cylinder, using
a radial gradient, but I want to have all segments of my pie as
own segments, to move them (later).

But how can I create all the pie-pieces ???
I thougt about an Isosurface, but that's quite slow and not
POV3.1 compatible...
Than I thought, using a CSG-operation of a cylinder and a
well-scaled/rotated cube, but this would be quite complicated to
compute, and will only work if the piece has a bit more than 0
degrees and a bit less than 180 degrees ...

Currently I think the isosurf would be the easier alternative,
but there must be another way of doing this ...

Can't I limit a cylinder to some degrees to use ???


--

 ,',    Jan Walzer      \V/  http://wa.lzer.net     ,',
',','   student of      >|<  mailto:jan### [at] lzernet ',','
  '   ComputerScience   /A\  +49-177-7403863         '


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Doing data-visualization...But HowTo do it ???
Date: 16 Jul 2000 17:32:52
Message: <39722a04@news.povray.org>
In article <397220e1@news.povray.org> , "Jan Walzer" 
<wal### [at] informatikuni-hallede> wrote:

> Than I thought, using a CSG-operation of a cylinder and a
> well-scaled/rotated cube, but this would be quite complicated to
> compute, and will only work if the piece has a bit more than 0
> degrees and a bit less than 180 degrees ...

Use two planes instead of a cube and a CSG intersection.  If you place the
cylinder and planes at the origin, you can use a "rotate" attribute along
the cylinder axis to create pie pieces with the planes.  This will allow you
to create pieces in any size with the size measured in degrees.


      Thorsten


Example (not tested):

intersection
{
    cylinder
    {
        x, -x, 10
    }
    plane
    {
        y, 0
    }
    plane
    {
        -y, 0
        rotate 60*x
    }
    texture
    {
        pigment
        {
            color red 1
        }
    }
}


Post a reply to this message

From: Christoph Hormann
Subject: Re: Doing data-visualization...But HowTo do it ???
Date: 16 Jul 2000 17:36:37
Message: <39722AE6.148CF62@schunter.etc.tu-bs.de>
Jan Walzer wrote:
> 
[...]
> 
> But how can I create a pie-chart ???
> I don't want do do it with simple texturing on a cylinder, using
> a radial gradient, but I want to have all segments of my pie as
> own segments, to move them (later).
> 
[...]


IMO CSG-difference would be the simplest

Example:

difference {
   cylinder { 0*z, 1*z, 10 }
   plane { x, 0 rotate end_angle*z }
   plane { x, 0 rotate start_angle*z inverse }
}

Christoph

--
Christoph Hormann <chr### [at] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Chris Huff
Subject: Re: Doing data-visualization...But HowTo do it ???
Date: 16 Jul 2000 17:48:07
Message: <chrishuff-4C2D1E.16483616072000@news.povray.org>
In article <397220e1@news.povray.org>, "Jan Walzer" 
<wal### [at] informatikuni-hallede> wrote:

> Can't I limit a cylinder to some degrees to use ???

An isosurface seems a bit extreme for this...just use an intersection or 
difference with a cylinder and 2 planes to create a wedge shape. You 
could then translate the wedge away from the axis to separate the 
"slice" from the others.
A macro like this should work: (untested!)

#macro PieWedge(minAngle, maxAngle, Radius, Thickness, Separation, Tex)
    difference {
        cylinder {< 0, 0, 0>, < 0, Thickness, 0>, Radius}
        plane {-x, 0 rotate y*(maxAngle - minAngle)/2}
        plane {x, 0 rotate -y*(maxAngle - minAngle)/2}
        texture {Tex}
        translate z*Separation
        rotate y*(minAngle + (maxAngle - minAngle)/2)
    }
#end

The parameters:
minAngle and maxAngle specify the angles where the wedge begins and 
ends; Radius specifies the radius of the wedges, Thickness specifies the 
height of the wedge, Separation controls the distance the wedge is moved 
from the center, and Tex is the texture.

-- 
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

From: Chris Huff
Subject: Re: Doing data-visualization...But HowTo do it ???
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

From: ryan constantine
Subject: Re: Doing data-visualization...But HowTo do it ???
Date: 16 Jul 2000 18:05:54
Message: <3972317D.CFBC8723@yahoo.com>
another alternative is to use an SOR.  Surface Of Revolutions can be
spun for partial circles.  the surface to be revolved would just be a
straight line.  you'd have to make several, one for each pie chart
member, and then rotate and/or translate accordingly.

Chris Huff 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 ???
> 
> An isosurface seems a bit extreme for this...just use an intersection or
> difference with a cylinder and 2 planes to create a wedge shape. You
> could then translate the wedge away from the axis to separate the
> "slice" from the others.
> A macro like this should work: (untested!)
> 
> #macro PieWedge(minAngle, maxAngle, Radius, Thickness, Separation, Tex)
>     difference {
>         cylinder {< 0, 0, 0>, < 0, Thickness, 0>, Radius}
>         plane {-x, 0 rotate y*(maxAngle - minAngle)/2}
>         plane {x, 0 rotate -y*(maxAngle - minAngle)/2}
>         texture {Tex}
>         translate z*Separation
>         rotate y*(minAngle + (maxAngle - minAngle)/2)
>     }
> #end
> 
> The parameters:
> minAngle and maxAngle specify the angles where the wedge begins and
> ends; Radius specifies the radius of the wedges, Thickness specifies the
> height of the wedge, Separation controls the distance the wedge is moved
> from the center, and Tex is the texture.
> 
> --
> 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

From: Chris Huff
Subject: Re: Doing data-visualization...But HowTo do it ???
Date: 16 Jul 2000 18:24:28
Message: <chrishuff-D2E6FA.17245716072000@news.povray.org>
In article <3972317D.CFBC8723@yahoo.com>, ryan constantine 
<rco### [at] yahoocom> wrote:

> another alternative is to use an SOR.  Surface Of Revolutions can be
> spun for partial circles.

Where did you hear that?
Anyway, it isn't true. SOR's always revolve by a full 360 degrees, and 
the same goes for lathes. I even double-checked in the manual and the 
source code, to make sure. Maybe you are thinking of some other 
program...

-- 
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

From: ryan constantine
Subject: Re: Doing data-visualization...But HowTo do it ???
Date: 17 Jul 2000 02:38:18
Message: <3972A994.91541275@yahoo.com>
Maybe you are thinking of some other
> program...

i may be.  oops.


Post a reply to this message

From: ingo
Subject: Re: Doing data-visualization...But HowTo do it ???
Date: 17 Jul 2000 12:20:31
Message: <8F74BAB77seed7@204.213.191.228>
Chris Huff wrote:

>> another alternative is to use an SOR.  Surface Of Revolutions can be
>> spun for partial circles.
>
>Where did you hear that?
>Anyway, it isn't true. SOR's always revolve by a full 360 degrees, and 
>the same goes for lathes.

Would be a nice option though

Ingo

-- 
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

From: Chris Huff
Subject: Re: Doing data-visualization...But HowTo do it ???
Date: 17 Jul 2000 13:12:21
Message: <chrishuff-D7D2BA.12125117072000@news.povray.org>
In article <8F74BAB77seed7@204.213.191.228>, ing### [at] homenl (ingo) 
wrote:

> Would be a nice option though

Wouldn't it be a bit redundant, when you can do the same using a simple 
CSG like the one in my macro, just by replacing the cylinder with a 
sor/lathe object?
You could even make the macro take an object as a parameter, so it would 
work with any object centered on the origin.

-- 
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.