POV-Ray : Newsgroups : povray.binaries.images : Torus segment with rounded ends (for a pie chart) Server Time
1 Aug 2024 10:13:09 EDT (-0400)
  Torus segment with rounded ends (for a pie chart) (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Rick Measham
Subject: Torus segment with rounded ends (for a pie chart)
Date: 24 Sep 2008 21:07:14
Message: <48dae442@news.povray.org>
Attached is the POV used to create the also attached PNG file.

The aim is to create a library that will output pie charts as torus 
segments. The PNG is almost right where I want it.

Except for the rounding of the torus segments. This is all just 
approximations.

To do it properly, I somehow need to make a torus that is smaller on the 
inside of the large segmented torus.

Does anyone have any other ideas on how to do this nicely?

ALSO: I would love to make this render a hell of a lot faster, if anyone 
has any pointers.

Cheers!
Rick Measham


Post a reply to this message


Attachments:
Download 'pie_torus.png' (1 KB) Download 'us-ascii' (3 KB)

Preview of image 'pie_torus.png'
pie_torus.png

From: Rick Measham
Subject: Re: Torus segment with rounded ends (for a pie chart)
Date: 24 Sep 2008 21:08:16
Message: <48dae480@news.povray.org>
Rick Measham wrote:
> Attached is the POV used to create the also attached PNG file.

Oops, wrong PNG attached.

Cheers!
Rick Measham


Post a reply to this message


Attachments:
Download 'pie_torus.good.png' (95 KB)

Preview of image 'pie_torus.good.png'
pie_torus.good.png


 

From: Mike Williams
Subject: Re: Torus segment with rounded ends (for a pie chart)
Date: 24 Sep 2008 23:58:34
Message: <WoXa9cCSuw2IFwqT@econym.demon.co.uk>
Wasn't it Rick Measham who wrote:
>Attached is the POV used to create the also attached PNG file.
>
>The aim is to create a library that will output pie charts as torus 
>segments. The PNG is almost right where I want it.
>
>Except for the rounding of the torus segments. This is all just 
>approximations.
>
>To do it properly, I somehow need to make a torus that is smaller on 
>the inside of the large segmented torus.
>
>Does anyone have any other ideas on how to do this nicely?

A "torus that is smaller on the inside" sounds like a "Dupin Cyclid". 
See the last image on this page:

http://www.econym.demon.co.uk/isotut/builtin2.htm

>ALSO: I would love to make this render a hell of a lot faster, if 
>anyone has any pointers.

Unfortunately, the use of an isosurfaces would be expected to make the 
rendering slower.

Another significant problem would be working out how to set the 
parameters of the Cyclid to get everything to fit correctly.


A different possible approach would be to use a sphere sweep, varying 
the sphere radius as the path sweeps round a circle. Also probably 
slower than a torus.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: jan dvorak
Subject: Re: Torus segment with rounded ends (for a pie chart)
Date: 25 Sep 2008 03:53:17
Message: <48db436d$1@news.povray.org>
Rick Measham napsal(a):
> Rick Measham wrote:
>> Attached is the POV used to create the also attached PNG file.
> 
> Oops, wrong PNG attached.
> 
> Cheers!
> Rick Measham
> 
> ------------------------------------------------------------------------
> 
hi,
you should move the segments a bit apart to avoid coincident surfaces.

Regarding your question, you could try using a squashed sphere (still an 
approximation but it will be very quick) for each tip. If this is an 
acceptable idea I can figure out the maths for you.


Post a reply to this message

From: Rick Measham
Subject: Re: Torus segment with rounded ends (for a pie chart)
Date: 25 Sep 2008 05:02:39
Message: <48DB53AE.8010503@die.spammer.die.isite.net.au>
jan dvorak wrote:
> Regarding your question, you could try using a squashed sphere (still an 
> approximation but it will be very quick) for each tip. If this is an 
> acceptable idea I can figure out the maths for you.

By the time it's squashed enough, the edge isn't round enough. Thanks 
for the idea though!

Cheers!
Rick Measham


Post a reply to this message

From: Mike Williams
Subject: Re: Torus segment with rounded ends (for a pie chart)
Date: 25 Sep 2008 06:26:19
Message: <TeP7waBxa22IFwJN@econym.demon.co.uk>
Wasn't it Rick Measham who wrote:
>ALSO: I would love to make this render a hell of a lot faster, if
>anyone has any pointers.

One thing worth noticing is that your area_light causes the render time
to be multiplied by a factor of 28.

I wonder if it would somehow be possible to arrange for the blurred
shadow to be calculated separately, cast by a simpler object with
no_image, and have the main object be illuminated by a simpler light
source. I've never really played with light_group and can't seem to get
this to go as fast as I'd expect.

Rendering the scene with the wedges commented out, and with
        torus {2, 0.6 pigment {rgbf <1,0,0,0.35>} no_image}
to cast the shadow runs very fast. Your original scene but with
        AreaLights = 0;
runs very fast. My attempts to do both of those in the same scene slow
it down so much that the speed gain over the original scene is only a
factor of about 2.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Blue Herring
Subject: Re: Torus segment with rounded ends (for a pie chart)
Date: 25 Sep 2008 10:59:39
Message: <48dba75b$1@news.povray.org>
Mike Williams wrote:
> Wasn't it Rick Measham who wrote:
>> ALSO: I would love to make this render a hell of a lot faster, if
>> anyone has any pointers.
> 
> One thing worth noticing is that your area_light causes the render time
> to be multiplied by a factor of 28.
> 
> I wonder if it would somehow be possible to arrange for the blurred
> shadow to be calculated separately, cast by a simpler object with
> no_image, and have the main object be illuminated by a simpler light
> source. I've never really played with light_group and can't seem to get
> this to go as fast as I'd expect.
> 
> Rendering the scene with the wedges commented out, and with
>         torus {2, 0.6 pigment {rgbf <1,0,0,0.35>} no_image}
> to cast the shadow runs very fast. Your original scene but with
>         AreaLights = 0;
> runs very fast. My attempts to do both of those in the same scene slow
> it down so much that the speed gain over the original scene is only a
> factor of about 2.
> 

Have you tried adding "adaptive 0" to the area_light?  If you do, you 
might want to bump up the dimensions to 9x9, 17x17, 33x33 or higher. 
There have been a number of posts here addressing the benefits of 
adaptive area lights.


-- 
// The Mildly Infamous Blue Herring
#version 3.61;#include"functions.inc"global_settings{assumed_gamma
2.2}isosurface{function{-f_strophoid(x/2-.45,y,z*3,1,1.2,1,1.5)-.05}
contained_by{box{<-2.1,-1,-1/3>,<1.4,1,1/3>}}max_gradient 12inverse
hollow pigment{rgbf 1}interior{media{samples 8 emission<3,80,150>/255
density{crackle metric 1color_map{[0rgb 6][.03rgb 0][1rgb 0]}scale<1,
2,1>warp{turbulence<.5,.75,.5>}scale 1/3}}}translate z*3}


