Expand description
What a machine looks like, as data. A machine never renders; a front end draws these parts. Coordinates in metres: x to the right, y into the depth, z up.
Structs§
- Aabb
- A box with its edges along the scene’s axes: an obstacle, or a part of the machine that can hit one
(
Machine::collision_bodies). Metres, in scene coordinates. - Arrow
- A force that acts at a place in the machine, drawn as an arrow: on what (
owner_key, a translation key) and how much, in newtons, along the scene’s axes. - Capsule
- A capsule: every point within
radiusof the segment fromfromtoto. A slanted rod, arm or shaft as a part that can hit an obstacle (Machine::collision_capsules), where a box along the scene’s axes around it would be up to its length wider than it. Metres, in scene coordinates. - Label
- A live value shown in the 3D view next to the part it belongs to, e.g. a motor’s speed. Both keys are translation keys; the front end formats “owner value unit”.
- Obstacle
- An obstacle of the config (
[[obstacles]]), and whether a part of the machine touches it now. With effects.crash it pushes back on a part that goes into it withstiffness(N/m) times the depth anddamping(N s/m) times the speed into it. - Part
- Scene
Enums§
Constants§
- BELT_
COLOR - The colour of a belt strip at pretension; its highlight shifts it.
- MOTOR_
PART - The id of a motor’s housing in the scene (
drive_unit): the k-th such part is motor k’s, and the simulation colours it by the warmth of that motor’s winding.
Functions§
- belt
- Draws a belt along a path in the x-z plane at depth
y: one strip per path segment, and teeth at a fixed spacing of belt length counted from the start of the path. - belt_
along beltwith the belt length of each path point given (along, rising) rather than taken from the drawn path: for a drawn path that is not the belt’s length, e.g. a span drawn sagging larger than it is. Each tooth keeps its place in belt length and sits on the drawn segment whose ends’ belt lengths hold it, at the same share between them.- drive_
unit - Draws a motor with gearbox and belt pulley at
centre(x, z), the pulley in the belt plane at depthyand the motor behind it. A cross on the pulley turns with the pulley, a bar on the hub turns with the motor shaft, so both speeds can be seen. - heat_
color - The colour of the heat scale at a temperature rise of
heattimes the rated one: cold blue, yellow at half, red at the rated rise, and magenta beyond it. - idler
- Draws a free-running pulley with a bar that shows its rotation.
- on_
circle - A point on a circle, for laying a belt path around a pulley.
turnis in radians from +x. - part_
color - The colour a 3D view draws a part in: where its warmth is computed (
Part::heat) the heat scale in its place; otherwise its own colour, shifted towards red by belt tension above pretension (highlightup to 1, at twice the pretension) and towards blue below it (-1 at no tension). - scene_
boxes - The boxes among
parts(as a machine draws them in its scene) whose id is one ofids, turned or not: whatMachine::collision_bodiestakes for the parts that move with the tool. A machine passes only the parts it needs: drawing the whole scene every base step made the live check about three times as slow as the run without it.