Files
isokit/examples/streets/scene.json
T
grabowski c8becc2e59
Deploy web Studio / deploy (push) Successful in 1m4s
Point handles for routes and outlines; Area corners; bus goes round right
Studio: one selected object with pts (a route, an outlined area) shows a
handle on each point and a + in the middle of each side: drag a point to
move it, drag a + to add one there, double-click a point to remove it
(open routes keep 2, outlines 3). Points snap to the grid and onto wall,
fence and road ends, at any angle; one undo step each. Handles keep their
screen size (new viewer callback onView on every redraw) and follow
re-renders and selection. The viewer captures the pointer, so a double-
click targets the drawing: the last point pressed is remembered instead.

Prefab meta `outline`: the prefab draws pts as its outline. Area has it:
Edit corners turns its rectangle into four points, Rectangle again
removes them.

Routes: where a path doubles back, the lane offset puts a point on each
side, so it rounds into a U-turn instead of a diagonal across the lanes.
The streets demo bus now runs east, three quarters round the roundabout
(clockwise, left-hand traffic), down south street, turns and comes back
by the short way, instead of going round the wrong way on its way out.

Tests: Rust 81 (a doubling-back route: each mover once, no sort cycles),
Studio 134 (corners, move, add, remove, undo), web 100.
2026-10-25 18:46:47 +07:00

42 lines
4.6 KiB
JSON

{
"version": 1,
"objects": [
{"id": "site", "type": "site", "name": "Quarter", "x": 0, "y": 4, "locked": true, "props": {"w": 112, "d": 92, "mat": "g-grass"}},
{"id": "rb", "type": "roundabout", "name": "Roundabout", "x": 0, "y": 0, "props": {"r": 12, "lane": 7, "arm_len": 8, "road_d": 6.5, "walk_w": 2.5}},
{"id": "east-ave", "type": "road", "name": "East avenue", "x": 36, "y": 0, "props": {"walk": "both", "walk_w": 2.5, "d": 6.5, "w": 32}},
{"id": "west-st", "type": "road", "name": "West street", "x": -36, "y": 0, "props": {"walk": "both", "walk_w": 2.5, "d": 6.5, "w": 32}},
{"id": "south-st", "type": "road", "name": "South street", "x": 0, "y": -31, "rot": 90, "props": {"walk": "both", "walk_w": 2.5, "d": 6.5, "w": 22}},
{"id": "north-st", "type": "road", "name": "North street", "x": 0, "y": 27, "rot": 90, "props": {"walk": "both", "walk_w": 2.5, "d": 6.5, "w": 14}},
{"id": "bend", "type": "road_curve", "name": "Corner", "x": 0, "y": 34, "rot": 90, "props": {"walk": "both", "walk_w": 2.5, "d": 6.5, "r": 12, "turn": "right"}},
{"id": "park-rd", "type": "road", "name": "Park road", "x": 34, "y": 46, "props": {"walk": "both", "walk_w": 2.5, "d": 6.5, "w": 44}},
{"id": "cross-st", "type": "road", "name": "Cross street", "x": 34, "y": 23, "rot": 90, "props": {"w": 46, "d": 5.5, "walk": "both", "walk_w": 2}},
{"id": "lane", "type": "road", "name": "Garden lane", "x": 34.0, "y": -10.0, "rot": 315.0, "props": {"w": 28.284, "d": 5.5, "walk": "both", "walk_w": 2}},
{"id": "hedge-lane", "type": "hedge", "name": "Lane hedge", "x": 28.95, "y": -14.849, "rot": 315.0, "props": {"w": 12.0, "d": 0.8, "h": 1.2}},
{"id": "offices", "type": "building", "name": "Offices", "x": 19, "y": 27, "props": {"w": 14, "d": 13, "floors": 3, "pv": true}},
{"id": "flats", "type": "building", "name": "Flats", "x": 46, "y": 23, "props": {"w": 10, "d": 28, "floors": 4, "roof": "gable", "mat": "brick"}},
{"id": "school", "type": "building", "name": "School", "x": -33, "y": -21, "props": {"w": 20, "d": 14, "floors": 2, "ac": true}},
{"id": "shop", "type": "building", "name": "Corner shop", "x": -14, "y": 30, "props": {"w": 10, "d": 9, "floors": 1}},
{"id": "parking", "type": "parking", "name": "Car park", "x": -36, "y": 22, "props": {"n": 8}},
{"id": "pond", "type": "pond", "name": "Park pond", "x": 32, "y": -24},
{"id": "tree-1", "type": "tree", "x": 16, "y": -16, "props": {"r": 2.2}},
{"id": "tree-2", "type": "tree", "x": 20, "y": -33, "props": {"r": 2.0}},
{"id": "tree-3", "type": "tree", "x": 46, "y": -14},
{"id": "tree-4", "type": "tree", "x": 48, "y": -34, "props": {"r": 2.4}},
{"id": "trees-west", "type": "tree_row", "name": "Avenue trees", "x": -36, "y": 9, "props": {"w": 28}},
{"id": "walker-1", "type": "person", "x": 24, "y": 4.6, "props": {"cls": "guest1"}},
{"id": "walker-2", "type": "person", "x": -26, "y": -4.7},
{"id": "walker-3", "type": "person", "x": 30, "y": 30, "props": {"cls": "guest3"}},
{"id": "crowd", "type": "crowd", "name": "Pupils", "x": -24, "y": -11, "props": {"n": 6, "r": 1.6}},
{"id": "lamp-1", "type": "lamp", "x": 18, "y": -5.2},
{"id": "lamp-2", "type": "lamp", "x": 44, "y": -5.2},
{"id": "lamp-3", "type": "lamp", "x": -28, "y": 5.2},
{"id": "lamp-4", "type": "lamp", "x": -44, "y": 5.2},
{"id": "lamp-5", "type": "lamp", "x": 5.2, "y": -28},
{"id": "traffic", "type": "route", "name": "Traffic round the block", "x": 17.0, "y": 23.0, "pts": [[3.0, -23.0], [17.0, -23.0], [17.0, 23.0], [-5.0, 23.0], [-11.0, 21.392], [-15.392, 17.0], [-17.0, 11.0], [-17.0, -3.0], [-12.408, -11.913], [-5.913, -18.408]], "props": {"kind": "car", "n": 4, "closed": true, "path": false}},
{"id": "bus-line", "type": "route", "name": "Bus line", "x": -19.456, "y": -14.457, "pts": [[-30.544, 14.457], [-0.544, 14.457], [8.369, 19.049], [14.864, 25.544], [24.048, 25.544], [30.543, 19.049], [30.543, 9.865], [24.048, 3.37], [19.456, -5.543], [19.456, -25.543], [19.456, -5.543], [14.864, 3.37], [8.369, 9.865], [-0.544, 14.457]], "props": {"kind": "bus", "n": 1, "path": false, "colour": "car4", "closed": true}},
{"id": "motos", "type": "route", "name": "Motorbikes", "x": 35.75, "y": -11.75, "pts": [[-8.25, 8.25], [8.25, -8.25]], "props": {"kind": "motorbike", "n": 3, "path": false}},
{"id": "cyclists", "type": "route", "name": "Cyclists", "x": 46.5, "y": 46.0, "pts": [[-9.5, 0.0], [9.5, 0.0]], "props": {"kind": "cyclist", "n": 2, "path": false}},
{"id": "strollers", "type": "route", "name": "People strolling", "x": 38.0, "y": 23.0, "pts": [[0.0, -17.0], [0.0, 17.0]], "props": {"kind": "person", "n": 3, "path": false}}
]
}