POV-Ray : Newsgroups : povray.binaries.images : Cylindrical pattern animation - how to get the circles/dots overlap : Re: Cylindrical pattern animation - how to get the circles/dots overlap Server Time
12 Jun 2026 18:52:50 EDT (-0400)
  Re: Cylindrical pattern animation - how to get the circles/dots overlap  
From: Bald Eagle
Date: 12 Jun 2026 15:15:00
Message: <web.6a2c5a15a47dc4fff58bc24b25979125@news.povray.org>
> I want to have a white mesh2 screen with slowly growing
> black polka dots, which finally overlap until no white is visible
> anymore - but instead they just stop growing as they touch each other!
>
> Is there a way to keep them growing anyway? Or do I have to use a
> different pigment pattern?

You need to use a different pigment pattern.
"The cylindrical pattern creates a one unit radius cylinder along the Y axis.
..... It starts at 1.0 at the origin and decreases to a minimum value of 0.0 as
it approaches a distance of 1 unit from the Y axis. It remains at 0.0 for all
areas beyond that distance."

https://wiki.povray.org/content/Reference:Cylindrical_Pattern

You probably want to use something like a
pigment { function {}} block, where you use sqrt(x*x+y*y) < Radius.
And then use your clock to change the radius
(that would give you a single growing disk)

To get around that, use sqrt (mod(x,1)*mod(x,1)+mod(y,1)*mod(y,1)) which will
make every disk repeat every unit.

But then you have to center them, using Mike Williams' repeat unit fix.
"Using mod(x,2) will cause the shape to be repeated in the x direction every 2
units. If your original isosurface
created a shape centred at the origin, then there's a problem with the way that
it chooses which bits to repeat.
The left half of the object gets repeated in one direction and the right half of
the object gets repeated in the other
direction. To fix this, we'd like to substitute mod(x,2)+1 where x is negative
and mod(x,2)-1 where x is positive. To
fix both directions at once, for a symmetrical object, we can use abs(x) like
this mod(abs(x),2)-1.
Page 17 of 149
To change the length of the repeat unit we can do this mod(abs(x),Step)-Step/2."

Which should give you:
sqrt ( (mod(abs(x),2)-1) * (mod(abs(x),2)-1) + (mod(abs(y),2)-1) *
(mod(abs(y),2)-1) )

If you just use the function value, you'll probably get a gradient.
You can use the above function to calculate a value by subtracting it from your
radius.  Use that as the first argument in a select() statement, and return 1 or
0 to get a hard white to black transition.

Hope that's understandable and helps.

- BE


Post a reply to this message

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