PDA

View Full Version : New Puzzle Generator!



Mike Audleman
12-13-2014, 8:19 PM
Well I hope yall will be as excited as I am! Failing to find a puzzle generator online or anything reasonably priced, I decided to do what I should have done in the first place :) Make one.

This is not just an overlay, it generates the puzzle based on your input of size, pieces per row and selected tab shape. I made 6 tab styles to start with so I could get it going. I can easily add more tab styles as time permits. If yall have some good ideas on tabs, send them along to me as SVG or Corel (x7 or earlier) and I can probably add them. You will want to keep the node count low (8-12), remember its 4 of these tabs per side per piece!

You specify a few parameters and it will generate various output styles for you to use. It will generate cut lines (all horizontal at once, all vertical at once) for lasers. This way the laser can cut an entire path across the puzzle instead of individual pieces. That really cuts down on laser time. It will optionally generate grouped shapes as individual pieces. This would be useful as a graphics overlay use.

The output SVG is fully vector so its scaleable with no loss in quality.

I generated a 4x3 puzzle and cut it out of 3mm ply. It worked perfectly and the pieces fit just fine.

I would appreciate any feedback on it. I am always looking to improve how I do things. I have only tested this in FireFox. My IE is not allowed on the web (firewall). I don't think there should be an issue with other browsers though.



302084

Scott Shepherd
12-13-2014, 8:33 PM
Amazing job Mike! Works in Safari just fine. That's just excellent, thanks for sharing it with us!

Julian Ashcroft
12-13-2014, 9:49 PM
It even works on my iPad.

Keith Colson
12-13-2014, 10:16 PM
Hi Mike

Great job, if you really wanted to polish it you could add some randomness to the tab locations and piece shapes to make them unique. It looks like you could fit the wrong piece perfectly into the wrong place. If they were unique then each piece would only fit in one spot.

Cheers
Keith

Mike Audleman
12-13-2014, 10:41 PM
Hi Mike

Great job, if you really wanted to polish it you could add some randomness to the tab locations and piece shapes to make them unique. It looks like you could fit the wrong piece perfectly into the wrong place. If they were unique then each piece would only fit in one spot.

Cheers
Keith

Thank you for your thoughts! Its that sort of thing I am looking for :)

Yes, that is one of the things I was looking at adding in the future. I had been working on a method of doing so but wanted to get the core of the generator working and get a reasonable shape library started first.

One idea I came up with is defining each row and column's unique height and width and then scaling the tabs accordingly as its output. For example I was looking at scaling all even rows. So row 2,4,6 etc would each have a unique height apart from all others. The difficulty I was running into is in the end the sum of the sizes would need to be the same. So if row 2 was reduced by X amount, then row 4 would have to be increased by the same amount to make it all come out at the bottom row. As I said, still a WIP.

Another method I was looking at was skewing the nodes where the tab joins its parent piece. Pushing them within the piece either left or right. This alleviates the need to deal with the rows but it also requires I define the node range in the data matrix where skewing would take place while other points would remain fixed. So, again, not an easy solution but a possible one. In the same vein, an alternate would be to scale the tab width so the tab simply is a different width for each piece.

BTW, I have added the following new tab styles...
Clover
Cross
Heart
Tree
Ball
Football

Not all are suitable at smaller sizes (cross and tree for example) but for larger pieces and/or graphics work they should be fine.

Keith Colson
12-13-2014, 11:39 PM
Here are a couple of ideas.

Add a sinusoidal modulatio to the horizontal line with a bit of randomness. And do the same with y.

e.g.
x = x + sin(theta) * modulataionWidth
theta = theta + frequency + (amountOfRandomness*rnd)

Have a checkbox for the tabs so we can choose multiple tab types that you can randomize into the pieces.

The fact that you have it working is great!

Cheers
Keith

Andrew Holloway
12-13-2014, 11:53 PM
Very impressive! I look forward to seeing how the randomness progresses.
Works great in Chrome.

Mike Audleman
12-14-2014, 12:41 PM
I tried it on my android phone. It works but that browser does not support SVG as images. So I added some javascript to detect browser support for SVG and it displays a warning beside the Preview/Download option box telling you that your browser doesn't support SVG. It also shuts off the attempt to render the piece previews.

