Skip to content
PreciSim
physics

Workpieces on the stage

Calibration boards, PCBs, dies, wafers, trays, glue dots — how the things on the stage are generated, shaded and how tall they are, formula by formula.

"Formulas public, implementation closed": everything the engine does to turn the objects on the stage into the pixels a camera sees is written down here.

Objects are computed, not textures

Every object on the stage is parametric: give it a world coordinate and a sampling footprint and it answers three things —

Answer Used by
Appearance: the gray value at that point camera imaging
Height: how far the surface there sits above the stage defocus, range-finder readings, laser spot size
Feature ground truth: dot centers, corners, hole centers, pad centers, die centers automatic scoring (readable only when ground truth is exposed)

Objects come from generators; a preset is a named set of generator parameters. The generators today:

Generator What it is Feature ground truth
dot_grid circle grid calibration board every dot center (grid)
checker checkerboard inner corners (grid)
ring_target concentric ring target, optionally arrayed target centers
line_grid line grid crossings (grid)
blank / patch a uniform plate (blank marking plate, copper foil)
fiducial fiducial: circle / cross / square / diamond / ring center
pcb substrate + solder mask + traces + pads + fiducials + through holes fiducials, hole centers, pad centers
die bare die: perimeter pads or a bump array + alignment crosses pads, bumps, crosses
wafer wafer: disc + notch + streets + die array + ink dots die array, whole dies, ink dots, notch
tray tray: pocket array with a die in each pocket pockets, the actual pose of every part
holes / shapes arbitrary holes / shapes, optionally imported from files hole / shape centers
image a grayscale picture

There are 31 built-in presets (dot boards, checkerboards, targets, line grids, four blank marking plates, four fiducials, three PCBs, three dies, two wafers, two trays), each stating which algorithm it exists to validate.

Shapes: distance to the boundary

Every primitive (circle, rectangle, rounded rectangle, ring, segment, cross, diamond, polygon) answers one question: the signed distance d from the point to its boundary (negative inside, positive outside). Coverage follows:

t        = clamp((d − a/2) / (−a), 0, 1)    a = sampling footprint (how much stage one pixel covers)
coverage = t² (3 − 2t)                      exactly 0.5 on the boundary

Centers and corners sit exactly where the parameters put them, with no quantization — that is why feature ground truth is exact to the nanometer.

Regular arrays (tens of thousands of dots on a board, hundreds of dies on a wafer) are not tested one by one: round(coordinate / pitch) finds the nearest element directly. Irregular point sets (imported drill files) are bucketed into a grid, so each sample only looks at the few shapes in its own cell.

Stacking: composite from the top down

Objects have a layer (layer, higher on top). A sample composites downward starting from the topmost object:

G ← 0, A ← 0
for each object (top to bottom):
    w = (1 − A) × coverage
    G ← G + w × gray
    A ← A + w
    stop once A reaches 1
gray = G + (1 − A) × stage texture

Opaque objects (boards, substrates) have coverage 1 everywhere inside their outline; objects that only draw shapes (a fiducial printed on a PCB, an imported contour) are 0 outside their shapes so whatever is underneath shows through. Height comes from the first object that carries height and covers more than half of the sample.

Materials and lighting

Each material has a diffuse gray g (texture included) and a specular strength s (0–1). There are four kinds of light: coaxial coax, low-angle ring ring, back light back and dome dome, normalized into shares c r b d (summing to 1) by their intensities.

flat  = exp(−(slope / 0.08)²)        flat surfaces reflect coaxial light back into the lens
edge  = 1 − exp(−(slope / 0.35)²)    slopes reflect low-angle light into the lens

gray  = g × (1 − 0.8 s r)
      + s × (250 − g) × c × flat
      + s × 200 × r × edge
      + s × (250 − g) × d × 0.35
hole  = g + (245 − g) × b

Materials with s = 0 (calibration boards, FR4) ignore the direction of light and only follow total brightness. Copper, silicon, solder and glue have s of 0.6–0.8: bright under coaxial light, dark on flat areas under a low-angle ring light, bright on slopes (glue-dot rims, solder bumps) — which light an alignment algorithm should use shows up here.

Built-in materials (gray / specular): board white 205/0, black 35/0, FR4 150/0.05, green solder mask 95/0.25, copper 185/0.6, HASL 200/0.7, silicon 120/0.8, aluminum pad 215/0.5, black anodized aluminum 38/0.15, stainless 165/0.45, PET film 230/0.1, ceramic 225/0.05, epoxy 175/0.7.

What a laser leaves behind also depends on the material: black anodized aluminum marks white (lighten only), everything else marks dark (darken only).

Height and layered defocus

Objects have thickness: a PCB 1.6 mm, a ceramic plate 0.635 mm, a die 0.3 mm, a tray 3 mm… while the depth of field is around a tenth of a millimeter. So with focus on the stage a PCB is blurred and Z has to rise by the board thickness to focus on it — that is how real machines behave.

When a field of view holds several heights at once (a die on a substrate), defocus is applied in layers:

layer width = depth of field / 4 (at most 12 layers)
defocus of layer k = frame defocus − mean height of layer k
blur the whole frame once per layer; each pixel takes the result from its own layer

With a single height in view there is a single layer, identical to having no objects at all. The range finder reads the same combined surface (stage + objects).

Variants: placement error, scaling, warp, defects

Real parts are never placed the same way twice. Variants are sampled from a seed once and are deterministic after that:

Variant Effect
placement center offset ΔX ΔY and rotation Δθ (fixed, or sampled with σ)
scalePpm independent local X / Y scaling (PCB thermal expansion, flex stretch)
warpUm warp: a quadratic surface raised at the center, zero at the corners
missingPadRate fraction of pads randomly missing (not drawn and not in ground truth)
defects particles (with height), scratches, stains
contrast gain and offset on gray

The random source is derived from (machine seed, object id, variant.seed), independent of load order and thread scheduling. Feature ground truth records the sampled actual values: automatic scoring compares "what the algorithm measured" with "what actually landed", not with the nominal drawing. The console and the 3D view draw nominal values; actual values are only readable with ground truth exposed.

Processes: ablation, dispensing, drilling, pick and place

Process What changes in the world
Ablation (laser marking) capsule-shaped marks whose width follows the Gaussian beam with defocus; color depends on the material
Dispensing a spherical cap grows. Volume V, contact angle θ: t = tan(θ/2), base radius a = ∛(6V / (π t (3 + t²))), height h = a·t; a glue line has a parabolic cross-section with width w = √(3A / t), A being volume per millimeter
Drilling a through hole appears (bright under back light) and the height there drops back to the stage
Pick and place a part is taken from a tray pocket (the pocket is now empty) and placed at the target, its base resting on the surface there, with placement error sampled from σ

Dispensing, drilling and pick-and-place are triggered from the engine console and the host API today; dispenser and nozzle device interfaces on the HMI side are planned.

Importing from files

Source What is supported
Gerber (RS-274X) coordinate format, units, circle / rectangle / obround / polygon apertures, draws, flashes, linear and circular interpolation, regions; macro apertures and clear polarity are skipped
Excellon drill metric / inch, leading / trailing zero suppression, tool table, modal coordinates
DXF lines, circles, arcs, polylines (including bulge arcs); closed contours drawn filled or as outlines
Coordinate CSV x, y[, diameter]
Wafer map CSV row, col, bin; bins other than 1 get an ink dot
Images PNG (8 / 16 bit, non-interlaced), PGM

Gerber, drill and DXF files are Y-up; they are flipped to the stage's Y-down on import.

Last updated: Sep 23, 2026
Was this page helpful?