POV-Ray : Newsgroups : povray.general : Pinching points : Re: Pinching points Server Time
10 Aug 2024 17:22:52 EDT (-0400)
  Re: Pinching points  
From: Chris Colefax
Date: 26 Nov 1999 20:41:56
Message: <383f36e4@news.povray.org>
Bill DeWitt <the### [at] earthlinknet> wrote:
>     You're welcome, but you made me curious and now I am working on
making
> an easy way to peak at whatever place you want to while making the
whole
> curve smooth. I haven't studied Chris's and Peter's yet because I want
to
> see what I can come up with by myself...

I think this may be somewhat difficult with a spline curve: to pinch a
linear sequence (in one dimension) you need an ever-increasing curve
that slows down as it approaches the pinch point and speeds up
afterwards.  A spline curve, though, is only increasing from -pi/2 to
pi/2 (plus or minus whole multiples of 2*pi), and in this period the
curve accelerates from the start and decelerates towards the end.  This
pinches the spacing towards the beginning and end, and stretches it in
the middle - the opposite of what we're looking for!

Parametising the code I posted shouldn't be too hard, eg:

#declare PinchPoint = 0.75;
#declare PinchPower = 2; // 1 = no pinching, increase for more

union {
   #declare C = 0; #while (C <= 1)
      sphere {x*(C < PinchPoint
         ? (1 - pow(1 - (C/PinchPoint), PinchPower))*PinchPoint
         : pow((C-PinchPoint)/(1-PinchPoint), PinchPower)*(1-PinchPoint)
+ PinchPoint
         ), .02}
   #declare C = C + 1/20; #end
   pigment {rgb <0, 0, 1>}}


Post a reply to this message

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