Dave Sheldrake
12-14-2014, 1:15 PM
brilliant!

That is all I can think of :) really great job Mike :)

cheers

Dave

Mike Audleman
12-14-2014, 4:47 PM
Here are a couple of ideas.

Add a sinusoidal modulatio to the horizontal line with a bit of randomness. And do the same with y.

e.g.
x = x + sin(theta) * modulataionWidth
theta = theta + frequency + (amountOfRandomness*rnd)

Have a checkbox for the tabs so we can choose multiple tab types that you can randomize into the pieces.

The fact that you have it working is great!

Cheers
Keith

A little easier :)

I did some reading on the transformation function in SVG and I was able to re-code the row/column generation to apply randomness in the form of skew. I set a parameter (max skew) for each tab. I now provide you two dropdown boxs to select the amount of skew as a percentage in the X and Y directions. It then chooses a random number based on the max set by the tab data and percent you selected and then randomizes the positive/negative direction. When the row is written, its wrapped in a group layer that has the skew applied to it.

I tested this in Corel X7 and the browsers available to me. It appears to work just fine. I even ungrouped all the objects and the transformations applied remain in place in Corel. The exported DXF as loaded in RDWorks also contains the transformations.

So, there ya go. Randomness :)

Not sure how much more work I am going to do to it in the near future. I am leaving for Florida next weekend and will be down there until after the new-years.

Keith Colson
12-15-2014, 9:22 PM
Well done Mike, you are truly a winner!

Cheers
Keith

Mayo Pardo
12-16-2014, 5:10 PM
I tried this out last night and the puzzle turned out real nice!

With the material I was cutting, I decided to make 3 passes and although I thought I had selected Rows/Columns for continuous cut lines, it actually cut each line 3 times before proceeding to the next piece.
It first processed the horizontal, then went on to the vertical, but each piece was processed as a separate line.

The outer border did continuously cut the entire shape before making the additional passes.

Should I have done any additional editing in Corel like join nodes or ?
Maybe I just didn't select Rows/Columns like I thought I did...
I can upload a video of it if necessary.

Trying it again today.
Now if I can figure out how to eliminate the burnt smell on the puzzle!

Chris J Anderson
12-16-2014, 7:20 PM
Here are a couple of ideas.

Add a sinusoidal modulatio to the horizontal line with a bit of randomness. And do the same with y.

e.g.
x = x + sin(theta) * modulataionWidth
theta = theta + frequency + (amountOfRandomness*rnd)

Have a checkbox for the tabs so we can choose multiple tab types that you can randomize into the pieces.

The fact that you have it working is great!

Cheers
Keith


EXACTLY - what I was going to suggest :)

David Rust
12-17-2014, 5:59 PM
Can you make it a downloadable executable for those who don't always have access (or reliable access) to the web!

Mike Audleman
12-18-2014, 3:16 PM
I tried this out last night and the puzzle turned out real nice!

With the material I was cutting, I decided to make 3 passes and although I thought I had selected Rows/Columns for continuous cut lines, it actually cut each line 3 times before proceeding to the next piece.
It first processed the horizontal, then went on to the vertical, but each piece was processed as a separate line.

The outer border did continuously cut the entire shape before making the additional passes.

Should I have done any additional editing in Corel like join nodes or ?
Maybe I just didn't select Rows/Columns like I thought I did...
I can upload a video of it if necessary.

Trying it again today.
Now if I can figure out how to eliminate the burnt smell on the puzzle!

