POV-Ray : Newsgroups : povray.binaries.images : Automated creation of jigsaw puzzle pieces : Re: Automated creation of jigsaw puzzle pieces Server Time
15 May 2024 12:05:18 EDT (-0400)
  Re: Automated creation of jigsaw puzzle pieces  
From: Le Forgeron
Date: 12 Feb 2016 17:35:18
Message: <56be5e26@news.povray.org>
Le 12/02/2016 17:50, Bald Eagle a écrit :

> This gives rise to a further refinement of slanting the puzzle edge and
 the
> locking tab to smoothly follow that angle, which shouldn't be too bad o
nce I get
> back into the swing of things.
> 
> Then I just need to come up with some kind of formula for preventing tw
o slots
> from colliding with each other if they get generated too large or too c
lose, and
> wind up constricting and cutting off that corner.

I hope you want something like the attached picture (well, if I got it
right).

The pattern is using 2 exclusive zones, with security margin to avoid
problem.

Everything with a cubic_spline (and sphere_sweep).

cubic spline is required for: smoothness and going via the point.

In the triangular area, there is at least 4 points (but a fifth can be
added). the first point must be somewhere in the green part.
the second point is along an offset diagonal, and so is the third point.
an intermediate point between second and third can be added, as long as
it is between these points on the green-yellow axis, and nearer the
centre of the tile (without entering the no-go zone of blue diagonal.
the last point is back on the axis, somewhere in the yellow line.
then we can reach the corner point.

For a non-offset cross, this is all that is needed.

For an offset cross, as done by the vertical line, we need more points:
* on the horizontal line, we need to be sure that the line is flat for
the segment inside the small diamond at the centre, so we need an
intermediate point after the yellow zone, and before the corner point,
possibly near the intersection with the blue line and the horizontal
when entering the diamond.
* on the vertical line, we need to negotiate a corner with the spline,
so even more points are needed, including one very near another just
before reaching the horizontal segment (cubic spline has a small memory,
so we need to make it forget a bit of it when joining the horizontal
segment)

That's for one crossing, it can obviously be used alternatively for the
vertical and horizontal offset on a regular grid.

Also attached the scene for it.


Post a reply to this message


Attachments:
Download 'puzzle.png' (34 KB) Download 'puzzle.pov.txt' (3 KB)

Preview of image 'puzzle.png'
puzzle.png

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