No description
  • JavaScript 91.9%
  • HTML 8.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
wearyfax e98043c86d Rewrite the README against what the code now does
Most of it described a version that no longer exists. It documented
sharpenTips, which was deleted; the mitred offset, which was replaced by round
joins; and Min corner angle as the miter limit, which it has not been since.
The default it quoted for that setting was also wrong, 20 rather than 30.

Four settings were missing entirely: remove spurs, reuse traced silhouettes,
re-run mode and the debug log. The trace resolution row did not mention the
600 ppi option and several assertion counts were out of date.

Prose is tightened throughout: active voice, fewer qualifiers, and the
corner section reorganised around what actually produces the policy, which is
the offset rather than the passes that feed it. Also drops a stale comment in
geom.jsx pointing at the same deleted function.
2026-08-19 03:11:50 -07:00
lib Rewrite the README against what the code now does 2026-08-19 03:11:50 -07:00
test Lay the dialog out in two columns 2026-08-19 02:20:18 -07:00
.gitattributes Summa contour cut line generator for Illustrator 2026-08-18 21:34:58 -07:00
.gitignore Ignore local working notes in docs/ 2026-08-18 22:43:48 -07:00
README.md Rewrite the README against what the code now does 2026-08-19 03:11:50 -07:00
Summa-Cut-Line-Tuning.html Summa contour cut line generator for Illustrator 2026-08-18 21:34:58 -07:00
SummaCutLines-Remove.jsx Remove every confirmation prompt 2026-08-19 00:23:41 -07:00
SummaCutLines.jsx Remove every confirmation prompt 2026-08-19 00:23:41 -07:00

Summa Cut Line Generator for Adobe Illustrator

Generates contour cut lines and bleed shapes for print-and-cut stickers from placed or embedded raster artwork, for a Summa plotter workflow.

Tested on Illustrator 2024 (28.1) on Windows. Targets CC 2024 and later.

What it does

For every placed or embedded raster image in the document:

  1. Silhouette. Traces the artwork with Image Trace, then resamples it at the smoothing pitch (default 0.5 mm) to remove trace wiggle. Artwork on an opaque background, meaning a white PNG or JPEG rather than a transparent one, is detected per image and the backdrop excluded. See Backgrounds.
  2. Cut line. The silhouette offset outward (default 1 mm), drawn as a closed path with a 0.25 pt stroke in a spot color named CutContour (magenta, overprinting) on a top CutContour layer.
  3. Bleed shape (on by default). The silhouette offset further (default 2.0 mm, so 1 mm past the cut), filled black, on a Bleed layer behind the artwork. This stops white slivers at the cut edge when print and cut registration drift. RGB documents get true 0/0/0 rather than a CMYK conversion.
  4. FastCut rectangle (off by default). A rounded rectangle around each sticker at a set distance from its cut line, in its own spot color (FastCut, cyan). Use it to cut stickers out quickly, or with different blade settings, instead of following the contour. It stays inside the artboard.
  5. Artboard fit (on by default). Resizes each artboard to hug the geometry it contains, FastCut rectangles included.
  6. Sheet border (off by default). A through-cut rectangle around each fitted artboard in a second spot color (Thru-cut), for kiss-cut sheets.
  7. Validation. Reports and selects cut lines or FastCut rectangles closer than the minimum gap (default 3 mm), or overlapping. A sticker's own cut to FastCut spacing is deliberate and not flagged. Nothing is fixed automatically.

RGB and CMYK documents both work. Spot swatches and bleed fills are created in the document's own color space.

The script does not generate OPOS registration marks. Summa GoProduce or your RIP adds those at print time. The RIP finds cut paths by spot color name, case-sensitively, so CutContour and Thru-cut must match the actions your RIP is configured with.

Usage

  1. Open your gang sheet with the sticker images placed where you want them. Save first: the script makes many edits and single-step undo is not available.
  2. File > Scripts > Other Script..., then SummaCutLines.jsx. Keep the lib/ folder beside it.
  3. Set the options and press Run. Settings persist between runs. Nothing asks for confirmation, because nothing the script does is unrecoverable.
  4. Read the report for failures, spacing violations, and warnings. Anything flagged is also left selected in the document.

SummaCutLines-Remove.jsx removes everything the script generated. It never touches your artwork.

