POV-Ray : Newsgroups : povray.advanced-users : Direct stochastic tiling : Re: Direct stochastic tiling Server Time
27 Jul 2024 08:21:29 EDT (-0400)
  Re: Direct stochastic tiling  
From: Bald Eagle
Date: 3 Nov 2023 15:35:00
Message: <web.65454a8c5bb87ec31f9dae3025979125@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:

> One thing I'd like to do in yuqk is dump the two inbuilt spiral patterns
> for more general, tapered spiral warping as one or more additional
> options of the warp{} mechanism.

Just search "shadertoy spiral" and you'll be there for hours.  ;)
https://www.shadertoy.com/user/FabriceNeyret2     is your guy.
Maybe if we reached out to him, he might have some interest in seeing what we do
here...

> We have too f_spiral() - which has issues - as you well know. The
> solutions to which, I believe, sit more with some sort of general
> tapered warping capability.

Well, f_spiral, I think - was just something to make an isosurface type thing.
I think we could probably use some general spiral equations and implement the
tubular function approach for things like that.

Speaking of functions, it would probably be a good idea if you're implementing
inbuilt functions to have some mechanism by which to get the 1st and 2nd
derivatives, or a tangent to a point using a numerical approach --- useful
things to have that make coding a scene & orienting shapes a thousand times
easier for people.

With regard to warps and spirals, I finally got that spiral warp worked out,
which is just a rotation matrix with a falloff function.

Perhaps you could play with a general warp mechanism which takes a
transformation matrix and a falloff function and pairs them up to make a warp.
You could have 2D warps, 3D warps (like my tornado), etc.

I also absolutely think that we need to have a geometric inversion function,
since I think it's something that would inspire a LOT of experimentation, cool
scenes, novel approaches, animations, and all manner of things I can't possibly
predict.

Ditto FFT.  Have it take a start, stop, and function (especially spline), and
have it output an array.

> Aside: We can today implement a limited form of the sort of spiral - I
> think you're implementing - with a series of half arc functions (there
> is too the new-ish list_object pattern in yuqk which could use the torus
> or functions via coded isosurfaces(a) (inside tests)). This approach,
> however, slows down significantly on the addition of each half arc.

Bah.  No need to do any such thing when doing it analytically it so
straightforward.

> (a) The inside test of 'isosurface shapes' is relatively fast when used
> for object based patterns. It's just whether the function returns a
> negative value or not at a given location. In fact, 'isosurface shapes
> for inside test purposes' do not need to be good isosurfaces with
> respect to being render-able as actual shapes!

True.  That might be a good point to make in the documentation.

- BW


The basic Archimedean spiral is just:

#declare Distance = function (X, Y, Z) {sqrt (X*X+Y*Y+Z*Z)}
#declare fmod = function (Value, Modulo) {select (Value, 1 - mod (abs (Value),
Modulo), mod (abs (Value), Modulo))}  // this gives a mod function that remains
consistant across the origin
#declare Sqr = function (N) {N*N}

#declare ArmSpacing = 0.004;
#declare LineThickness = 0.0004;

#declare Aspect = image_width/image_height;
#declare U = function {x/image_width*Aspect}
#declare V = function {y/image_height}

#declare Angle = function {atan2 (V(x,y,z), U(x,y,z))}
#declare l = function {Distance (U(x,y,z), V(x,y,z), 0)}

#declare Offset = function {l(x,y,z) + ArmSpacing * (Angle(x,y,z)/(tau))}
#declare circles = function {fmod (Offset(x,y,z), ArmSpacing)}

#declare FracTurn = function {abs (l(x,y,z)/ArmSpacing - Angle(x,y,z)/(tau))}
#declare ArcLength = function (b, _Theta) {b/2 * (_Theta * sqrt (1 +
_Theta*_Theta) + ln (_Theta + sqrt (1 + _Theta*_Theta)))}

#declare f_Spiral = function {select (circles (x,y,z) - LineThickness, 0, 1)}


Plenty of other spirals out there to code up and experiment with, once I get
some of this other heavy-lifting out of the way.

Maybe we could/should have a website topic every month / quarter, and solicit
submissions for algorithms, functions, patterns, renders, etc. and have
something new and fresh on the POV-Ray homepage.

(I still think that getting out there on social media, and promoting POV-Ray is
the way forward wrt to finding new talent, and new people to help write source
so that we can fix bugs, add new features, and brainstorm a workable fresh start
with 4.0.)

- BW


Post a reply to this message

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