POV-Ray : Newsgroups : povray.general : supershapes in povray Server Time
17 Nov 2024 01:13:25 EST (-0500)
  supershapes in povray (Message 1 to 10 of 10)  
From: Paul Bourke
Subject: supershapes in povray
Date: 13 Jul 2003 03:52:37
Message: <pdb_NOSPAM-B5640B.17532813072003@netplex.aussie.org>
Has anyone been following the developments of supershapes that
appeared in a brief article in Nature as little while ago? Well
3D versions can be made and there are some examples here
    http://astronomy.swin.edu.au/~pbourke/surfaces/supershape3d/
along with a PovRay macro. 

Oh yeah, some people call it a "super formula".

ps: I've never written a macro before so if there are any 
conventions I should have used then please let me know.
-- 
Paul Bourke
pdb_NOSPAMswin.edu.au


Post a reply to this message

From: ingo
Subject: Re: supershapes in povray
Date: 13 Jul 2003 04:47:43
Message: <Xns93B76E72EB96Bseed7@povray.org>
in news:pdb### [at] netplexaussieorg Paul Bourke 
wrote:

>     http://astronomy.swin.edu.au/~pbourke/surfaces/supershape3d/
> 

Paul,

on that page you write "One is to use the builtin parametric primitive, 
doing it this way would result in ...". Do you have a scene using the 
parametric primitive available? I'd like try it with my param.inc macro ( 
http://members.home.nl/seedseven/ ) as it uses a syntax very close to the 
parametric primitive, but to be honest I'm too lazy to figure it out for 
myself.

Ingo


Post a reply to this message

From: Christoph Hormann
Subject: Re: supershapes in povray
Date: 13 Jul 2003 07:28:45
Message: <3F11426C.E67ABF87@gmx.de>
Paul Bourke wrote:
> 
> Has anyone been following the developments of supershapes that
> appeared in a brief article in Nature as little while ago? Well
> 3D versions can be made and there are some examples here
>     http://astronomy.swin.edu.au/~pbourke/surfaces/supershape3d/
> along with a PovRay macro.

Interesting, do you know if these shapes can be converted in an implicit
form, at least in some special cases?

This would make it easier to render them in POV-Ray without generating a
mesh.

> 
> ps: I've never written a macro before so if there are any
> conventions I should have used then please let me know.

I don't think so.  When having many parameters it might be useful to group
them into vectors, this would be easier to memorize for the user.  If you
have vector parameters it is a good idea to alternatively allow floats by
using:

#macro Test (Parameter, ...)

  #local Param_Intern=Parameter+<0,0,0>;

  ...


Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 17 Jun. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: supershapes in povray
Date: 13 Jul 2003 12:24:40
Message: <Xns93B7BBA00DE90torolavkhotmailcom@204.213.191.226>
ingo <ing### [at] tagpovrayorg> wrote in
news:Xns### [at] povrayorg: 

> in news:pdb### [at] netplexaussieorg Paul
> Bourke wrote:
> 
>>     http://astronomy.swin.edu.au/~pbourke/surfaces/supershape3d/
>> 
> 
> Paul,
> 
> on that page you write "One is to use the builtin parametric
> primitive, doing it this way would result in ...". Do you have a scene
> using the parametric primitive available? I'd like try it with my
> param.inc macro ( http://members.home.nl/seedseven/ ) as it uses a
> syntax very close to the parametric primitive, but to be honest I'm
> too lazy to figure it out for myself.


Hi Ingo

Below is a "super shape" scene that uses your Parametric() macro.


Tor Olav


// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#version 3.5;

#include "param.inc"

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#macro SuperFunction(M, A, B, N1, N2, N3)

  #local Nil = 1E-12;
  #local MM = M/4;
  #local NN = -1/N1;

  function(T) {
    pow(
      Nil +
      pow(abs(cos(T*MM)/A), N2) +
      pow(abs(sin(T*MM)/B), N3),
      NN
    )
  }

#end // macro SuperFunction


#macro SuperShapeMesh(
         M1, A1, B1, N11, N12, N13,
         M2, A2, B2, N21, N22, N23,
         ResTh, ResPh)

  #local SuperFn1 = SuperFunction(M1, A1, B1, N11, N12, N13)
  #local SuperFn2 = SuperFunction(M2, A2, B2, N21, N22, N23)

  Parametric(
    function(Th, Ph) { cos(Th)*SuperFn1(Th)*cos(Ph)*SuperFn2(Ph) },
    function(Th, Ph) { sin(Ph)*SuperFn2(Ph) },
    function(Th, Ph) { sin(Th)*SuperFn1(Th)*cos(Ph)*SuperFn2(Ph) },
    <-pi, -pi/2>, <pi, pi/2>,
    ResTh, ResPh, ""
  )