Re-running either replaces previously generated cut and bleed shapes, which is the default and what you want after moving or rescaling stickers, or skips stickers that already have them, which is what you want after adding new stickers to a finished sheet.

Staying up to date

Install by cloning and the dialog can update itself:

git clone https://git.kemono.online/wearyfax/summa-cutline-generator.git SummaCutLines

The repository is public, so cloning and updating work anonymously over HTTPS with no account or key. Cloning over SSH behaves identically. The updater uses whichever remote the clone already has and never rewrites it.

The top row of the dialog shows the installed version. Check for updates fetches from the remote and reports either Up to date in green or N updates available in red. Hover the text for the newest commit. Update fast-forwards the clone and reopens the dialog running the new code. Nothing checks automatically, because the dialog opens on every run and a fetch costs seconds.

Requirements and limits:

  • Windows only. ExtendScript has no synchronous shell, so the updater drives git through a temporary batch file. The macOS equivalent needs an executable bit ExtendScript cannot set, so on macOS the buttons say so and you pull by hand.
  • git must be on PATH, and the branch must have an upstream.
  • Credential prompts are disabled (GIT_TERMINAL_PROMPT=0). A clone that needs authentication fails with a message instead of hanging on a console prompt nobody can see.
  • Updates are fast-forward only, so local edits are never overwritten. A diverging clone reports the failure and changes nothing.
  • A copy not installed with git says so and disables Update.

Corners

The defaults suit a drag knife, which trails on a swivel and cannot physically turn a sharp corner. Hence the 1 mm corner rounding.

A tangential head (Summa S Class 2 T series) lifts the blade, rotates it to the new heading and re-plunges, so it cuts a decisive corner better than an arc it has to rotate through. On those machines the rounding throws away the head's main advantage.

Contour style picks between the two.

Averaged is min curve radius 0, the drag-knife behaviour. Everything becomes one flowing curve and Corner radius applies. Use it where the outline has many short protrusions, such as fur, foliage or spatter, which would otherwise become dozens of separate corners for the head to stop at.

Accurate keeps corners where the artwork has them. Min curve radius sets the tightest curve still cut as a curve; anything tighter becomes a corner. Raising it declares more of the contour un-curvable, so the outline gets crisper and more faceted. Corner radius is disabled, since rounding would undo the corners.

The test applies to the radius the cut will have, not the silhouette's, because an outward offset opens convex curves up (R + offset) and closes concave ones down (R - offset). A 1.2 mm notch becomes a 0.2 mm one after a 1 mm offset, so judging the silhouette alone would miss exactly the features that pinch.

How the corner policy is produced

The offset does nearly all of it. An outward offset is a Minkowski sum with a disk of radius equal to the offset, which rounds every convex corner into an arc of exactly that radius and leaves every concave corner mathematically sharp. Interior corners come out hard, exterior corners uniformly rounded, and the result cannot self-intersect. That is the requirement, computed for free, so Offset Path uses round joins and nothing else.

Mitering was tried and removed. It projects a tip out by offset / sin(angle/2), which at 20 to 40 degrees is 1.5 to 5.8 mm of invented geometry radiating off every point.

Two passes support the offset:

  1. Corner detection runs on a low-passed copy of the contour, because the raw trace polyline carries pixel-level wiggle and a circumradius over a short window reads that as near-infinite curvature. Without it, ordinary edges get declared corners by the hundred and the cut comes out sawtoothed. Detection ignores convexity. Its only job is to stop the resampler replacing a feature with a chord, and the offset decides policy afterwards from whatever shape reaches it.
  2. The resampler lands a vertex exactly on each detected corner, since otherwise the smoothing pitch rounds it off first. Those anchors are pinned out of the low-pass.

Min corner angle (default 30 degrees) is the sharpest interior corner the script will cut to a point. Anything sharper is left as the offset made it, slightly blunt, rather than merged to a spike. Below roughly 20 degrees the in and out cuts overlap and the sticker will not weed. The real figure depends on your blade, media and laminate, so sweep it on your own stock.

The manual's 0.2% and 0.25 mm accuracy figure describes media-advance tracking over a plot, in the section on length calibration. It does not describe the precision of two cuts meeting at a corner, so it is not the basis for this number.

