Create Templates

Create Templates

This project already supports many cutting templates but if you’d like to add your own, here’s how.

Before a cutting template can be used, the card size must exist in assets/layouts.json. This is the source of truth for all card and paper sizes — create_pdf.py reads it to place registration marks and lay out the card grid, so a template without a matching entry won’t work.

Update layouts.json

A layout entry looks like this:

{
    "card_sizes": {
        "domino": {
            "width": "1.75in",
            "height": "3.5in",
        }
    },
    "paper_sizes": {
        "letter": {
            "width": "11in",
            "height": "8.5in"
        }
    },
    "layouts": {
        ...
    }
}

You may edit the JSON manually or let generate_dxf.py edit it for you by using the --save flag with the single command.

For example, to create a new card size, use --card_width, --card_height, --card_name, and --save options:

python generate_dxf.py single output.dxf --card_width 1.75in --card_height 3.5in --card_name domino --paper_size letter --save

To create a new paper size, use --paper_width, --paper_height, --paper_name, and --save options:

python generate_dxf.py single output.dxf --card_size standard --paper_width 11in --paper_height 8.5in --paper_name letter --save

Both metric (mm) and imperial (in) units are accepted. This generates the DXF to the specified output path and saves the new card size, paper size, and layout entry to layouts.json automatically.

Generate DXF Files

Once the size is in layouts.json, use the batch command to generate DXF files.

Generate only missing templates (default):

python generate_dxf.py batch

Regenerate all templates:

python generate_dxf.py batch --all

Optimize orientations for maximum cards per sheet:

python generate_dxf.py batch --optimize

DXF files are written to:

  • cutting_templates/dxf/ - Default layouts with standard 10mm registration mark inset
  • cutting_templates/borderless/dxf/ - Borderless layouts with 3.5mm registration mark inset for tighter spacing

Create Template

There are two ways of creating cutting templates, either manually or autogenerating them. Autogenerating them requires calibrating GUI automation, which a bit more involved than manually creating templates.

Manual Template

To convert a DXF to a .studio3 file by hand, follow these steps in Silhouette Studio.

Step 1: Set DXF import preference

Open Edit > Preferences (Ctrl+K). Click the Import tab. Find the DXF Open dropdown and set it to As-is. Click OK.

This ensures DXF dimensions are preserved exactly as drawn when the file is imported.

Step 2: Open the DXF file

Press Ctrl+O. Navigate to and open your DXF file from cutting_templates/dxf/.

Step 3: Page setup

Click the Page Setup icon in the left sidebar.

  • Set the cutting mat dropdown:
    • Paper ≤ 12×12 in → 12" × 12"
    • Paper > 12×12 in → 12" × 24"
  • Set the media size dropdown to match the cutting mat.
  • Set the orientation (portrait or landscape) to match your layout.
  • Enter the exact media width and height in inches for your paper size.

Step 4: Center to page

Press Ctrl+A to select all, then Ctrl+G to group. Click the Transform icon in the left sidebar, then click Center to Page.

Step 5: Set registration marks

Click the Print & Cut icon in the left sidebar. Enable the registration marks checkbox. Set length, thickness, and inset to the minimum (set all to 0 to use Silhouette Studio’s minimum allowed values).

Step 6: Ungroup

Press Ctrl+A to select all, then Ctrl+Shift+G to ungroup.

Step 7: Save as .studio3

Press Ctrl+Shift+S. Save the file to cutting_templates/ with a .studio3 extension.

Autogenerated Templates

dxf_to_studio3.py automates the steps above using GUI automation. It requires a one-time calibration to record the screen positions of UI elements.

Calibrate

A pre-built calibration file is included at assets/gui_coordinates.json, tested on Silhouette Studio 5.0.402ss on Windows with a display scale of 100% and a display resolution of at least 1920×1080. If your setup matches, you can skip to the Convert New Templates step below.

If it doesn’t work, perform the calibration step:

python dxf_to_studio3.py calibrate

Silhouette Studio will open and you’ll be guided through hovering over each UI element and pressing Enter to record its position. Calibration is saved to assets/gui_coordinates.json.

Convert New Templates

python dxf_to_studio3.py batch --unit mm --new

The batch command processes all DXF files in cutting_templates/dxf/ and cutting_templates/borderless/dxf/:

  • --unit (required): Specify mm or in to match your Silhouette Studio’s unit setting. All registration mark values will be passed in this unit.
  • --new: Only convert layouts whose .studio3 file is missing (based on layouts.json versions). Omit this flag to convert all DXF files.
  • --dry_run: Preview what would be converted without launching Silhouette Studio.

.studio3 files are written to cutting_templates/ (default layouts) and cutting_templates/borderless/ (borderless layouts).

Convert a Single File

For one-off conversions with custom DXF files:

python dxf_to_studio3.py single input.dxf output.studio3 --unit mm --paper_size letter

The single command provides full control over a single conversion:

  • --unit (required): Unit for registration mark values - mm or in
  • --paper_size: Paper size from layouts.json (default: letter)
  • --orientation: landscape or portrait (default: landscape)
  • --registration: Enable registration marks
  • --reg_length, --reg_thickness, --reg_inset: Registration mark dimensions in the specified unit (default: 0 = minimum)

Pull Request

Make a pull request to share your cutting template with the rest of the world!