POV-Ray : Newsgroups : povray.general : Extruding a function... : Re: Extruding a function... Server Time
28 Jul 2024 22:18:17 EDT (-0400)
  Re: Extruding a function...  
From: Simon
Date: 19 Jun 2007 16:39:32
Message: <46783f04$1@news.povray.org>
That is very clear! Thanks Mike - If you don't mind some further 
questions...

Say we wanted to do something like an infinitely long crinkle-cut chip 
(excuse the awful description)

Dealing with 1 dimension at a time...

y<1+sin(x*2*pi)
y>-1+sin(x*2*pi + pi/2)

how can I combine the 2? - to be more precise, how do I define the "solid" 
bit as the area between the two?

If you'd rather point me at a tutorial and leave me to it, I understand but 
if you're willing to walk me through this, I'd greatly appreciate it

Thanks in advance!

NB I've used the sine wave isosurface for the curtains in an animation I'm 
posting in p.b-a if you're interested.


"Mike Williams" <nos### [at] econymdemoncouk> wrote in message 
news:Vbj### [at] econymdemoncouk...
> 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.