Nodes/ComfyUI_KubaNodes/kubakub regions to svg / pdf / dxf
ComfyUI Node

kubakub regions to svg / pdf / dxf

Save regions (or a mask) as vector files for Illustrator, After Effects, a plotter or a laser cutter. outline: filled paths per region, straight edges stay straight, curves become Beziers; SVG with groups = region groups and ids = region names, PDF with one layer per group, DXF. centerline: the skeleton as open lines ordered for short travel (plotter, laser, engraving). width_mm > 0 writes real millimetres; kerf_mm offsets outlines for cutting.

By kubakubkub·Created 15 days ago·Updated 3 days ago· 9
kubakub regions to svg / pdf / dxf
  • regions
  • mask
  • matrix
  • preview
  • files
  • report
◄modeoutline►
◄width_mm0.0►
◄simplify_px1.0►
◄corner_deg35►
◄min_area_px16►
◄spur_px6.0►
◄kerf_mm0.00►
◄svgtrue►
◄pdftrue►
◄dxftrue►
◄filename_prefixregions►
◄select►
◄folder►
Categorykubakub/2d/regions

Inputs (16)

NameTypeDefaultDescription
modeCOMBOoutlineoutline: filled shapes per region (Illustrator, After Effects). centerline: single lines through the middle (plotter, laser, engraving).
width_mmFLOAT0.00–1000000Real width of the whole image in mm (one uniform scale); 0 = pixels.
simplify_pxFLOAT1.00–50Largest deviation from the pixel outline when simplifying.
corner_degFLOAT350–180outline: vertices turning more than this stay corners; 180 = no curves.
min_area_pxFLOAT160–1000000Drop specks and holes smaller than this.
spur_pxFLOAT6.00–1000centerline: drop side branches shorter than this.
kerf_mmFLOAT0.00-100–100outline in mm: grow (+) or shrink (-) every outline by kerf / 2. Ignored when width_mm is 0 (pixels have no millimetres).
svgBOOLEANtrueWrite an .svg (groups = region groups, ids = region names).
pdfBOOLEANtrueWrite a .pdf with one layer per region group.
dxfBOOLEANtrueWrite a .dxf for CAD, CNC and laser software.
filename_prefixSTRINGregionsStart of the file names (a number is added, earlier files are kept); 'sub/name' writes into a subfolder.
regionsoptKUBA_REGIONSThe regions to vectorise (from any kubakub regions node).
maskoptMASKVectorise a mask instead (e.g. a painted line layer).
selectoptSTRINGWhich regions, in plan syntax as in regions to mask: names with wildcards, group:, tag:; comma = or, space = and, '!' = not. Empty = all. Not used when a mask is connected.
folderoptSTRINGWhere to write; empty = ComfyUI output/kuba_vector.
matrixoptIMAGEPreview background.

Outputs (3)

NameTypeDescription
previewIMAGEThe vector paths drawn over the matrix.
filesSTRINGThe written files, one per line.
reportSTRINGRegions, paths, size in px or mm, line length for centerlines, and the written files.