#end // macro SuperShapeMesh

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

object {
  SuperShapeMesh(
    1, 1, 1  77, 0.81, 71.7,
    8, 1, 1, 0.63, 2.92, 0.24,
    100, 50
  )
  pigment { color rgb <1, 1, 1> }
  double_illuminate // Because of bug
  no_shadow
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

camera {
  location <3, 2, 4>*0.6
  look_at <0, 0, 0>
}

light_source { 100*x color rgb <1.0, 0.5, 0.5> }
light_source { 100*y color rgb <0.5, 1.0, 0.5> }
light_source { 100*z color rgb <0.5, 0.5, 1.0> }

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7


Post a reply to this message

From: Wolfgang Wieser
Subject: Re: supershapes in povray
Date: 13 Jul 2003 12:30:03
Message: <3f118909$2@news.povray.org>
Christoph Hormann wrote:
>> Has anyone been following the developments of supershapes that
>> appeared in a brief article in Nature as little while ago? Well
>> 3D versions can be made and there are some examples here
>>     http://astronomy.swin.edu.au/~pbourke/surfaces/supershape3d/
>> along with a PovRay macro.
> 
> Interesting, do you know if these shapes can be converted in an implicit
> form, at least in some special cases?
> 
> This would make it easier to render them in POV-Ray without generating a
> mesh.
> 
What about adding the supershape as a built-in POVRay function for 
isosurface? (like f_sphere, etc.)
That would at least eliminate function evaluation time. 

Wolfgang


Post a reply to this message

From: ingo
Subject: Re: supershapes in povray
Date: 13 Jul 2003 12:50:12
Message: <Xns93B7C03FD91D0seed7@povray.org>
in news:Xns### [at] 204213191226 Tor Olav 
Kristensen wrote:

> Below is a "super shape" scene that uses your Parametric() macro.
> 

Thank you Tor Olav


Ingo


Post a reply to this message

From: Dennis Miller
Subject: Re: supershapes in povray
Date: 13 Jul 2003 22:44:45
Message: <3f12191d@news.povray.org>
Hi Paul. I was trying to recreate some of the Super Shapes at your site and
punched in the numbers shown for the SS1 and SS2 parameters. Alas, I did not
get anything like the images at your site. Can you tell me if I can use the
supershape.pov macro to generate the same images you show? Perhaps that is
not the right appraoch. Great work, in any event!
Best wishes,
Dennis
"Paul Bourke" <pdb### [at] swineduau> wrote in message
news:pdb### [at] netplexaussieorg...
> Has anyone been following the developments of supershapes that
> appeared in a brief article in Nature as little while ago? Well
> 3D versions can be made and there are some examples here
>     http://astronomy.swin.edu.au/~pbourke/surfaces/supershape3d/
> along with a PovRay macro.
>
> Oh yeah, some people call it a "super formula".
>
> ps: I've never written a macro before so if there are any
> conventions I should have used then please let me know.
> -- 
> Paul Bourke
> pdb_NOSPAMswin.edu.au


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: supershapes in povray
Date: 13 Jul 2003 23:04:57
Message: <Xns93B8340FC7547torolavkhotmailcom@204.213.191.226>
"Dennis Miller" <dhm### [at] comcastnet> wrote in
news:3f12191d@news.povray.org: 

> Hi Paul. I was trying to recreate some of the Super Shapes at your
> site and punched in the numbers shown for the SS1 and SS2 parameters.
> Alas, I did not get anything like the images at your site. Can you
> tell me if I can use the supershape.pov macro to generate the same
> images you show? Perhaps that is not the right appraoch.
...

Try with all the A's and B's set to 1 

(SS1a = SS1b = SS2a = SS2b = 1)


E.g.:
For the first example on his web page, call the macro like this:

SuperShape(
  2, 1, 1, 0.7, 0.3, 0.2,
  3, 1, 1, 100, 100, 100,
  200
)


Tor Olav


Post a reply to this message

From: Mike Williams
Subject: Re: supershapes in povray
Date: 14 Jul 2003 01:49:51
Message: <GFud$BAW6jE$EwVs@econym.demon.co.uk>
Wasn't it ingo who wrote:
>in news:pdb### [at] netplexaussieorg Paul Bourke 
>wrote:
>
>>     http://astronomy.swin.edu.au/~pbourke/surfaces/supershape3d/
>> 
>
>Paul,
>
>on that page you write "One is to use the builtin parametric primitive, 
>doing it this way would result in ...". Do you have a scene using the 
>parametric primitive available? I'd like try it with my param.inc macro ( 
>http://members.home.nl/seedseven/ ) as it uses a syntax very close to the 
>parametric primitive, but to be honest I'm too lazy to figure it out for 
>myself.

I think it goes something like this:

// Choose one of the three examples from supershape.pov
#declare Example=1;

// Suitable camera positions for each example shape
#switch (Example)
#case (1)
  camera { location  <2,1,-2> look_at <0, 0, 0>}
  #break
#case (2)  
  camera { location  <2,1,-10> look_at <0, 0, 0>}
  #break
#case (3)  
  camera { location  <-0.5,0.5,-2> look_at <0, 0, 0>}
  #break
#end

light_source {<100,200,-100> colour rgb 1}
light_source {<-100,-200,-100> colour rgb 0.5}

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

#include "param.inc"

#macro SuperShape(SS1m,SS1a,SS1b,SS1n1,SS1n2,SS1n3,SS2m,SS2a,SS2b,SS2n1,
SS2n2,SS2n3,resol) 
  #declare SS1 = function(T) { 1/
      pow( pow(abs(cos(SS1m*T/4))/SS1a,SS1n2) 
    + pow(abs(sin(SS1m*T/4))/SS1b,SS1n3), 1/SS1n1)
  }
  #declare SS2 = function(T) { 1/
      pow( pow(abs(cos(SS2m*T/4))/SS2a,SS2n2) 
     + pow(abs(sin(SS2m*T/4))/SS2b,SS2n3), 1/SS2n1)
  }

  #declare Fx=function(u,v) { SS1(u) *cos(u) *SS2(v) *cos(v) }
  #declare Fy=function(u,v) { SS1(u) *sin(u) *SS2(v) *cos(v) }
  #declare Fz=function(u,v) { SS2(v) *sin(v) }

  Parametric(Fx,Fy,Fz,<-pi/2,-pi>,<pi/2,pi>,resol,resol,"")

