POV-Ray : Newsgroups : povray.programming : Widening Sin() function Server Time
18 Apr 2024 18:34:59 EDT (-0400)
  Widening Sin() function (Message 1 to 2 of 2)  
From: Bald Eagle
Subject: Widening Sin() function
Date: 1 May 2017 14:30:01
Message: <web.59077dc1b6c5a8b8c437ac910@news.povray.org>
Posting this here for lack of a better place.

I'm interested in widening the output of a sin() trace - using POV-Ray to
generate output for SVG which then gets processed into ... something else
(G-Code I think)

So I thought maybe doing a simple "circle-sweep" would do it, though it may be
overly complicated on the device end.
Doing a line segment sweep with lines normal to the sine wave might do it, but
may still be overly complicated.

Stacking sin waves of different frequencies and amplitudes to offset to the
sides / top / bottom  seemed the way to go.

I was wondering is anyone had any suggestions as to how to code that up.


Post a reply to this message

From: Le Forgeron
Subject: Re: Widening Sin() function
Date: 1 May 2017 15:20:36
Message: <59078a84@news.povray.org>
Le 01/05/2017 à 20:26, Bald Eagle a écrit :
> Posting this here for lack of a better place.
> 
> I'm interested in widening the output of a sin() trace - using POV-Ray to
> generate output for SVG which then gets processed into ... something else
> (G-Code I think)
> 
> So I thought maybe doing a simple "circle-sweep" would do it, though it may be
> overly complicated on the device end.
> Doing a line segment sweep with lines normal to the sine wave might do it, but
> may still be overly complicated.
> 
> Stacking sin waves of different frequencies and amplitudes to offset to the
> sides / top / bottom  seemed the way to go.
> 
> I was wondering is anyone had any suggestions as to how to code that up.
> 
> 
> 
If I got it right, you want a path that follow a sinus function, with
probably a constant width.

Remember that the derivative of sin(x) is +cos(x), so to widen y = sin
(x), you could adjust the coordinates of the point to plot.

For an amplitude A of the sin(), the width W of the ribbon should be a
fraction of A.

You could use some (u,v) to (x,y,z) transformation with isosurface or
parametric

u: as you want (0 to 2 pi, for one run)
v: -1 to 1

x: u+W.cos(u)*v
y: A.sin(u)+W.sin(u)*v
z: 0


Post a reply to this message

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