Expand description
The simulation in its own thread, on its own clock. The interface sends requests and reads samples from a channel; it never blocks the physics, and the physics never waits for a frame.
Structs§
- Outbox
- What the simulation has produced and the interface has not read yet. It is bounded, so that a window
that stalls costs samples and not memory: of the samples the newest
BACKLOGare kept, of the scenes the newest, of the travelled path the newestTRAILpoints. Answers to requests are few and are all kept. - Runner
- The simulation and the handling of requests, without any thread or clock. The session thread drives it; tests drive it directly, which makes them exact.
- Session
- Trail
Point - A point of the travelled path with what the 3D view may colour it by: the nearest point of the path the plan drew, in the scene, and how fast the tool went; and the simulated time it was passed, for cutting the path at the timeline’s time.
- View
News - What only the window reads, apart from
Events (which the model drains): the travelled path’s points with their speed and plan, and whether the machine tells a mode to show.
Enums§
Constants§
- BACKLOG
- Samples the interface may be behind by: ten seconds at real time. Beyond that the oldest are dropped.
- MODE_
SHOWN_ HZ - Swings per second of the mode in the 3D view: slowed down to about one, so that the eye can follow it.
- MODE_
TRAVEL - How far the mode’s amplitude swings, in m, per time the view draws the deflections larger, and at most: the
shape moves by it whichever of carriage and tool moves most (
Machine::mode_shape). A few millimetres read on a machine of metres, and up to a tenth of a metre the parts still hang together. - MODE_
TRAVEL_ MOST - TRAIL
- Points of the travelled path that are kept: 10 m of travel. Beyond that the oldest are dropped.
Functions§
- extend_
trail - Adds points to a travelled path and keeps the newest
TRAILof it. - mode_
scene - The machine at rest at its planned pose plus its mode (
Machine::mode_shape) swinging atMODE_SHOWN_HZ,secondsafter it started, with the mode’s true frequency as a label by the tool.exaggerationscales the whole shape through its amplitude, and the scene draws it at true scale (Scene::exaggeration1): the scene draws the carriage’s part of the shape at true scale and only the lean larger, which would distort the shape.Nonewhere the machine tells no mode. Withpicked(a mode of the mode list) that mode at its own pose, its shape complex: the state swings as rest + a (re sin + im cos), every part with its own phase. - travel_
lines - Each axis’s travel as a line in the scene: where the tool goes (
Machine::scene_point) as that axis alone runs from itsminto itsmaxwith the others atpose. Axes that do not move the tool in the scene (no mapping, or less than a millimetre) and limits that are not numbers have none; the lines come with the index of their axis.