ARail EBL

Open source · runs in the browser

Augmented reality for model railway labs

Point a phone or a webcam at your layout. ARail puts platforms full of passengers, bus terminals, houses and trees on it, simulates delays and closures, and shows the trains your control system reports.

H0 · TT · N · any scaleArUco & AprilTag markersNo install, no calibration board

The lab table in ARail: two platforms with waiting passengers and trains, a bus station with a bus, houses, trees and a field. The same model railway table as a plain photo. PhotoARail

What goes on the layout

Everything is placed on the real layout in model millimetres and scaled to the prototype, so a person on an H0 platform is 20 mm tall.

Platforms with passengers

Lay a platform between two markers. Passengers arrive, wait at the edge, board and alight through the doors. Their colour shows their mood, from green to red.

Bus terminals

Bays along a bus lane, shelters and stop signs. Buses come on a timetable, or more often when a rail replacement service is running.

Houses and landscape

Buildings with floors and roofs, single trees and forests, fields, water and roads. Tap to place them, drag to move them.

Disruptions and scenarios

Delays, cancellations, closures, signal failures, crowd surges and replacement buses, started by hand or scripted as scenarios for teaching.

Your control system

A small Python bridge forwards train positions over WebSocket. When a real train stops at a platform, the virtual passengers board it.

Your own objects and simulations

Plugins add object types, simulations and disruption types in plain JavaScript modules. The editor builds their settings forms automatically.

How it works

Printed square markers lie flat on the layout. From the camera image alone, without a calibration board, ARail works out where the layout plane is and draws on it.

MarkersArUco or AprilTag codes, 30 mm, anywhere on the layout, any rotation.
Marker mapTheir positions are surveyed from the images and stored with the layout.
Camera poseAll visible markers give one stable view of the plane; the focal length is estimated too.
Virtual layoutPlatforms, bus terminals and scenery from a JSON layout file.
SimulationTrains, buses, passengers and disruptions, in prototype metres and seconds.

Set up your lab

The first four steps take an afternoon. The control system can follow later.

  1. 1

    Print markers

    Use the marker sheets and check the 100 mm bar with a ruler. The black square is the marker size.

  2. 2

    Lay them out

    One marker at each end of every platform, more across the layout. Wherever the camera looks, one or two should be in view.

  3. 3

    Open the app

    Take a photo, record a video or start the live camera. Unknown markers are measured automatically when they are seen next to known ones.

  4. 4

    Build and export

    Add platforms, a bus terminal and scenery in the Build panel, then export the layout file and keep it in your fork.

  5. 5

    Connect the control system

    Run arail-bridge next to it with an adapter for your system. The simulated control system shows the flow without one.

Extend it

No build step, no framework. A plugin is an ES module that registers what it adds; layouts load it by URL.

Guide to plugins · Layout file format · Control-system interface

// plugins/windmill.js: a new object type
export default function (arail) {
  class Windmill extends arail.LayoutObject {
    static type = "windmill";
    static label = "Windmill";
    static params = [{
      key: "height_m", label: "Height",
      type: "number", unit: "m", default: 18,
    }];
    computeGeometry() {
      const c = arail.resolvePoint(this.world.map, this.spec.position);
      return c && { center: c };
    }
    draw(view) {
      const [x, y] = this.geometry.center;
      const h = view.m(this.spec.height_m);   // metres → model mm
      view.prism(arail.rectFootprint([x, y], view.m(5), view.m(5)), 0, h,
                 { side: "#e8e1d0", top: "#8a5a3c" });
    }
  }
  arail.registry.registerObject(Windmill);
}

Departures · project status

as of September 2026
VersionDestinationStatus
0.1Tracking without a calibration boardMarker map survey, focal length estimate, tested on the lab photoArrived
0.1Platforms, bus terminals, scenery, editorLayout files, plugins, passenger simulationArrived
0.1Disruptions, scenarios, control-system bridgeSimulated, replayed and TCP JSON feedsArrived
nextLive sessions in the EBLPhones, webcams and a projector on the real layoutBoarding
nextAdapter for the EBL control systemReal train positions instead of the simulatorScheduled
laterOcclusion by real trains, more vehicle typesIdeas and contributions welcomeScheduled