I ran into that as well. Not just with my puzzle code either. I have had that happen several times with other downloaded designs and one of the box generators online. There is a function in RDWorks (what my laser uses) that combines all nodes within a certain distance. My default is .5mm. Its such a habit at this point, I do it every time I load a DXF (since I can't send direct from Corel X7), I guess I never thought to mention it or see what the root cause was. There may be a Corel function to do the same job, though I don't know what it is (HINT to the Corel Gurus to chime in!). In RDWOrks, its literlally 2 mouse clicks and I do it every time I open a file. Habit you know.

I am thinking its in the way each edge is included in the row. The curve is drawn, then a pen move and then the next curve. The nodes on the curve are relative to the current pen position in SVG (hence why the scale/skew was so easy to implement) and thats the reason for the move pen command before each side is drawn.

If you had selected individual pieces, you could select each piece in the puzzle from the object panel in Corel and you would be able to move it. It would also result as a double cut at the laser since it would result in duplicate cut commands where pieces join.

The reason the outer cut is done as a continuous cut is its drawn as a RECTangle and is a single object.


As for the burnt smell, I coated mine with a semi-gloss clear coat and hit it with #0000 wool and tack cloth before cutting. Then I use 100% denatured alcohol with an old t-shirt cloth and wipe it down well after the cut. Then I spread the pieces out on a TV tray with wax paper and I give it a light coat again from all 4 directions which catches the edges. After the clear coat dries there is almost no noticeable burn smell. And the puzzle looks really good after the clear coat. I am using Deft fast drying clear coat (http://www.rockler.com/deft-semi-gloss-wood-finish-spray).

Mike Audleman
12-18-2014, 3:31 PM
Can you make it a downloadable executable for those who don't always have access (or reliable access) to the web!

Remotely possible I guess. Thing is, I can update the data files with new shapes on the server or add new functions/modes (like the recent randomness) and you instantly have the newest version. With an executable, I would have to re-compile it each time and you would have to download it again to get any new features.

Its kinda the reason I wrote this to start with, easy and online. There are EXEs that generate puzzles (most require purchase). I really didn't like them. There is also a corel plugin I think that does puzzles. I also didn't like the idea of downloading executables from unknown sources, you know, viruses and adware and the like. Making it a simple web page eliminated ALL that. No downloads. No viruses. No adware. No need to write it for Apple AND Windows AND Linux.... you get the idea. Being a web page solved a lot of problems many people don't think about where software comes into play.

I tried to make it as light weight as possible so bandwidth limited individuals could easily use it but it still puts out good and usable SVGs we can use to cut with.

So I am not going to dash your hopes and say no I won't ever make it an executable. At least not completely no. But, I have to say that its not very likely anytime soon. And probably never for the apple platform(s), I don't have the development software to code for apple. Windows yea, apple no.

For the near future, expect it to remain as a web page.

Gerd Spatz
12-19-2014, 3:44 AM
I also didn't like the idea of downloading executables from unknown sources, you know, viruses and adware and the like. Making it a simple web page eliminated ALL that. No downloads. No viruses. No adware. No need to write it for Apple AND Windows AND Linux.... you get the idea. Being a web page solved a lot of problems many people don't think about where software comes into play.

I agree 100%!
Thats my motivation to realize the boxdesigner (including a small puzzlegenerator ;-) ) as a webservice and not as a executable...

Mike Audleman
12-19-2014, 12:23 PM
Sorry sir, I didn't know you had already done one online? Got a url to it? Shame it never came up in google searches when iw as looking for puzzle generators.

Gerd Spatz
12-20-2014, 7:59 AM
Sorry sir, I didn't know you had already done one online? Got a url to it? Shame it never came up in google searches when iw as looking for puzzle generators.

No problem Mike!
URL: Last time i posted a URL to my own site i got a friendly message from the admin... so i respect the rules of SMC
Google search: "frag den spatz box designer" Your puzzlegenerator has a little bit more features, but mine is just a small subfeature of the boxdesigner. And mine is cheap but not completely free.

I think i should do more SEO work ;-)

Gerd

Bert Kemp
12-20-2014, 12:55 PM
Could someone explain what the skew setting does and how it effects the puzzle thanks

Mayo Pardo
12-20-2014, 1:56 PM
Bert, in looking at the preview of the generated puzzle, when skew is applied it looks like it puts an angle on the tabs of the pieces? I haven't cut a test yet to verify this.

Mike Audleman
12-23-2014, 4:13 PM
Could someone explain what the skew setting does and how it effects the puzzle thanks


Bert, in looking at the preview of the generated puzzle, when skew is applied it looks like it puts an angle on the tabs of the pieces? I haven't cut a test yet to verify this.