#end

// ----------------------------------------
// Run It

object {
  #switch (Example)
  #case (1)
    SuperShape(1,1,1   77,0.81,71.7,   8,1,1,0.63,2.92,0.24, 100)
    #break
  #case (2)  
    SuperShape(9,1,1,92,0.3,-45,  4,1,1,-0.8,88,-0.35,  39)
    #break
  #case(3)
    SuperShape(4,1,1,1,1,1,  0,1,1,1,1,1,  50)
    #break
  #end

  pigment {rgb 0.9}
  finish {phong 0.5 phong_size 10}
}



-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Dennis Miller
Subject: Re: supershapes in povray
Date: 14 Jul 2003 20:37:37
Message: <3f134cd1$1@news.povray.org>
Thanks very much Tor.
D.
"Tor Olav Kristensen" <tor_olav_kCURLYAhotmail.com> wrote in message
news:Xns### [at] 204213191226...
> "Dennis Miller" <dhm### [at] comcastnet> wrote in
> news:3f12191d@news.povray.org:
>
> > Hi Paul. I was trying to recreate some of the Super Shapes at your
> > site and punched in the numbers shown for the SS1 and SS2 parameters.
> > Alas, I did not get anything like the images at your site. Can you
> > tell me if I can use the supershape.pov macro to generate the same
> > images you show? Perhaps that is not the right appraoch.
> ...
>
> Try with all the A's and B's set to 1
>
> (SS1a = SS1b = SS2a = SS2b = 1)
>
>
> E.g.:
> For the first example on his web page, call the macro like this:
>
> SuperShape(
>   2, 1, 1, 0.7, 0.3, 0.2,
>   3, 1, 1, 100, 100, 100,
>   200
> )
>
>
> Tor Olav


Post a reply to this message

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