POV-Ray : Newsgroups : povray.unofficial.patches : Math/formula assitance (isosurface) Server Time
2 Nov 2024 07:26:26 EDT (-0400)
  Math/formula assitance (isosurface) (Message 1 to 3 of 3)  
From: TonyB
Subject: Math/formula assitance (isosurface)
Date: 11 Feb 2000 18:51:09
Message: <38a4a06d@news.povray.org>
I want to create a shape that goes from

((x+R)*(x-R) & (z+R)*(z-R))

at a specified y height

to

(sqrt(x^2+z^2)-R)

at another specified height in y.

How can I do this? The idea is that I bind the thing with box
{-<R,H1,R>,<R,H2,R>}, so that it goes from square to circle. Perhaps, if
there is a way, could someone explain how to "gradient" between other
shapes? Say, a triangle or a star?


Post a reply to this message

From: Gilles Tran
Subject: Re: Math/formula assitance (isosurface)
Date: 12 Feb 2000 08:40:23
Message: <38A562DB.82D42F8@inapg.inra.fr>
TonyB wrote:

> How can I do this? The idea is that I bind the thing with box
> {-<R,H1,R>,<R,H2,R>}, so that it goes from square to circle. Perhaps, if
> there is a way, could someone explain how to "gradient" between other
> shapes? Say, a triangle or a star?

To "gradient" between shapes all just join the formulas like this :
f = f1*(1-y) + f2*y
so that the shape starts at f1 and ends at f2 when y goes from 0 to 1
(adapt to your own y values)
for instance :
isosurface {
  function {(abs(x)+abs(z))*(1-y)+(x^2+y^2+z^2)*y}
  contained_by {box {<-1,0,-1>,<1,1,1>}}
  eval
  sign 1
  threshold 1
  pigment{Red}
}

starts as a cube and ends as a sphere

G.


Post a reply to this message

From: TonyB
Subject: Re: Math/formula assitance (isosurface)
Date: 12 Feb 2000 10:07:44
Message: <38a57740@news.povray.org>
I was this close to getting it figured out on my own: instead of 1-y I wrote
y-1 and instead of adding the two functions I was trying out everything
else. Last one I had was &. Thanks a bunch, Gilles. :)


Post a reply to this message

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