Create cutout paths for cutting printers to produce die-cut stickers, iron-on decals, and custom-shaped prints programmatically.
Cutouts define outline paths that cutting printers cut with a blade rather than print with ink. CE.SDK supports creating cutouts from SVG paths, generating them from block contours, and combining them with boolean operations.
This guide covers creating cutouts from SVG paths, configuring cutout types and offsets, combining cutouts with boolean operations, and customizing spot colors for printer compatibility.
Understanding Cutouts#
Cutouts are special blocks that contain SVG paths interpreted by cutting printers as cut lines. Printers recognize cutouts through specially named spot colors: CutContour for solid continuous cuts and PerfCutContour for dashed perforated cuts.
The spot color RGB values affect on-screen rendering but not printer behavior. By default, solid cutouts render as magenta and dashed cutouts render as green.
Creating Cutouts from SVG Paths#
Create cutouts using engine.block.createCutoutFromPath(path) with standard SVG path syntax. The path coordinates define the cutout dimensions.
// Create a circular cutout from SVG path (scaled up for visibility)const circle = engine.block.createCutoutFromPath( 'M 0,75 a 75,75 0 1,1 150,0 a 75,75 0 1,1 -150,0 Z');engine.block.appendChild(page, circle);engine.block.setPositionX(circle, 200);engine.block.setPositionY(circle, 225);The method accepts standard SVG path commands: M (move), L (line), H (horizontal), V (vertical), C (cubic curve), Q (quadratic curve), A (arc), and Z (close path).
Configuring Cutout Type#
Set the cutout type using engine.block.setEnum() to control whether the printer creates a continuous or perforated cut line.
// Set cutout type to Dashed for perforated cut lineengine.block.setEnum(circle, 'cutout/type', 'Dashed');Solid creates a continuous cutting line (default), while Dashed creates a perforated cutting line for tear-away edges.
Configuring Cutout Offset#
Adjust the distance between the cutout line and the source path using engine.block.setFloat().
// Set cutout offset distance from source pathengine.block.setFloat(circle, 'cutout/offset', 5.0);Positive offset values expand the cutout outward from the path. Use offset to add bleed or margin around designs for cleaner cuts.
Creating Multiple Cutouts#
Create additional cutouts with different properties to demonstrate various shapes and configurations.
// Create a square cutout with solid type (scaled up for visibility)const square = engine.block.createCutoutFromPath('M 0,0 H 150 V 150 H 0 Z');engine.block.appendChild(page, square);engine.block.setPositionX(square, 450);engine.block.setPositionY(square, 225);engine.block.setFloat(square, 'cutout/offset', 8.0);Each cutout can have independent type and offset settings based on your production requirements.
Combining Cutouts with Boolean Operations#
Combine multiple cutouts into compound shapes using engine.block.createCutoutFromOperation(ids, operation). Available operations are Union, Difference, Intersection, and XOR.
// Combine cutouts using Union operationconst combined = engine.block.createCutoutFromOperation( [circle, square], 'Union');engine.block.appendChild(page, combined);engine.block.setPositionX(combined, 200);engine.block.setPositionY(combined, 225);
// Destroy original cutouts to avoid duplicate cutsengine.block.destroy(circle);engine.block.destroy(square);The combined cutout inherits the type from the first cutout in the array and has an offset of 0. Destroy the original cutouts after combining to avoid duplicate cuts.
Customizing Spot Colors#
Modify the spot color RGB approximation using engine.editor.setSpotColorRGB() to change how cutouts render without affecting printer behavior.
// Customize spot color RGB for rendering (bright blue for visibility)engine.editor.setSpotColorRGB('CutContour', 0.0, 0.4, 0.9);Spot color names (CutContour, PerfCutContour) are what printers recognize. Adjust the names if your printer uses different conventions.
Exporting Cutouts#
Export the design with cutouts to PDF format to preserve spot color information for cutting printers.
// Export to PNG for previewconst pngBlob = await engine.block.export(page, { mimeType: 'image/png' });const pngBuffer = Buffer.from(await pngBlob.arrayBuffer());writeFileSync(`${outputDir}/cutout-result.png`, pngBuffer);console.log('✓ Exported PNG preview to output/cutout-result.png');
// Export to PDF with spot colors for cutting printerconst pdfBlob = await engine.block.export(page, { mimeType: 'application/pdf'});const pdfBuffer = Buffer.from(await pdfBlob.arrayBuffer());writeFileSync(`${outputDir}/cutout-result.pdf`, pdfBuffer);console.log('✓ Exported PDF with spot colors to output/cutout-result.pdf');The PDF output contains spot colors that cutting printers read to identify cut paths.
Troubleshooting#
Cutout Not Visible#
Cutouts render using spot color RGB approximations. Verify the cutout is appended to the page hierarchy and positioned within the visible canvas area.
Printer Not Cutting#
Check that spot color names match your printer’s requirements. Some printers need specific names like CutContour or Thru-cut. Consult your printer documentation.
Combined Cutout Has Wrong Type#
Combined cutouts inherit the type from the first cutout in the array. Reorder the array or set the type explicitly after combination.
API Reference#
| Method | Category | Purpose |
|---|---|---|
engine.block.createCutoutFromPath(path) | Cutout | Create cutout from SVG path string |
engine.block.createCutoutFromBlocks(ids, vThresh, sThresh, useShape) | Cutout | Create cutout from block contours |
engine.block.createCutoutFromOperation(ids, op) | Cutout | Combine cutouts with boolean operation |
engine.block.setEnum(id, 'cutout/type', value) | Property | Set cutout type (Solid/Dashed) |
engine.block.setFloat(id, 'cutout/offset', value) | Property | Set cutout offset distance |
engine.block.setFloat(id, 'cutout/smoothing', value) | Property | Set corner smoothing threshold |
engine.block.appendChild(parent, child) | Hierarchy | Add cutout to scene |
engine.block.setPositionX/Y(id, value) | Transform | Position cutout on canvas |
engine.block.destroy(id) | Lifecycle | Remove cutout from scene |
engine.block.export(id, options) | Export | Export page with cutouts to PDF |
engine.editor.setSpotColorRGB(name, r, g, b) | Editor | Customize spot color rendering |
Next Steps#
- Combine Shapes - Boolean operations on graphic blocks
- Create Shapes - Create geometric shapes programmatically
- Export for Printing - Export print-ready PDFs with spot colors