Dashed Vector Lines

I wrote a program that lets me cut out tuckboxes for board games. I enter the width, height, and thickness of a deck of cards, and the program writes out an .svg file that I can feed to Whisperer to cut the tuck box. I’m writing the .svg file directly, so it’s extremely clean and Whisper-compatible.

I do both cuts and scores, but scoring paper with the laser is rather tricky, because it’s hard to dial down the power low enough to not cut it, or at least not over-weaken the folding joints. I decided to try doing the score lines as dashed lines, so at least some of the paper would be intact. I wasn’t too surprised to find that Whisperer does not support the stroke-dasharray attribute, so I wrote code that chops a line into smaller lines.

I had hoped that the laser head would just cruise along in a straight line, firing the laser as it passed over each little segment, but it seemed to want to back up and make a separate pass for each of them. For x-axis lines, (left-right), that wasn’t so bad, but when it was doing y-axis lines, the laser head was still thrashing back and forth along the x-axis. It was cutting the dashed line more or less with straight vertical segments, but it was obviously slewing the laser head to the left before starting a line, then scoring the line, then slewing to the right, then back to the left to start the next one. I’m really baffled as to why it’s doing so much unnecessary head motion.

Sample SVG file is attached.

Scout

Further info: I took most of the score lines out of the sample file because it’s a fairly big file with all the little score dash lines. I had been scoring at 40mm/sec and 3mv, but the laser tube would sometimes fail to fire at 3mv, so then I tried 5mv and 60mm/sec. That still tended to cut deeper than I wanted. I tried the above file at both 60mm/sec (which results in lots of head shake), and 30mm/sec (which usually is pretty stable).

Whisperer would defer to inkscape and inscape interprets dashed lines like that when forced into shapes as a series of rectangles. So it’s drawing the rectangle edge of the dashed lines hence the thrashing.

1 Like

Since the latest beta MeerK40t does support dashed / dotted lines: Releases · meerk40t/meerk40t · GitHub

2 Likes

I’m not using Inkscape, I’m using Affinity Designer, and I’ve tried both having Affinity assign “dashed” to the line (which, not surprisingly, didn’t work at all), and by creating a series of solid lines with spaces in between them.