Robot arms pass goods from belt to belt; native beam primitive
Deploy web Studio / deploy (push) Successful in 1m3s

- Robot arm (category Industry): picks goods off the end of the nearest conveyor within its reach
  and puts them on the start of another conveyor within reach, or on a pallet a quarter turn on
  (pick / put: auto or a side). One move per item coming in (cycle 0) or a set cycle; waits while
  the line before it stands. The belt it feeds carries its goods at its pace and starts its loop
  when they land (feeds carry a time offset `ph`), so arm and belts stay in step.
- Drawn as a 16-pose flipbook: two-link inverse kinematics per pose, each pose shown for a
  sixteenth of the cycle by a stepped CSS animation (iso-flip; pose 0 alone when unanimated).
  Poses pointing away from the viewer are drawn before the base, the others after it.
- New sprite method beam(a, b, n, w, mat): a square bar between two 3D points, six faces culled
  and shaded like face(). Native, so the factory demo renders in 4.7 ms instead of 18.8 ms.
- Factory demo: a palletiser at the end of the carton line, a loading robot passing drums from the
  incline onto the loading belt into the truck. MCP instructions on robot arms.

Checks: 70 Rust tests (arms and belts in step, waiting arm, beam faces from every side),
Studio 109/109, web 90/90.
This commit is contained in:
grabowski committed 2026-10-24 22:05:46 +07:00
1 parent 18dd324543
commit f49798583e
14 files changed
+460 -31

No files matched your search

+6 -1
View File
@@ -74,7 +74,7 @@ Each phase ends with tests, a Studio/viewer check in Edge, commit and push.
1. ~~Web performance~~ (done, see below)
2. ~~Conveyors~~ (done, see below)
3. ~~Producers with adjustable production speed~~ (done, see below)
4. Robotic arms
4. ~~Robotic arms~~ (done, see below)
5. Rounded streets: curved road segments
6. Sidewalks along streets
7. Roundabouts
@@ -103,6 +103,11 @@ height, rise, speed; corners join without overlap). A conveyor starting at a pro
at another conveyor's end, carries those goods, spaced by speed / rate; tooltips show the numbers.
`examples/factory`, Factory demo in the web Studio.
Robot arm: picks goods off the end of the nearest belt in its reach and puts them on the start of
another belt or on a pallet, one move per item (or a set cycle), waiting while the line before it
stands; the belt after it runs in step. Drawn as a 16-pose flipbook (inverse kinematics, links as
the new native `beam` primitive) shown by a stepped CSS animation.
## Phase 2: richer editing
- [x] Interior prefabs (see Build your own house); a building `rooms` prop is still open
+14 -2
View File
@@ -83,6 +83,7 @@ shaded automatically by face direction.
| `cyl(cx, cy, r, z0, z1, mat[, opts])`, `frust(cx, cy, r0, r1, z0, z1, mat[, sides[, opts]])` | round things |
| `slope(x0, x1, y0, y1, za, zb, th, mat)` | ramp / stair flight |
| `face(pts3, mat[, #{id, two_sided}])` | any planar polygon, shaded and culled by its normal (roof slopes, gables) |
| `beam(a, b, n, w, mat)` | square bar `w` wide between 3D points a and b, `n` a direction across it (robot arms, trusses) |
| `poly(polys3, cls[, id])` | 3D polygons as one path (solar modules) |
| `flat(poly or polys, z, cls[, id])` | flat polygon(s); later ones cut holes |
| `open(a, b, [[u0, u1, z0, z1], …], cls[, id])` | windows / doors on the face a→b (outward normal on the right) |
@@ -122,8 +123,8 @@ cobble, brick) and the site `wall` use it; `house_wall` has its own version
## Production lines
`producer` and `conveyor` (stdlib/industry.rhai) work together through the
document, like house parts:
`producer`, `conveyor` and `robot_arm` (stdlib/industry.rhai) work together
through the document, like house parts:
- A producer makes one of its `product` goods every 60 / `rate` seconds (its
ram goes down once per item) and puts them out on its local +x side.
@@ -140,6 +141,17 @@ document, like house parts:
- The goods ride a group that moves one gap per loop (`iso-ride`), so their
drawing order never changes; the first fades in, the last fades out.
Tooltips show speed, rate and where the goods come from (`info_row`).
- A robot arm picks goods off the end of the nearest conveyor within `reach`
(+0.4 m) and puts them on the start of another conveyor within reach, or on
a pallet a quarter turn on (`pick` / `put`: auto or a side of the arm). It
makes one move per item coming in (`cycle` 0) or every `cycle` seconds, and
waits while the line before it stands. The belt it puts on carries its goods
and starts its loop when they land, so arm and belts stay in step.
- The arm is a flipbook: 16 poses (two-link inverse kinematics, links drawn
with `beam`), each shown for a sixteenth of the cycle by a stepped CSS
animation (`iso-flip`); a rotation cannot turn a 3D arm in this projection.
Poses pointing away from the viewer are drawn before the base, the others
after it.
## House parts