POV-Ray : Newsgroups : povray.binaries.images : Torus segment with rounded ends (for a pie chart) : Re: Torus segment with rounded ends (for a pie chart) Server Time
4 Nov 2024 15:02:28 EST (-0500)
  Re: Torus segment with rounded ends (for a pie chart)  
From: Alain
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

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