Turning dashed lines into actual line segments for lasercutting

I’m using Rhino in conjunction with a laser cutter, to make folded cardboard forms. I’m creating dashed lines in Rhino that I transfer to the lasercutter software. If I export the dashed lines they show up as continuous lines, so I’ve found it necessary to print the dashed lines first as a PDF. The workflow seems overly complex because I have to print the design from Rhino as a PDF, import the PDF back into Rhino, then save as a DXF which I can import in the lasercutter software. Is there a simpler way to turn my dashed lines into actual line segments without the printing and importing?


If you’re comfortable doing this through grasshopper that’s how I’ve gotten the results you’re looking for (also for lasercutting).

If this is the direction you go the only non-obvious part might be changing the Panel (see image) to turn off “multiline data” by rightclicking on it. Otherwise match the imageand then “bake” the curve component. Once you’ve got the script it takes a quick second to open and run it each time you need dashed lines. It’s also easier than dealing with linetypes and linetype scale

1 Like

Thanks very much for your input, Alexander! I haven’t used Grasshopper yet, but your screenshot makes the process look manageable. I will give Grasshopper a try, but I’d also like to have an alternative option ready for my students, who may find Grasshopper a bit intimidating. Do you happen to know of any other methods that would work entirely in Rhino?

Not off hand, no. Maybe someone else will chime in.

There was a labs tool for V4 that was called “ExplodeLinetype” (part of RhinoLabsTools) but it was removed for V5. I wrote script to replace it, it works pretty well, there might be a few cases on some splines where the pattern doesn’t match the original exactly. You can give it a shot.

For linetypes with dots in them, you have the option to replace the dots with either point objects or a very small line segment.


ExplodeLinetypeV12.py (8.6 KB)


Thanks for the python script, Mitch. I managed to run the script, but it doesn’t change the line at all. Do I need to plug in some info while the script is running to create the pattern? The command line doesn’t offer any obvious prompts.

Hmm, seems to be working here. If you run it you may see no visible change (if I did my job correctly). However, if you select the curve you processed and look in Properties, you will see that it is a set of grouped curves, not just one. You can either ungroup after, or choose the command line option not to group to begin with.

It is possible it’s failing on certain curves, if you have anything that completely refuses to work, post it here and I will try to debug the problem.

Thanks, --Mitch

Hi Joe,

I was intrigued by your topic and wanted to try out an idea. Based on your comments, it’s an all-Rhino solution that would be digestible for students. Admittedly a little inelegant or sloppy, it might fit the bill.

Not sure what you’re making, but I imagined a 5-point star.

I drew a star from the polygon tool and a two-segment polyline from the tip of a ray, to the origin, to inside corner between rays.
Using Dir to find start point and direction, I drew a 1 mm line from the start, with a Near snap to keep it on the star outline.
I used Array Along Curve to distribute the 1 mm line around the star. Not sure if this is necessary, but I like to use it with Array Along Curve. It gives the option to choose the number of objects to array or the distance between objects. I use both to get to my final choice. I assumed I wanted the laser to cut a 1 mm line, then a 1 mm gap, then cut the next 1 mm line, etc. I first choose Distance Between Objects and plug in 2 mm. Don’t hit Enter. When you enter a value in Distance Between Objects, the Number of Objects updates in the background. I then change to Number of Objects, and type in the value that Distance Between Objects generated (the tool doesn’t actually update the Number of Objects value with the whole number calculated from the Distance Between Objects option, so that’s why I re-enter the same value that’s already there), and hit Enter. This distributes the whole number of 1 mm lines evenly along the shape of the star, with a slight variance in the space between the 1 mm lines. Repeat with the 2-segment polyline for the interior folds.
The sloppy part about this is that some parts of the 1 mm lines extend beyond the outline shape. With laser-cutting cardboard, I didn’t think this was crucial or a deal-breaker. If that’s not the case, you could go back and trim off anything that extends beyond the outline (the inelegant part, ha!). In the example, I put the lines to laser cut on the black layer, so that would be the only layer to export to the laser cutting machine.

Would this workflow do what you need?

Best regards,
Dashed line star.3dm (119.1 KB)

Hi everyone, Thanks very much for your input. I tried the methods suggested above by Alexander, Mitch, and Doug. To my surprise, the easiest method was to use grasshopper. I was able to learn how to get started in Grasshopper and create a system for generating the dashed lines in just about a half hour. I’ve decided that I’ll just share the Grasshopper file with my students when the time comes for them to create the dashed lines. Thanks again for your help.

By the way, I’m including a few images below of the projects I’m working on that require this dash line.

1 Like

I think the thing I/you missed here is that my script takes something that has a dashed linetype (or any other linetype) and turns it into real interrupted geometry, whereas on rereading your post, I now think you want to make dashed lines from solid ones. My script won’t work at all with continuous lines, it’s looking for a linetype style that’s been applied.

The advantage of the script of course it that you can do more than dashed - any linetype you can create, it can produce (in theory, in any case). Plus, you don’t need Grasshopper or any knowledge of programming to use it.


1 Like

Hi Mitch,

Oh, now I understand! Thanks so much for clearing this up. I changed the linetype to dashed and then ran your python script, and it worked perfectly. Your script will definitely be the simplest and best solution now that I understand how to use it. Thanks again!


1 Like

Thanks mitch, works perfect.