Documentation

Start with the first guide if KerfScript is new to you. The language reference lists every statement, module and function.

  1. Getting started

    This guide takes you from an empty file to a cut file in about ten minutes. You need nothing installed: the playground runs KerfScript in your browser.

  2. Layers

    Every shape in KerfScript is on a layer, and the layer decides what the laser does with it. Shapes that are not wrapped in a layer module are on cut.

  3. Kerf

    The laser beam burns away a thin line of material as it cuts. That width is the kerf, usually somewhere between 0.05 and 0.3 mm depending on the machine, the lens, the material and its thickness.

  4. Parts and sheets

    A design often has more than one piece. KerfScript lets you name each piece, say how many you need and what it is cut from, and lays them out on sheets.

  5. Settings

    Top-level variables with a plain value become settings: sliders, menus, checkboxes and text boxes in the playground, on MyLaserTools, and in any tool that reads OpenSCAD customizer comments.

  6. Command line

    The kerf command renders .kerf files to SVG, DXF or JSON. It needs Node.js 20 or newer and comes with the @mylasertools/kerfscript npm package.

  7. JavaScript API

    The same interpreter that runs the command line and the playground is a TypeScript library with no native code. It runs in browsers, web workers, Node.js and edge runtimes.

  8. Coming from OpenSCAD

    KerfScript borrows OpenSCAD's syntax on purpose: if you have written OpenSCAD, you can read KerfScript and write it within minutes. It is not a drop-in replacement.

  9. Laser software

    KerfScript writes ordinary SVG and DXF files, so any program that reads those can open them. This page says what we have actually checked, in which version, and what you still need to set up yourself.

  10. Versions

    KerfScript has two version numbers.

  11. Language reference

    Values, expressions, statements, layers, parts and sheets, built-in modules and functions.