18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-27 22:55:16 +01:00
Files
maszyna/editor
jerrrrycho 0c01d660f6 fix(editor): roads joined to a roundabout take only the room they need (#485)
* fix(editor): a road joined to a roundabout takes only the room it needs

A road led into the side of a roundabout gets a junction that cuts the
ring on both sides of it. The cut was measured as on a straight road:
where the edge of the road leaving meets the edge of the road it
leaves, plus the corner, and with the value of the acute corner used
on both sides. The ring bends away from a road leaving it to the
outside, so the edges meet sooner, and a road leaving at a slant meets
the ring much sooner on the side it leans away from. Each junction took
too much of the ring, and the next road was refused with "Too close to
a junction": with roads joined at a slant only two fitted on a
roundabout of 12-15 m.

On a roundabout the room on each side is now measured on the circle of
the ring's outer edge, never more than before. In the editor, five
roads at 45 degrees now join a roundabout of 15 m and four at 30 degrees
one of 12 m (two before); roads joined straight out gain less: two
instead of one on the smallest roundabout (8 m), four of six on one of
16 m instead of three. Saved roundabouts load as before; only junctions
made from now on are laid out differently.

Fixes #349

* fix(editor): junctions on a roundabout leave shorter pieces of the ring

A junction cut into a road leaves at least 2 m of the piece it cuts.
When less would be left, it takes the rest of the piece, so a junction
next to the end of one of the ring's arcs grew by up to 2 m, and the
next junction had to stay 2 m further away. On a roundabout of 8-10 m,
where each road joined straight out takes about 14 m of the ring, that
was the difference between two roads and three or four.

The ring goes on round past such a piece, so on a roundabout the
shortest piece is now 0.5 m (editor_ring::shortest_piece). Roads of
their own keep the 2 m. In the editor, three roads joined straight out
now fit on the smallest roundabout (8 m) and four on one of 9.6 m or
more, wherever they join the ring; six fit on 15 and 16 m. Four roads
on the 8 m one would take smaller corners, and are still refused.
Saved roundabouts load as before.

* fix(editor): the reaches of a junction on a roundabout in a std::array
2026-11-25 05:23:37 +01:00
..