POV-Ray : Newsgroups : povray.newusers : 2D Sin curve : Re: 2D Sin curve Server Time
5 Nov 2024 05:20:58 EST (-0500)
  Re: 2D Sin curve  
From: Mike Williams
Date: 1 Sep 2000 15:05:37
Message: <Z4rNDDAFV6r5EwFj@econym.demon.co.uk>
Wasn't it Ulrik who wrote:
>
>I'm just wondering if it's possible to use POV to help me draw 2D sin curves
>or if anyone here knows of such a program. I don't want a plotter program
>though.

Do you mean something like this?

#version unofficial MegaPov 0.4;
camera { location  <0, 0, -3> look_at <0, 0, 0>}
background {rgb 1}
light_source {<-100,200,-100> colour rgb 1}

#declare Amplitude = 0.3;
#declare Frequency = 5;
#declare F = function {sin(Frequency*x)*Amplitude}

#declare Thickness = 0.02;
isosurface {
   function {(y-F(x,0,0))^2 + z^2 -Thickness^2}
   accuracy 0.00001
   contained_by {sphere 0,2}
   method 1
}


It produces a thread with cross section of the specified thickness that
follows the 2D shape specified by the function y=F(x). 

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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