That is correct. If you set it to use skew and select preview, you can refresh that popup preview page and you will see the tabs angle change with each reload since it will choose random skews each time. FYI, if you are previewing, and you end up with one you like, if you then use your browser's "SAVE AS" option, you can save the SVG :)

Here is how it works. It angles the tab/edge curve either left or right (random) a random angle. Picture a parallelogram. A no skew produces a rectangle, a low skew produces a mild parallelogram, and a high skew produces a very angled parallelogram. Now, if you draw a single edge tab inside that ractangle and apply a skew, you can see how the tab will be affected by the tilting of the top either left or right. The actual amount of skew is determined by the tab shape you select. Some tabs can skew more without causing touching tabs in the corners than others so I set a max limit on each shape. You then choose a 0% to 100% (in 10% steps to keep is simple) amount of skew as the max YOU want that is a percentage of the max I set for the tab shape. So if you set it to 50% and I had limited the tab to a max of 20 degrees of skew, it will randomly choose a number between -10(50% of 20) and +10(50% of 20) degrees to skew the tab. Each row and column gets a random pick so each one is likely unique so row 1 may be -8 and row two may be +4, col 1 may be +7 and col 2 might be +1, etc. Then when you look at any individual piece it has a possibility of 4 completely different skews applied to it, one per side since it participates in two rows (top and bottom) and two columns (left and right). Any adjacent piece will have only one of those 4 in common and it should have 3 others that differ.

I put this in as a randomization factor to make it so its unlikely that any piece could physically fit anywhere but its own place despite the picture on its front. This should prevent the puzzle from being assembled in such a fashion that the picture on the front is not correct.

As it notes on the page, this does not apply to individual pieces. I am in Florida on vacation right now. I didn't get a chance to deal with the skew factors on the code that generates individual pieces before I hit the road. I figured most of us were wanting the whole rows/columns cutting anyway since individual pieces are not really appropriate to laser cutting anyway (unless you want a single piece to cut).

So, hope that explains it a bit better. I know most of us like to know whats under the hood of things. Kinda the nature of what we do I guess. I am the same way so I don't have a problem with these questions

