POV-Ray : Newsgroups : povray.newusers : Possible to convert the Code for the Predefined Shapes into Isosurface Code= : Re: Possible to convert the Code for the Predefined Shapes into Isosurface Code= Server Time
29 Jul 2024 22:32:49 EDT (-0400)
  Re: Possible to convert the Code for the Predefined Shapes into Isosurface Code=  
From: Mike Williams
Date: 21 Jan 2005 12:58:05
Message: <ID9RPGA5IU8BFwev@econym.demon.co.uk>
Wasn't it mephuser who wrote:
>Is it possible to convert the Code for the Predefined Shapes into Isosurface
>Code?
>
>Any external programs that can do this?
>
>How do I write Isosurface Code for all the Predefined Shapes such as Torus,
>Sphere, Cube, Rounded cube, cylinder and etc?

There's no general solution. For some shapes there are builtin
functions, like f_sphere(), f_torus(), f_rounded_box(). Some other
shapes have simple formulae, like

#declare Cube=functionfunction { max((y*y-1),(x*x-1),(z*z-1)) }

#declare Cylinder=function { y*y + z*z - R*R }

Prisms and lathes can be achieved with the technique described here:
<http://www.econym.demon.co.uk/isotut/splines.htm#bent>

Check also the alphabetical index of the Isosurface tutorial:
<http://www.econym.demon.co.uk/isotut/xref.htm>

For many shapes there's also the IsoCSG library.

Some shapes, like meshes, are virtually impossible.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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