Post a reply to this message

From: Alain
Subject: Re: Torus segment with rounded ends (for a pie chart)
Date: 25 Sep 2008 22:43:34
Message: <48dc4c56$1@news.povray.org>
Rick Measham nous illumina en ce 2008-09-24 21:07 -->
> Attached is the POV used to create the also attached PNG file.
> 
> The aim is to create a library that will output pie charts as torus 
> segments. The PNG is almost right where I want it.
> 
> Except for the rounding of the torus segments. This is all just 
> approximations.
> 
> To do it properly, I somehow need to make a torus that is smaller on the 
> inside of the large segmented torus.
> 
> Does anyone have any other ideas on how to do this nicely?
> 
> ALSO: I would love to make this render a hell of a lot faster, if anyone 
> has any pointers.
> 
> Cheers!
> Rick Measham
> 
> ------------------------------------------------------------------------
> 

First thing, use adaptive 0 on your area_light. It greatly improve the rendering 
speed.

In your global_settings, add adc_bailout with a value larger than the default of 
1/256. I tryed 0.03 whith about no visible difference, but can make the 
rendering a little faster.

Unless you absolutely need your pieces to be transparent, changing for some 
opaque pigments will also mage the render faster. You can add a filter value in 
your parameters. You can then replace the merge by the faster union if the 
filter value is zero. The red part can easily be made opaque without changing 
the overall aspect to much.

You take the large torus, remove a piece with one or two planes. You then remove 
the rims with two small tori. You then merge two small tori to make the rounded 
edges.
It may be better to remove a little more with your planes, by increasing the 
angle of the slice. It can be done inside the macro. Then add a short cylinder 
to fill the tori you use to make the rounded edges. Merge/union the cylinder 
with the end tori, move and rotate the pairs. Cylinders are much faster than 
tori to process, and merge/union are usualy more effecient that 
difference/intersections, so replacing two substacting tori by two adding 
cylinders will be faster.

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when you can describe in perfect, 
legal, pov syntax, how to re-create everything in your computer room using 
primitives and csg operations.
fish-head


Post a reply to this message

From: gregjohn
Subject: Re: Torus segment with rounded ends (for a pie chart)
Date: 27 Sep 2008 17:15:00
Message: <web.48dea1526fcbd36a34d207310@news.povray.org>
Rick Measham <ric### [at] diespammerdieisitenetau> wrote:
> Rick Measham wrote:
> > Attached is the POV used to create the also attached PNG file.
>

This is truly enjoyable.  It is "art" of the kind I could imagine hanging on a
wall.


Post a reply to this message

From: Bill Pragnell
Subject: Re: Torus segment with rounded ends (for a pie chart)
Date: 29 Sep 2008 09:00:00
Message: <web.48e0d07a6fcbd36ad145e0d90@news.povray.org>
Rick Measham <ric### [at] diespammerdieisitenetau> wrote:
> The aim is to create a library that will output pie charts as torus
> segments. The PNG is almost right where I want it.

Very nice!

> ALSO: I would love to make this render a hell of a lot faster, if anyone
> has any pointers.

You should probably manually bound the wedges - I've been amazed at how much
difference this can make in the past.

Bill


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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