POV-Ray : Newsgroups : povray.general : Extruding a function... : Re: Extruding a function... Server Time
28 Jul 2024 22:31:34 EDT (-0400)
  Re: Extruding a function...  
From: Mike Williams
Date: 19 Jun 2007 16:14:13
Message: <VbjWpBAGU8dGFwIM@econym.demon.co.uk>
Wasn't it Simon who wrote:
>I believe this is possible to do with isosurfaces - I'm just not very good 
>at them :s
>
>I need something like a sine wave extruded in the +z direction
>
>If I have:
>f(x) = sin(2*pi*x)
>
>how do I get that into something like corrugated roof? I've read the 
>excellent tutorial on isosurfaces <http://www.econym.demon.co.uk/isotut/> 
>and can copy/paste as well as the next man but  am obviously missing 
>something as I don't seem to be able to do what I need

Mathematically, what you want to plot is y=f(x)

I.e     y = sin(2*pi*x)

But isosurfaces evaluate expressions of the format 
        <function> = <threshold>
where threshold is a constant, so we rewrite the expression as

        y - sin(2*pi*x) = 0

isosurface {
  function { y - sin(2*pi*x) }
        max_gradient 4
        contained_by{sphere{0,5}}
        pigment {rgb 1}
}

We dont need to bother saying "threshold 0" because that's the default.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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