POV-Ray : Newsgroups : povray.binaries.images : Isosurface help please : Re: Isosurface help please Server Time
19 Aug 2024 20:16:31 EDT (-0400)
  Re: Isosurface help please  
From: Mike Williams
Date: 21 Oct 2000 02:06:23
Message: <OhXYFEAqDT85Ewvz@econym.demon.co.uk>
Wasn't it David Fontaine who wrote:
>Mike Williams wrote:
>
>> Let's try so solve this equation
>>
>>     abs(x/6+3-floor(x/6+3)-.5)-2/6 = 0
>
>[snip]
>Sorry, I wanted a triangle wave if said equation equals y, not if it is less
>than or equal to zero. That way, by making it less than or equal to zero I
>get a regular pattern of solid space and empty space. That equation should
>give me what I want, but I was wondering why there was a plane at x=0:
>
>x-floor(x):
>
>      y
> / / /| / / /
>/ / / |/ / /
>-------------x
>
>dividing by 6 increases the wavelength, adding 3 translates it, subtracting
>the .5 makes half of it go below the x-axis, and taking the absolute value
>inverts the lower portion to form the parts with negative slope:
>
>     y
>/\/\/|\/\/\
>-----------x
>
>So I'm thinking perhaps it is a bug.
>
>Anyway, I got what I wanted using modulo so it doesn't matter.

So, you meant to type

isosurface {
   function {
    y - (abs(x/6+3-floor(x/6+3)-.5)-2/6)
   }
   contained_by { box { -3,3 } }
   pigment { color rgb x }
}

But this doesn't have a plane at x=0.

Although you added +3, you also subtracted floor(3), so these cancel
out, so it doesn't get translated.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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