Skip to content

AI paths: snapped height, Shift lock and typed numbers; turn round and reverse - #28

Merged
yumin278 merged 3 commits into
integrationfrom
feature/ai-path-snap-and-flip
Nov 16, 2026
Merged

yumin278 merged 3 commits into
integrationfrom
feature/ai-path-snap-and-flip

Conversation

@yumin278

Copy link
Copy Markdown
Owner

AI paths: snapped height, Shift lock and typed numbers; turn round and reverse

Three independent changes, one commit each.

1. AI path height from the snapped lane (79fb877)

When a new AI path starts or ends on a lane (a lane end or a point along a lane), the snapped
point is the lane's line. The new path's own line lies [path] z above or below that line
(invis_street.sli: +0.1, invis_sidewalk.sli: −2), so the anchor height is now corrected by
that offset before the path is planned and built. Only z is corrected; a non-zero path x is
logged with log::warn! and left alone. Free starts on the ground are unchanged.
log::info! records the type, kind, path z and the height before and after on every snap.
Junction-object (.sco) paths are corrected the same way.

2. Shift straight lock and typed numbers while drawing AI paths (19b3c7f)

The typed-number/straight-lock branch of plan_road and the corner number panel are no longer
skipped in AI path mode. In that branch an AI path keeps z1 = z0 + typed_rise() and does not
follow the terrain; the Roads tool behaves as before.

3. Turn round and reverse (a0eb5a3)

Editor::flip_selected() turns the one selected road 180° about its start and reverses it in a
single history step, so one undo puts it back. It refuses a multi-selection and roads with rows
of objects along them, and never applies angle snapping. Available next to "Reverse direction"
in both inspectors and as the unbound command flip_path.

Tests

  • a_path_started_on_a_street_lane_keeps_the_lane_height
  • a_path_started_on_a_footway_lane_keeps_the_lane_height
  • a_path_started_on_the_ground_keeps_the_ground_height
  • a_path_started_in_the_middle_of_a_lane_keeps_the_lane_height
  • a_path_started_on_a_crossing_objects_lane_keeps_the_lane_height
  • a_straight_lock_draws_an_ai_path_straight_from_a_lane_end
  • a_typed_length_and_radius_draw_an_ai_path_straight
  • a_typed_rise_lifts_an_ai_path
  • a_typed_road_still_follows_the_ground
  • one_road_turns_round_about_its_start
  • angle_snapping_does_not_stop_the_half_turn
  • one_undo_puts_the_road_back
  • two_roads_are_left_alone

All 26 locale tables carry the new interface texts (python3 tools/i18n/check.py: 2908 texts,
26 languages: complete).

@yumin278
yumin278 marked this pull request as ready for review November 16, 2026 11:44
@yumin278
yumin278 merged commit 13b0c1d into integration Nov 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants