a-b-street/abstreet · error
at has weird geom along
Error message
{} at {} has weird geom along {:?}: {} What it means
get_draw_car slices each past step's lane polyline to rebuild the car's rendered geometry and appends the pieces. If PolyLine::append fails (degenerate or disconnected geometry), rendering cannot continue and it panics with the vehicle id, time, step list, and the underlying polyline error.
Solutions
- Inspect the printed vehicle id and last_steps; check the referenced lanes for degenerate geometry on the current map
- Regenerate or fix the map geometry (avoid zero-length lanes) before replaying
- Report as a rendering robustness bug; as a workaround, restart the sim on the unedited map
Example fix
// graceful alternative in caller code
match car.get_draw_car(map, now) {
Ok(draw) => g.draw(...),
Err(_) => {} // skip rendering this car instead of crashing the frame
} Defensive patterns
Strategy: try-catch
Validate before calling
// ensure the map has no degenerate lanes before replay
for l in map.all_lanes() {
assert!(l.length() > Distance::ZERO && l.center_pts.num_points() >= 2);
} Try / catch
match std::panic::catch_unwind(|| car.get_draw_car(map, now)) {
Ok(draw) => g.draw(...),
Err(_) => {} // skip this car's draw
} Prevention
- Keep map geometry valid (no zero-length lanes) before running/replaying sims
- If it fires, capture the printed vehicle id and last_steps and file a bug with the map
When it happens
Trigger: get_draw_car() during rendering when a sliced lane piece cannot be appended — usually zero-length or single-point polyline pieces produced after extreme map edits or degenerate lane geometry.
Common situations: Viewing a replay/simulation after edits that created degenerate lanes; cars whose last_steps span lanes with broken geometry; long replays crossing modified intersections.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- trying to make a crossing_state from to at . Something's…
- Weird body for at
- This build of A/B Street stores player data in…
- Can't find the data/ directory
- CityName::new( , ) has a country code that isn't two letters
AI-assisted analysis of a-b-street/abstreet@0964f29315 (2026-09-13).
Data as JSON: /api/errors/12367bd0d45fee8f.
Report an issue: GitHub.
Appendix: source
Thrown at sim/src/mechanics/car.rs:120
let mut i = 0;
while leftover > Distance::ZERO {
if i == self.last_steps.len() {
// The vehicle is gradually appearing from somewhere. That's fine, just return
// a truncated body.
break;
}
partly_on.push(self.last_steps[i]);
let len = self.last_steps[i].get_polyline(map).length();
let start = (len - leftover).max(Distance::ZERO);
let piece = self.last_steps[i]
.get_polyline(map)
.slice(start, len)
.map(|(pl, _)| pl.into_points())
.ok()
.unwrap_or_else(Vec::new);
result = match PolyLine::append(piece, result) {
Ok(pl) => pl,
Err(err) => panic!(
"{} at {} has weird geom along {:?}: {}",
self.vehicle.id, now, self.last_steps, err
),
};
leftover -= len;
i += 1;
}
if result.len() < 2 {
// Vehicles spawning at a border start with their front at literally 0 distance.
// Usually by the time we first try to render, they've advanced at least a little.
// But sometimes there's a race when we try to immediately draw them.
if let Ok((pl, _)) = self
.router
.head()
.get_polyline(map)
.slice(Distance::ZERO, 2.0 * EPSILON_DIST)
{View on GitHub (pinned to 0964f29315)