|
![](/i/fill.gif) |
Among other things, "JWV" <jwv|at|planet.nl> wrote:
> I understand what you mean now, but it is completely impossible to do that
> sort of thing with this macro. In the way this macro works, there is no
> knowledge of the actual final shape of the piece. So any test which checks
> wether a piece is a "defect" is not being done at the moment. It would be
> possible to check for any "defects", but not to do anything with it,
> since, when you change a "defect" into a normal piece, it would need the
> surrounding pieces to change as well (otherwise they won't fit). When the
> surrounding pieces change, there will likely be at least one new "defect".
> It would require a lot of code and time to make a "defects_density"
> parameter work. I wonder how puzzle manufactures do this...
Well, I had only a quick look to your macro, but it seemed to me that you
create some sort of array which defines, for example, whether each
horizontal lob would be a right- or left-lob. So, if the puzzle is 5 pieces
wide, there are 4 horizontal lobs (in each row) and you define a random
4-element array like:
[1 1 -1 1] (or maybe diffent numbers instead of 1 and -1)
This meaning that the first, second and fourth lobs are directed to the
right and the third is directed to the left. Then, looking at this array
you create each piece by adding an out-lob or an in-lob. Maybe I'm a long
way off, but it occurred to me that this would be a possible way, and the
code looked like it could be like that.
*If* that's the way you do that, then I think it's easy to do what I
propose. Instead of creating a random array, create an alternating one [1
-1 1 -1] (and [-1 1 -1 1] for the 2nd row, etc.) and then invert each
element with a certain probability (given by the "density of defects"
parameter). Afterwards, just create the pieces as before.
As I said, this holds if the macro works the way I believe it does.
Otherwise, forget what I said :)
--
light_source{9+9*x,1}camera{orthographic look_at(1-y)/4angle 30location
9/4-z*4}light_source{-9*z,1}union{box{.9-z.1+x clipped_by{plane{2+y-4*x
0}}}box{z-y-.1.1+z}box{-.1.1+x}box{.1z-.1}pigment{rgb<.8.2,1>}}//Jellby
Post a reply to this message
|
![](/i/fill.gif) |