POV-Ray : Newsgroups : povray.binaries.images : Isosurface question : Re: Isosurface question Server Time
20 Nov 2024 02:29:55 EST (-0500)
  Re: Isosurface question  
From: Mike Williams
Date: 18 Oct 2001 02:56:02
Message: <qVcR4CA6mnz7Ew49@econym.demon.co.uk>
Wasn't it banty who wrote:
>    I know that the function below can probably be streamlined a tad,
>but I'm not overly qualified in the math deprtment.  What's here is a
>product of brain bashing experimentation and just a little inspiration
>but I'm stuck.
>    Could someone tell be how to add faces to this surface?
>    And If there's a simpler way to define it?
>
>
>A.D.B
>
>function { (y+x&y+(-x))&y+z&y+(-z) }

By "add faces" do you mean something like this?

#declare Sides=7;

#declare Angle=2*pi/Sides;
isosurface {
  function { x+y 
    #declare A = Angle;
    #while (A < 2*pi)
      & y + x*cos(A) + z*sin(A)
      #declare A=A+Angle;  
    #end
   }
   ...

Change the value of "Sides" to produce a pyramid with that number of
faces.

I can't immediately think of any simpler way to define it.

If the required number of faces is double an odd number, you can render
it twice as fast by setting "Sides" to that odd number and using       
       & y + abs(x*cos(A)) + z*sin(A)
(E.g. if you wanted a pyramid with 14 faces you'd set Sides=7 and use
this abs() trick to double it up).

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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