POV-Ray : Newsgroups : povray.binaries.images : Supershapes [jpg, 64k] : Re: Supershapes [jpg, 64k] Server Time
14 Nov 2024 06:15:12 EST (-0500)
  Re: Supershapes [jpg, 64k]  
From: user
Date: 22 Mar 2004 13:10:46
Message: <405f2c26$1@news.povray.org>
This isosurface should handle the 2D cases of the superformula as 
described in http://astronomy.swin.edu.au/~pbourke/povray/supershape/

//---------------------------------

#declare m  =  7;
#declare n1 =  5;
#declare n2 =  5;
#declare n3 =  5;
#declare a  =  1;
#declare b  =  1;

   isosurface {

     function { pow(
      pow(abs(cos(0.25*m*acos(y/sqrt(x*x+y*y))*abs(y)/y)/a),n2)  +
      pow(abs(sin(0.25*m*acos(y/sqrt(x*x+y*y))*abs(y)/y)/b),n3)
      ,1/n1) * sqrt(x*x+y*y) - 1 }

     contained_by { box { <-2,-2,-2>, <2,2,2> } }
     scale <1,1,0.001>
     pigment { Yellow }
    }


box {<0.01,0.01,1>,<-0.01,-0.01,-1> rotate<0, 0,0> pigment {Red}  } 

box {<0.01,0.01,1>,<-0.01,-0.01,-1> rotate<0,90,0> pigment {Green}}
box {<0.01,0.01,1>,<-0.01,-0.01,-1> rotate<90,0,0> pigment {Blue} }

Regards, Hans



Dave Vogt wrote:
> Hi there,
> 
> Last week, the heise newsticker had an article[1] about the
> superformula. It is told that using this formula, you can describe
> (almost) every thinkable shape with only a few parameters. Well, they
> had a link to a site[2] where you can download a tool to play around
> with, and even export a mesh to pov! I couldn't resist and now I think
> I would like to share this with you.. even if only the rendering is
> done in pov.
> There was also someone who implemented the formula in pov[3],
> dynamically generating a mesh. I didn't try that yet.
> 
> Ah yes, I was so stupid to not store the parameters to the formula for
> this object, sorry ;)
> 
> 
> Greets, 
> 
> Dave V.
> 
> [1] http://www.heise.de/newsticker/meldung/45863
> [2] http://www.genicap.com/
> [3] http://astronomy.swin.edu.au/~pbourke/povray/supershape/
> 
> 
> 
> ------------------------------------------------------------------------
>


Post a reply to this message

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