Fills

Fills

In pattapatta, a fill is stroke mark-making inside a region — not solid CSS/SVG paint. Emit with fill="none" and a visible stroke. See Pen-plotter output.

Typical pipeline: construct → operate → fill → SVG.

Primary fills

ModuleMarks
hatchParallel, cross, weave, stochastic, perpendicular ticks, concentric shells
halftoneImage tone → lines or circles (pick one mode)
circlePackingCircles packed in a region
segmentSetLow-level hatch building blocks
import { createRect, hatchParallel, segmentsToOpenPaths } from 'pattapatta'

const region = createRect(15, 15, 70, 70)
const strokes = segmentsToOpenPaths(
  hatchParallel(region, { spacing: 6, angle: Math.PI / 4 }),
)

Hatch pattern map

HelperMarks
hatchParallel / hatchCrossStraight hatch / crosshatch
hatchWeaveFabric-like H/V runs (ABC weave)
hatchStochasticRandom non-intersecting segments
hatchPerpendicularPerimeter ticks (outline texture)
hatchConcentricNested inward offset shells (Path[])

Do not use SVG <pattern> / CSS fills for plotter output — expand geometry to real stroked paths instead.

Also fill-like

ModuleMarks
tilingCell boundaries as stroke patterns (arcDivision, grids, subdivisions)
contourOffset curves (inward / outward)
pointSetHilbert-ordered polylines and TSP tours through samples
constructioncreateSponge pore boundaries as stroke fills

Point-order fills

Sample points, then stroke a locality-preserving or tour path:

import { poisson, hilbertSort, findShortestTour, polyline } from 'pattapatta'

const pts = poisson(40, 10, 10, 90, 90, 3)
const hilbertStroke = polyline(hilbertSort(pts))
const tourStroke = findShortestTour(pts) // closed

Arc division / sponge

Stroke cell or pore outlines directly — no hatch pass required.

import { arcDivision, createSponge } from 'pattapatta'

const arcs = arcDivision(100, 100, 10, 5)
const sponge = createSponge(100, 100, 36, 2, 2, 6, 9)

Try it

Chained recipes on Examples; interactive hatch and packing under Live demos.