And after I get the code cleaned up and fully debugged. I can make the ASP files available to anyone who wants to take what I did and improve on it. Its in VB so it should be pretty simple to work with and I didn't use any custom DLLs. So long as you don't profit from it by selling the code itself (feel free to sell the puzzles you make with it, don't care about that).

Lastly, I only annonced it here at SMC. I don't care if yall post links elsewhere, its fine by me if you do or don't. Its not a secret. I just have received a great deal of help and information from the members here at SMC, I felt I should let yall have the lead crack at it first. I won't be charging anything for it, ever. I really don't benefit in any way whether yall use or tell others...or don't. Its a freebie. It will always be a freebie. Its for yall to use freely, no strings attached.

Ray Scott
01-06-2015, 11:32 PM
I have a web site for my business. I believe that I get a lot of traffic for people reading the tutorials, FAQs, schematics and such. I would love to add your asp code to a web page within my site. It looks to be a nice feature... And would continue to be freely available.

thank You,

Scott Shepherd
01-07-2015, 8:50 AM
I have a web site for my business. I believe that I get a lot of traffic for people reading the tutorials, FAQs, schematics and such. I would love to add your asp code to a web page within my site. It looks to be a nice feature... And would continue to be freely available.

thank You,

Why not just link to his page? Then it drives traffic to his site and it helps him, rather than you alone? Linking it makes sure both of you benefit from the traffic.

Lee DeRaud
01-07-2015, 10:26 AM
And after I get the code cleaned up and fully debugged. I can make the ASP files available to anyone who wants to take what I did and improve on it. Its in VB so it should be pretty simple to work with and I didn't use any custom DLLs.Hmmm...for some reason the phrase "convert to CorelDraw macro" just jumped into my head. :cool:

Mark Ward
04-06-2015, 4:54 AM
Superb work that Mike.

Does anyone have a single jigsaw puzzle piece with 4 male connectors on it by any chance?

Bruce Bob
07-21-2015, 6:40 PM
I tried the link from the #1 post. In the past it worked . Now i get this message....

Microsoft OLE DB Provider for SQL Server error '80004005'

Invalid connection string attribute

/permissions/globalASASQL.asa, line 26..........

Can anyone tell me what that means?

Are there other puzzle generator if this is not available any more?

Mike Audleman
07-22-2015, 1:19 PM
Superb work that Mike.

Does anyone have a single jigsaw puzzle piece with 4 male connectors on it by any chance?

I set my puzzle generator to 3 pieces per row and random and individual pieces. Then refreshed until the center piece was 4 outward tabs (male).

317889

Take the .txt off it to make it a svg. Then you should be able to open it up and get at the center piece.




I tried the link from the #1 post. In the past it worked . Now i get this message....

Microsoft OLE DB Provider for SQL Server error '80004005'

Invalid connection string attribute

/permissions/globalASASQL.asa, line 26..........

Can anyone tell me what that means?

Are there other puzzle generator if this is not available any more?




My bad. Sorry. Let the transaction logs get full.

Should be all good now.

Bruce Bob
07-22-2015, 5:33 PM
I set my puzzle generator to 3 pieces per row and random and individual pieces. Then refreshed until the center piece was 4 outward tabs (male).

317889

Take the .txt off it to make it a svg. Then you should be able to open it up and get at the center piece.





My bad. Sorry. Let the transaction logs get full.

Should be all good now.


Works again.

Thank you

Bruce Bob
07-22-2015, 5:37 PM
I set my puzzle generator to 3 pieces per row and random and individual pieces. Then refreshed until the center piece was 4 outward tabs (male).

317889

Take the .txt off it to make it a svg. Then you should be able to open it up and get at the center piece.





My bad. Sorry. Let the transaction logs get full.

Should be all good now.


Working again Thank You

Steve Morris
11-01-2016, 9:44 AM
Is this still available anywhere, the link gives a 404 error??
Cheers
Steve

Mike Audleman
11-02-2016, 11:13 AM
All better.

Sorry. Windows 2000 server finally bit the dust. Picked up a new 1U server to put in place. Haven't really done much with my website on it. I just restored the folder with the generator in it.

Seems to be good to go. If you have problems, let me know and I will look into it.

Doug Fisher
11-02-2016, 2:20 PM
I just tried it and received:
HTTP Error 500.0 - Internal Server Error

Mike Audleman
11-02-2016, 3:00 PM
Thats freaky. I tried it in two different browsers and my phone. Works fine. Try dumping your cookies/cache. Did an IIS reset. Maybe it still had latent connections cached.

Doug Fisher
11-02-2016, 8:16 PM
I just tried it and it worked. Thanks.

Joseph Shawa
11-03-2016, 6:05 PM
I found a couple of things on the web.

Here is a pluggin for inkscape if you use it.

Inkscape-jigsaw

Also Google creating-custom-jigsaw-puzzle-patterns-in-inkscape/3077 for a simple method of doing it without software.

Also Youtube Any photo into a jigsaw puzzle - Photoshop - Week 21

Carol Mancuso
11-07-2016, 4:55 PM
Mike
Just wanted to say thanks! This post was timely as I wanted to make a puzzle of a picture of my Dad's pond for his 85th birthday. I had a high res photo printed as an 18x24 poster at Staples. I glued that with spray adhesive to thin plexiglass and set up a 660 piece puzzle using your tool. Turns out its a really hard puzzle. I used plexiglass because I couldnt think of a convenient way to get rid of the char I got when using chip board. Also, I cut the puzzle with the photo facing down. seemed to minimize char on the edges. A quick wipe with a dry paper towel took care of what little residue was there. Thanks again!
Carol
347080

Mike Audleman
11-07-2016, 5:23 PM
Thats cool stuff! Good to see it put to use!

Tal Siegmann
04-23-2019, 11:02 AM
Is this great tool still available for download?

Lee DeRaud
04-23-2019, 6:09 PM
Is this great tool still available for download?I'm guessing "no", since the link to the site got purged.

You might try sending a PM to Mike Audleman, but it looks like his last activity on this forum was in 2017.