MyBenchLab Documentation Open editor

Guide — building your first bench

This guide assumes you have MyBenchLab running locally or on the hosted site. It walks you from a blank workspace to a saved bench with two meshing gears, then shows how to iterate.

1. Open the workspace

The home hub is a single page: an AI creation hero on top, a preset showcase, and your bench grid. Describe a bench in the hero field and hit Montar com IA (the workspace opens with the IA drawer pre-filled), or start clean with Bancada vazia / Importar .mbl / a preset card (or Sandbox 3D for an unsaved session, only available when the public.sandboxEnabled Meteor setting is on). You land on the workspace, a CAD-style layout: a hero 3D viewport, a left icon rail, a resizable bottom drawer, a full-height right dock, and a status bar.

2. Describe the mechanism

Code editor

The workspace starts with a tiny default bench (two gears meshing). A bench source is a JS module ending with export default defineBench(buildFn). The compiler strips the export default, runs the body inside a sandbox (no window, document, fetch, import, or Meteor), and passes a DSL context to your buildFn. A minimal example:

export default defineBench(({ mech }) => {
  const G1 = mech.spurGear({
    id: 'G1',
    teeth: 20,
    module: 2,
    transform: { position: [0, 0, 0] },
  });
  const G2 = mech.spurGear({ id: 'G2', teeth: 40, module: 2 });

  mech.mesh(G1, G2);
  mech.drive(G1, { rpm: 60 });
});

Three things are happening here:

1. Components: mech.spurGear({ ... }) records a gear and returns a handle you bind to a const. Every category (mech, elec, ...) is exposed as a namespace on the DSL context. 2. Connections: mech.mesh(G1, G2) links the two handles through a gear-mesh edge. The layout solver places G2 tangent to G1 automatically, so only one anchor usually needs an explicit transform. 3. Drivers: mech.drive(G1, { rpm: 60 }) injects 60 RPM on G1's axis port. A bench with no drivers simulates a static mechanism.

The canonical unit for lengths is millimeters; rotations are authored in degrees and converted to radians internally; driver speed is RPM on the surface, rad·s⁻¹ inside the engine.

Blueprint editor

Click the Blueprint button to switch to the visual node editor. Every component in the compiled document appears as a node; every connection is an edge. You can:

Components that use constructs the Blueprint view cannot represent (loops, defineComponent, computed helpers) appear as locked nodes — switch to the Code editor to change them.

Component palette

Open the palette from the left rail's Paleta button or with Shift+A; it appears as a flyout anchored to the rail (Esc or an outside click closes it). It lists every registered component kind grouped by category — Mecanismos (kinematic parts) and Estruturas (structural parts) — each with its icon, title and an expandable summary, plus a search box. The grouping is organizational only: a bench can freely mix categories. Clicking an entry inserts a ready-to-edit declaration for that kind (with default parameters) into the active source and selects the new component, exactly as adding one from the Blueprint palette does — the source stays the single source of truth.

Bill of materials

The Materiais tab is a read-only bill of materials for the current bench: identical physical parts collapse into one line with a quantity and a rolled-up weight, and a totals row sums the part count and total mass. Weights come from each kind's declared dimensions, so the numbers match the .mbl export and the MCP surface exactly.

3. Compile and simulate

Compilation runs automatically whenever the source changes (debounced). If it succeeds, the 3D viewer updates and keeps simulating. The play/pause button in the viewer toolbar pauses the tick loop without losing the compiled state.

Compiler output: - Errors block the simulation: missing kind, invalid parameters, duplicate id, connection loop, module mismatch on a gear mesh, static-assembly problems (part outside the envelope, interference, disconnected body), etc. The editor shows them inline; multiple errors from all passes surface at once so you don't fix them one by one. When an error names a specific part, clicking the error row selects it — and any part blamed by a validation error is outlined in orange in the 3D viewer. - Warnings do not block but highlight suspicious setups (e.g. unconnected port, unreachable component).

See DSL reference §Compilation passes for the six passes the compiler runs in order.

4. Tweak via the inspector

Select a component in the Outliner or in the Blueprint view. The inspector shows:

All inspector edits are undoable with Ctrl/Cmd+Z (see §Keyboard shortcuts below).

5. Save

When a bench is bound to a user (any non-sandbox bench), Ctrl+S or the Salvar button persists the current source to MongoDB. The engine API version is recorded with the bench so future engine updates can migrate it forward automatically.

6. Export

Images and video

The 3D viewer toolbar's Export dropdown groups every export:

ButtonWhat it produces
PNG ▾Hi-res screenshot at 1×, 2×, or 4× the canvas resolution.
WebM ▾Screen-recorded video. A modal lets you set duration, fps (30/60), and simulation speed before recording starts.
🎞Animated GIF. A modal lets you set fps (5/10/15) and duration (2–10 s). The export samples the live canvas — start the simulation before clicking.
STL / STL◉Binary STL of the full bench (or the selected component when one is highlighted). Coordinates are in millimeters.

Print-ready STL

Click STLp / STLp◉ for a print-optimised version. A Print options modal appears where you can set bore clearance, nozzle diameter, and end chamfer before downloading. Each component is downloaded as a separate file; kinds that do not yet have a dedicated printable geometry fall back to the visual mesh (a warning is shown). The printable geometry uses denser tessellation and adjusted tolerances suited for FDM printing.

7. Reuse via groups

Once a subassembly starts appearing twice, wrap it in group({ id, build }). The inner build runs against a fresh recorder; the outer bench gets a handle with exactly the ports you expose. See Groups for the namespacing model, inline local kinds, and the multi-file roadmap.

8. Share

Saved benches can be made public from the ⋯ menu on a bench card in the home hub (or the Compartilhar button in the workspace). A public bench exposes a read-only /embed/:id route that renders the compiled document in the viewer with no editing chrome. Source code is never exposed on the public endpoint.

Keyboard shortcuts

ActionShortcut
SaveCtrl/Cmd+S
UndoCtrl/Cmd+Z
RedoCtrl/Cmd+Shift+Z
Toggle drawer\` (backtick)
Open paletteShift+A
Clear selectionEsc
Play/pause(button only)
Reset camera(button only)
Delete selectedDelete (Blueprint)

Compilation happens automatically — there is no explicit recompile shortcut.

Next steps