POV-Ray : Newsgroups : povray.general : modeling question : Re: modeling question Server Time
1 Aug 2024 10:13:43 EDT (-0400)
  Re: modeling question  
From: Mike Williams
Date: 19 Nov 2005 15:39:27
Message: <ZGnudAAj14fDFwsc@econym.demon.co.uk>
Wasn't it Anthony D. Baye who wrote:
>Can anybody suggest a method by which a partially unrolled scroll might 
>be created Parametrically?  I've been trying to create a CSG scroll, but 
>I'm about at my wits' end with the Trig functions.
>
>If anybody can help with this, it would be greatly appreciated.

I managed to come up with this. I've used Ingo Janssen's Param.inc rather than
real parametrics, for speed.

Get param.inc from http://members.home.nl/seedseven/

I had hoped to be able to use natural or cubic splines, and thus get a smooth
curve in the middle section, but they always seem to end up with ugly kinks
where the paper starts to curl.



global_settings {assumed_gamma 1.0}

#declare R1=0.2;        //inner radius right end
#declare R2=1;          //outer radius right end
#declare R3=0.1;        //inner radius left end
#declare R4=1.5;        //outer radius left end
#declare DX=3;          //length of straight bit
#declare F1 = 17;       //frequency of right end only a few magic values work
#declare F2 = 43;       //frequency of left end only a few magic values work


camera { location  <-5, 3, -10> look_at <-DX/2,0,0> angle 28}
light_source {<-100,200,-500> colour rgb 1}

#declare S = function {
   spline {
     linear_spline
     // right end
     #declare T=0;
     #while (T<0.5)
       #declare X=cos(T*F1)*((R1*(0.5-T))+(R2*T));
       #declare Y=sin(T*F1)*((R1*(0.5-T))+(R2*T));
       T, <X,Y>,
       #declare T=T+0.002;
     #end
     // left end
     #while (T<1)
       #declare X=sin(T*F2)*((R4*(1-T))+(R3*(T-0.5))) - DX;
       #declare Y=cos(T*F2)*((R4*(1-T))+(R3*(T-0.5)));
       T, <X,Y>,
       #declare T=T+0.002;
     #end
   }
 }


#declare Fx  = function(u,v) {S(u).x}
#declare Fy  = function(u,v) {S(u).y}
#declare Fz  = function(u,v) {v}

#include "param.inc"

object {Parametric(Fx,Fy,Fz,<0,-2>,<1,2>,400,2,"")
        pigment {rgb 1}
}


Post a reply to this message

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