Skip to content

wholeboard.simlab

Sim Lab: the circuit simulation laid over the finished board in 3D.

scene gives the browser everything it draws: the outline, copper, part bodies, where current flows on each track, what every part dissipates and how bright each LED is, the risks the simulation and board checks found, and the parameters a user can change with sliders. whatif re-simulates the design with changed parameters (a resistor value, a supply voltage, an IC's load current, the ambient temperature) and returns the new numbers. The thermal map itself is solved in the browser (web/simlab.js) from the heat each part gives off, so the airflow and copper sliders respond instantly.

With an enclosure (the printed one, the user's stock case, or the box WholeBoard would suggest), the board can be put in it: boxheat works out the air temperature inside, the circuit is re-simulated in that air, and the heat map uses the weaker cooling inside a box.

outline_polygon(geo)

The board edge as one closed polygon (arcs sampled), in board coordinates.

flows(geo, roots, sinks)

Each track with the direction current flows along it: away from the net's source pads, or towards them for return nets (ground). roots maps a net to the pad boxes (x0, y0, x1, y1) its current comes from.

part_state(spec, res)

Per part: heat given off (mW), current, the simulation's temperature estimate and LED light.

box_params(box)

The enclosure's controls: in or out of the box, vents, wall material and where it stands.

box_settings(box, values)

The enclosure controls' values, defaults filled in.

params(spec, res, box=None, room_c=None)

Every slider the Sim Lab offers. local ones only change the thermal map in the browser.

apply(spec, res, values)

A copy of the design with the slider values put in.

risks(spec, res, budget, checks, plist, pstate=None)

Everything worth a look, most serious first, each tied to parts and to the sliders that change it.

dynamic(spec, res, checks, box=None, boxset=None, room_c=None)

The parts of the scene a re-simulation changes. With the board in its box, res was simulated in the box's inside air and room_c is the room around the box.

box_risks(box, heat)

What the box does to the board, tied to the enclosure controls.

box_report(spec, res, box)

The box's heat for the enclosure step: inside air, surfaces, the hottest parts, and what vents would do.

scene(spec, geo, res, checks=None, box=None, dyn=None)

Everything the 3D Sim Lab draws, in mm from the board's top-left corner.

whatif(spec, base, values, out_dir, checks=None, box=None, **sim_kw)

Re-simulate with the slider values and return the changed parts of the scene.

In the box, the circuit runs in what the board sees there (the inside air and the walls): its own heat sets that, so a first run in room air (skipped when only the room or the box changed) gives the heat, then the second runs inside.