About
What is KerfScript?
KerfScript is a small programming language for laser cutting, made by MyLaserTools. You describe a part with shapes, numbers and a few lines of logic, and KerfScript turns it into a laser file with separate cut, score and engrave layers. Change one number and the whole design follows: a box gets wider and its finger joints are counted again, a clock face gets more marks, a list of names becomes a sheet of gift tags.
This playground runs KerfScript right in your browser. Your code is not uploaded and there is nothing to install. The same code also runs from the command line and inside other apps, see the KerfScript website.
What the code looks like
Here is a tag with a hanging hole and an engraved name. The comment after width turns it into a slider from 40 to 200 mm:
width = 80; // [40:5:200]
label = "Hello";
difference() {
rect([width, 40], r = 6, center = true);
translate([-width / 2 + 8, 0]) circle(d = 5);
}
engrave() text(label, size = 12, halign = "center", valign = "center");difference() cuts the hole out of the rounded rectangle, and engrave() puts the text on the engrave layer. Paste it into the editor above and try it.
Made for the laser, not adapted from 3D
- Layers you can send straight to the laser. cut(), score() and engrave() put lines on their own coloured layers, and layer() adds your own.
- Kerf compensation. Tell material() how much your laser burns away and every cut outline moves by half of it, so tabs and slots fit snugly.
- Joinery built in. Finger joints, slots, T-slots for nuts, living hinges and a ready-made box library, all sized from your material thickness.
- Parts and sheets. Name pieces with part(), say how many you need, and KerfScript lays them out on sheets of your size and lists each part with its cut length.
- Text as outlines. text() uses the fonts on MyLaserTools and turns letters into paths, so your laser software never has to guess the font.
If you know OpenSCAD
KerfScript will feel familiar: modules, functions, for loops, difference() and translate() work the way you expect, and the customizer comments are the same. The difference is that everything is flat and made for the laser, so there are no 3D shapes to project and no holes or layers lost on the way to an SVG.
Free and open
The playground is free, and the files you make are yours to cut, sell and share. KerfScript itself is open source on GitHub under the AGPL licence, with a commercial licence for companies that want to build it into closed products.
To learn more, follow the step by step guide or read the full language reference.


