POV-Ray : Newsgroups : povray.general : K3DSurf to Eureka 2.12 Server Time
29 Jul 2024 14:12:19 EDT (-0400)
  K3DSurf to Eureka 2.12 (Message 1 to 1 of 1)  
From: Francois LE COAT
Subject: K3DSurf to Eureka 2.12
Date: 29 May 2011 11:27:06
Message: <4de265ca$1@news.povray.org>
Hi,

If one of yours is interested in 3D, and knows K3DSurf like me

     <http://k3dsurf.sf.net/>

you may have noticed the following K3DSurf forum discussion
at <http://k3dsurf.s4.bizhat.com/viewtopic.php?t=145>

A K3DSurf user asks how he would describe the "Snail" surface
<http://www.3d-meier.de/tut3/Seite38.html> and the author
replies him (in English) how to do so.


With Eureka 2.12, in order to describe the "Snail Surface"
you just have to load the hereafter formula, which is the
equivalent Parametric 3D (rho,theta) surface

<CUT "snail.fmu">
Do not put more than 65 characters per line of formula !
"r*cos(t)*sin(r)"
""
"r*cos(t)*cos(r)"
""
"-r*sin(t)"
""
"K3DSurf formula"
""
""
""
""
""
_____________________ Optional ______________________
"0 2*pi"
"-pi pi"
""
"-10 10"
"-10 10"
"-10 10"
"44 11 5"
</CUT>

and you will obtain the following POV-Ray script exporting

<CUT "snail.pov">
// File exported by Eureka 2.12. Designed by Archimedium 2007
#version 3.1;
#declare Gold_Phong = texture {
pigment { color rgb <1.0,0.90,0.6> }
finish { phong 1.0 phong_size 5.0 }
}

#declare EPSILON = 1e-10;
#declare xmin  = 0;
#declare xmax  = 6.28318530717958648;
#declare ymin  = -3.14159265358979324;
#declare ymax  = 3.14159265358979324;
#declare xiter = 31;
#declare yiter = 61;
#declare ix    = (xmax-xmin)/(xiter-1.0);
#declare iy    = (ymax-ymin)/(yiter-1.0);
#declare deltax = (xmax-xmin)/((xiter-1.0)*4.0);
#declare deltay = (ymax-ymin)/((yiter-1.0)*4.0);
#macro Point(xx,yy)
#local R  = xx;
#local T  = yy;
#local U  = 0;
#local X  = R*cos(T);
#local Y  = R*sin(T);
#local absc  = R*cos(T)*sin(R);
#local ordo  = R*cos(T)*cos(R);
#local cote  = -R*sin(T);
     #declare zzz=-absc;
   #declare xxx=ordo;
   #declare yyy=cote;
#end
#macro Surface(xx,yy)
   Point(xx,yy)
   #local xn=xxx;
   #local yn=yyy;
   #local zn=zzz;
   #declare xx=xx+deltax;
   Point(xx,yy)
   #local xp=xxx;
   #local yp=yyy;
   #local zp=zzz;
   #declare xx=xx-deltax;
   #declare yy=yy+deltay;
   Point(xx,yy)
   #local xq=xxx;
   #local yq=yyy;
   #local zq=zzz;
   #declare yy=yy-deltay;
   #local vn=vcross(<xp-xn,yp-yn,zp-zn>,<xq-xn,yq-yn,zq-zn>);
   #if(!(vn.x=0&vn.y=0&vn.z=0))
   #declare nn=vnormalize(vn);
   #else
   #declare nn=<1,0,0>;
   #end
   #declare pp=<xn,yn,zn>;
#end
#declare eureka_eureka = mesh {
   #declare xx = xmin;
#while (xx<xmax)                        //outer loop
   #declare yy = ymin;
   #while (yy<ymax)                      //inner loop
//POINTS
   Surface(xx,yy)
   #declare n1=nn;
   #declare p1=pp;

   #declare yy=yy+iy;
   Surface(xx,yy)
   #declare n2=nn;
   #declare p2=pp;

   #declare xx=xx+ix;
   Surface(xx,yy)
   #declare n3=nn;
   #declare p3=pp;

   #declare yy=yy-iy;
   Surface(xx,yy)
   #declare n4=nn;
   #declare p4=pp;

   #declare xx=xx-ix;
#if(!(p1.x=p2.x&p1.y=p2.y&p1.z=p2.z)|(p2.x=p3.x&p2.y=p3.y&p2.z=
p3.z)|(p1.x=p3.x&p1.y=p3.y&p1.z=p3.z))
       smooth_triangle {
         p1,n1,
         p2,n2,
         p3,n3
        }

#end
#if(!(p1.x=p3.x&p1.y=p3.y&p1.z=p3.z)|(p3.x=p4.x&p3.y=p4.y&p3.z=
p4.z)|(p1.x=p4.x&p1.y=p4.y&p1.z=p4.z))
       smooth_triangle{
         p1,n1,
         p3,n3,
         p4,n4
        }
#end

     #declare yy = yy+iy;
  #end                 //inner loop
  #declare xx = xx+ix;
#end                   //outer loop
     translate <0,0,0>
     scale 1.0/12.566370614
}

object {
     eureka_eureka
  no_shadow
texture { Gold_Phong }
rotate <0,36*clock,0>
}

//Lights, camera, action
camera
{ location  < 0.8, 0.8, -0.8>
direction  1*z
look_at   < 0, 0, 0>
}

light_source { < 0, 1, -1> color rgb 1 }
light_source { < 1, 1, -1> color rgb 1 }

object { box{-2,2 inverse} pigment{color rgb 0.9} }
</CUT>

You may then render this surface with a POV-Ray 36 images animation,
and clock (time in POV-Ray) varying in [0 to 5.0] time range.

You will obtain a kind of helix rotating around its axis like

     <http://eureka.atari.org/snail.gif>

You may display it with zView with an ATARI, like that screenshot

     <http://eureka.atari.org/snail.jpg>

Have you launched your ATARI and Eureka 2.12, today ?

ATARIstically yours =)

-- 

Author of Eureka 2.12 (2D Graph Describer, 3D Modeller)
http://eureka.atari.org/
http://fon.gs/eureka/


Post a reply to this message

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