How to write a customizable design
Customizable designs are code with settings: KerfScript for the laser cut version and OpenSCAD for the 3D print version. This guide covers the settings syntax, KerfScript laser layers and 3D assembly, multi-colour 3D prints, the libraries you can use and how to publish.
What a customizable design is
A customizable design is code that builds a design from a few values. Visitors never see the code unless they ask for it: they get a normal settings panel, a live preview and downloads. The code runs in their browser, so nothing is uploaded while they customize.
One design can have two versions: a laser cut version written in KerfScript, which downloads as a layered SVG, and a 3D print version written in OpenSCAD, which downloads as STL and 3MF. Fill one or both in the Workbench and they are published together.
Turning variables into settings
Put your settings at the top of the file, before the first module. Each one needs a plain value. A comment after the value describes the control, a comment line above it becomes the hint, and a group comment starts a new section. KerfScript and OpenSCAD read the same comments, so a setting with the same name works the same way in both versions.
/* [Size] */
// Width of the tag in mm
width = 70; // [30:1:160]
height = 30; // [15:0.5:80]
/* [Text] */
label = "Hello"; // 16
shape = "round"; // [round, square, star]
size = 2; // [1:Small, 2:Medium, 3:Large]
hole = true;
colour = "#c08552";
/* [Hidden] */
$fn = 64;| In your code | What visitors get |
|---|---|
| width = 70; // [30:160] | A slider from 30 to 160 |
| width = 70; // [30:0.5:160] | A slider with a 0.5 step |
| count = 3; | A number field |
| shape = "round"; // [round, square] | A choice between the listed values |
| size = 2; // [1:Small, 2:Large] | A choice with your own labels |
| hole = true; | An on/off switch |
| label = "Hi"; // 16 | A text field with up to 16 characters |
| colour = "#c08552"; | A colour picker |
| size = [40, 20, 5]; | One number per axis |
| /* [Group] */ | Starts a new section of settings |
| /* [Hidden] */ | Everything after it stays in the code only |
Name variables in snake_case: hole_size shows as Hole size. Keep values in millimetres so they match the rest of the site.
Laser cut versions in KerfScript
KerfScript is a language made for laser cutting. Shapes are cut unless you wrap them in engrave() or score(), and the download is one SVG with a coloured layer per operation, ready for LightBurn or your laser software. Text can use any font from the MyLaserTools catalogue by name.
label = "Hello"; // 16
width = 70; // [30:1:160]
difference() {
rect([width, 30], r = 5, center = true);
translate([-width / 2 + 7, 0]) circle(d = 5);
}
engrave() text(label, size = 10, font = "Pacifico", halign = "center", valign = "center");
score() offset(delta = -2.5) rect([width, 30], r = 5, center = true);material() sets the sheet thickness and kerf, and part() names each piece and how many to cut. The KerfScript docs cover the whole language, and the KerfScript Playground has more examples.
See the parts put together
Give a part at = [x, y, z] to move it and rotate = [x, y, z] to turn it, in degrees, and the 3D preview shows the design assembled. Parts are turned first and then moved, as in OpenSCAD. When two placed parts collide the Workbench warns you, which is how a finger edge facing the wrong way shows up. Parts without a place lie flat beside the assembly, and box() places its own panels. Put parts inside step("Glue the base") and the preview gets arrows that build the model one step at a time. hardware() adds dowels, screws and magnets to the 3D view, and part(bend = [x0, x1, angle]) shows a living hinge bent.
material(thickness = 3, kerf = 0.1) {
part("base", at = [0, 0, 0]) rect([80, 40]);
part("back", at = [0, 40, 3], rotate = [90, 0, 0]) rect([80, 30]);
part("spare") rect([20, 20]);
}3D print versions in OpenSCAD
The 3D print version is an OpenSCAD program and downloads as STL and 3MF. Give parts different color() values and each colour becomes its own object in the 3MF, so you can assign filaments in your slicer. The preview follows the palette picker.
color("#c08552") cylinder(d = 60, h = 80);
color("#3d3277") translate([0, 0, 80]) cylinder(d = 62, h = 3);Libraries and fonts
use <kerf/box>finger-jointed boxes and panels in KerfScript.include <BOSL2/std.scad>rounded shapes, threads, gears and attachments in OpenSCAD.- Fonts for OpenSCAD text(): Liberation Sans, Liberation Serif, Liberation Mono and Noto Sans. KerfScript text() can use any font in the catalogue.
Limits
- Code can be up to 500,000 characters in one file.
- Only the bundled libraries can be included. OpenSCAD import() and surface() are not available.
- An OpenSCAD preview that takes longer than 45 seconds stops. Keep $fn modest while you work.
- Up to 60 settings are shown, in the order they appear in the code.
Publishing
- Set up your designer profile so your design can link back to you.
- Save the design in the Workbench. Saved designs appear in My Designs.
- Click Publish, add a title, a description and a photo of something you made with it, and choose a licence.
- Change the code later, save, and use Update public design to send the new version to your page.
Questions
Do visitors need to know how to code?
No. Visitors only see the settings, the preview and the download buttons. The code is there for makers who want to learn from it or copy it.
Can I upload a .kerf or .scad file I already have?
Yes. Use Upload .kerf or Upload .scad in the Workbench and the file goes to the version for its language. Files that use the customizer comment syntax keep their settings.
Who owns a published design?
You do. The licence you pick applies to the code and to what people make with it, the same as for a published design.
Is it free?
Writing, saving, publishing and customizing designs is free. Free accounts can keep up to 10 private designs; published ones do not count.
Can someone change my design?
Copy to Workbench gives them their own private copy. Your published design only changes when you update it.
3D print versions run on OpenSCAD, free software released under the GNU General Public License. Its source code is public, and our licensing page credits every open source project behind the Workbench.
Keep up with MyLaserTools.
Email me about new tools, product updates, tutorials, and occasional MyLaserTools offers. Unsubscribe at any time.
© 2026 MyLaserTools.com. All rights reserved.

