Starting or ending a line on an arc's chord flattens the arc #96

Open
opened 2026-10-13 02:28:37 +00:00 by ImBenji · 0 comments
Owner

From the engineering review on 2026-10-13.

maybeSplitAt in lib/pages/map/canvas/interaction/line_ops.dart:310 skips biarcs but not arcs, and tests the point against the straight chord with distToSegment(position, line.start, line.end). It then calls splitLineAt, which replaces the arc with two straight segments.

Scenario: a quarter arc from (0,0) to (20,20) has the grid point (10,10) on its chord, 5.86 units from the curve. Starting or ending a line there turns the arc into two straights.

Evidence: test/review_probes/engine_model_ops_probe.dart (local, untracked): after maybeSplitAt: [StraightSegment (0,0)->(10,10), StraightSegment (10,10)->(20,20)].

Same gap in the agent tool: split_segment in lib/agent/tools/segment_tools.dart:38 passes any segment type and any point straight through.

Fix sketch: use distance to the arc for arcs and split them into two arcs, or refuse. Validate the type and point in the tool. Related: #4.

From the engineering review on 2026-10-13. `maybeSplitAt` in `lib/pages/map/canvas/interaction/line_ops.dart:310` skips biarcs but not arcs, and tests the point against the straight chord with `distToSegment(position, line.start, line.end)`. It then calls `splitLineAt`, which replaces the arc with two straight segments. **Scenario:** a quarter arc from (0,0) to (20,20) has the grid point (10,10) on its chord, 5.86 units from the curve. Starting or ending a line there turns the arc into two straights. **Evidence:** `test/review_probes/engine_model_ops_probe.dart` (local, untracked): `after maybeSplitAt: [StraightSegment (0,0)->(10,10), StraightSegment (10,10)->(20,20)]`. Same gap in the agent tool: `split_segment` in `lib/agent/tools/segment_tools.dart:38` passes any segment type and any point straight through. **Fix sketch:** use distance to the arc for arcs and split them into two arcs, or refuse. Validate the type and point in the tool. Related: #4.
ImBenji added the bug label 2026-10-13 02:28:37 +00:00
ImBenji added this to the Arcs & Angles project 2026-10-13 02:28:37 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: IMBENJI.NET/Metro-Map-Maker#96