Remove spurs (on by default) deletes zero-width spikes: an anchor the path runs out to and comes straight back from. Adobe's Offset Path and Pathfinder Add are not bit-deterministic and occasionally emit one, standing off the contour with nothing in the artwork to explain it. The blade would travel out and back along a single line. The threshold is Min corner angle, so nothing removed was ever cuttable, and every removal is named in the report. It is the only pass that deletes geometry on a rule, which is why it has a switch.

Anchor welding

Anchors closer together than 0.025 mm are dropped on every run, in either contour style. That is the cutter's addressable resolution (manual 6.2.6), so anything finer is below what the machine can act on. The cutter also does its own vector concatenation and curve smoothing, which micro-segment noise feeds unpredictably. decimate() cannot do this job, because it only removes anchors whose neighbouring segments are both straight, which after smoothing is never true.

Overcut and knife offset are deliberately not handled. Both are machine settings: overcut is 0 to 10 in roughly 0.1 mm units, knife offset is the tangential calibration. Baking either into path geometry would double up with the cutter's own correction.

Backgrounds

Sticker art arrives two ways, and they need opposite handling.

Transparent PNG, the normal case. The artwork is traced on a white background for its dark regions, and in robust mode again on a black background so white or pale artwork shows up too.

Opaque background, a white PNG or JPEG. Rasterizing it on black does nothing, because the background is not transparent: backdrop and artwork fuse into one light region covering the whole image, and the cut line collapses to a rectangle around the image edge. Such art is traced in a single pass at the Background whiteness threshold, so everything darker than the backdrop, including pale artwork, becomes the silhouette while the backdrop merges with the rasterize padding and is discarded.

The Background setting picks between them:

Mode Behaviour
Auto-detect (default) Decided per image. A traced region covering the image's own corners can only be a backdrop, so the black-background pass is discarded and the opaque route taken. Needs Robust silhouette on, since that pass is also the detector. Without it, Transparent is assumed.
Transparent Pre-1.3.0 behaviour, no detection. Use if Auto misfires.
Opaque/white Every image has a flat light backdrop. Single pass, no detection.

Detection costs no extra pass: the black-background pass runs first and doubles as the probe.

An alpha channel proves nothing. A flattened white-background export usually still has one, fully opaque, and Illustrator reports channels=4, transparent=true for it exactly as it does for real transparency. Detection reads the rendered pixels for that reason.

What this cannot do

White artwork touching a white background, such as a white keyline or die-cut border on a white backdrop. The two are one connected region of the same colour, so no threshold separates them and the outline is lost. Supply a transparent PNG for that art. The script warns whenever it detects an opaque background, because this is the case it silently damages.

Drop shadows are included in the silhouette and cannot be excluded by threshold. A shadow is darker than the pale artwork beside it, so any threshold low enough to drop the shadow drops the pale artwork first. Remove the shadow from the source image if you do not want it inside the cut.

Settings reference

Setting Default Notes
Cut offset 1.0 mm Distance from artwork edge to cut line.
Corner radius 1.0 mm Drag-knife minimum; 0 disables rounding. Disabled in Accurate style.
Contour style Averaged Averaged is min curve radius 0. Accurate keeps artwork corners. See Corners.
Min curve radius 0 (off) Accurate style: a cut-path curve tighter than this becomes a hard corner. Raise to sharpen more aggressively.
Min corner angle 30° Sharpest interior corner cut to a point, and the threshold for spur removal. Blade and material dependent; sweep it on your own stock.
Remove spurs on Deletes zero-width spikes left by the offset. Removals are listed in the report.
Smoothing 0.5 mm Silhouette resample pitch. Higher is smoother with less contour detail; 0 disables. Affects cut and bleed alike. Measured on real artwork: 0.25 mm roughly halves tip loss against 0.5 mm, and 0.1 mm gains nothing beyond that.
Cut spot name CutContour Case-sensitive; must match the RIP action.
Bleed on, 2.0 mm Measured from the artwork edge, so 1 mm past the cut.
Bleed fill Black Black, White or custom CMYK. RGB documents get native RGB (black = 0/0/0).
Background Auto-detect Auto-detect, Transparent or Opaque/white. See Backgrounds.
Background whiteness 250 Opaque backdrops only. Pixels at least this light, reaching the image edge, count as background. Lower for off-white or scanned backdrops; raise it if pale artwork is being eaten.
Robust silhouette on Second trace pass on a black background. Required for white or light artwork edges, and doubles as the opaque-background detector. Roughly 2x slower.
Threshold 200 Transparent artwork only. Pixels darker than this count as artwork (1 to 254). Raise if pale art is missed, lower if shadows are included.
Min detail 0.5 mm Traced specks below this size are ignored.
Trace resolution 300 ppi 150 ppi is faster and coarser. 600 ppi is four times the pixels of 300, so roughly four times the trace time.
FastCut off, 3 mm, r 2.54 mm Rounded rectangle around each sticker at the set distance from the cut line, spot FastCut.
Fit artboards on Resize each artboard to the geometry it contains, FastCut included.
Sheet border off, 3 mm Through-cut rectangle per fitted artboard, spot Thru-cut.
Min gap 3.0 mm Summa guidance: 3 to 4 mm between stickers, 5 mm for narrow shapes.
Reuse traced silhouettes on Keeps each traced silhouette in a hidden layer. Tracing is about 79% of a run and is unaffected by the offset, smoothing and corner settings, so reusing it makes retuning those nearly instant. Re-traces by itself if the artwork moves or resizes, or any trace setting changes.
Existing generated items Replace Replace regenerates them; Skip leaves stickers that already have them alone.
Debug log off Records every step and its timing, flushing after each line, so a crash still leaves the last action on disk.

Settings are stored at %APPDATA%\SummaCutLines\settings.json.

Production notes (Summa)

  • Drag knives cannot cut detail smaller than about 0.5 mm, or corners sharper than about 1 mm radius. Hence the rounding and min-detail defaults. On a tangential head both are pessimistic: switch the contour style to Accurate and drop Min detail toward 0.25 mm.
  • Summa OPOS tracking tolerance is roughly ±0.25 mm. The 1 mm cut offset plus 1.5 mm of printed bleed absorbs that.
  • Export for the RIP as PDF. Check in Acrobat Output Preview that CutContour separates onto its own spot plate and that the cut stroke overprints.
  • Keep stickers 3 mm apart or more. The script flags violations but does not move artwork.

Known limitations

  • Raster artwork only. Vector stickers are not processed.
  • Clipping masks. A raster inside a clipping mask is traced at its full size, so clipped-away pixels are included. The script warns. Crop the image itself instead of masking it.
  • Soft shadows and semi-transparent edges lighter than the threshold are excluded from the silhouette. Raise the threshold to include them.
  • White artwork on a white background cannot be separated from it, and drop shadows on an opaque background cannot be excluded. See What this cannot do.
  • Disjoint artwork in one image. Parts farther than twice the cut offset from the main piece are excluded from the cut line, with a warning. At a zero offset that distance is zero, so anything not touching is dropped. Put separate stickers in separate images.
  • The trace reads rendered pixels, not the alpha channel. Mid-gray artwork at the edge could in principle straddle both trace passes, but the default thresholds (200 and 60) leave no blind band, so each pass covers the other.
  • No automatic nesting or layout. Arrange stickers yourself.

Project layout

SummaCutLines.jsx          entry point: dialog, batch driver, report
SummaCutLines-Remove.jsx   removes all generated items (the "undo")
lib/                       modules (json, constants, log, geom, settings,
                           ai plumbing, trace, pipeline, validate, update, ui)
test/probe.jsx             API behaviour probes (run first on a new Illustrator)
test/e2e.jsx               headless end-to-end test (57 assertions)
test/white-bg.jsx          opaque-background regression test (8 assertions)
test/trace-cache.jsx       silhouette cache and invalidation (10 assertions)
test/corner-policy.jsx     per-corner interior/exterior policy (14 assertions)
test/resample.jsx          corner-preserving resample (11 assertions)
test/spurs.jsx             zero-width spur removal (14 assertions)
test/update.jsx            self-update batch text and parsing (20 assertions)
test/ui-smoke.jsx          dialog construction and size
test/fixtures.md           fixture sheet description

Tests run headlessly via COM from PowerShell:

$ai = New-Object -ComObject Illustrator.Application
$ai.DoJavaScriptFile("C:\path\to\test\e2e.jsx")
# results: test\e2e-results.txt, inspectable document: test\e2e-output.ai