diff --git a/game/src/render/intersection.rs b/game/src/render/intersection.rs index 45c8fbc050..25e75aa29b 100644 --- a/game/src/render/intersection.rs +++ b/game/src/render/intersection.rs @@ -194,6 +194,12 @@ pub fn calculate_corners(i: &Intersection, map: &Map, timer: &mut Timer) -> Vec< continue; } + // Special case for dead-ends: just thicken the geometry. + if i.roads.len() == 1 { + corners.push(turn.geom.make_polygons(LANE_THICKNESS)); + continue; + } + let l1 = map.get_l(turn.id.src); let l2 = map.get_l(turn.id.dst); diff --git a/map_model/src/make/turns.rs b/map_model/src/make/turns.rs index 4508025c6c..b563a13e21 100644 --- a/map_model/src/make/turns.rs +++ b/map_model/src/make/turns.rs @@ -307,7 +307,7 @@ fn make_walking_turns( if let Some(l1) = get_sidewalk(lanes, roads[idx1].incoming_lanes(i.id)) { // Make the crosswalk to the other side if let Some(l2) = get_sidewalk(lanes, roads[idx1].outgoing_lanes(i.id)) { - if roads.len() != 2 { + if roads.len() > 2 { result.extend(make_crosswalks(i.id, l1, l2)); } } @@ -366,6 +366,27 @@ fn make_walking_turns( result.extend(turns); } } + if roads.len() == 1 { + if let Some(l1) = get_sidewalk(lanes, roads[0].incoming_lanes(i.id)) { + if let Some(l2) = get_sidewalk(lanes, roads[0].outgoing_lanes(i.id)) { + let geom = make_shared_sidewalk_corner(i, l1, l2, timer); + result.push(Turn { + id: turn_id(i.id, l1.id, l2.id), + turn_type: TurnType::SharedSidewalkCorner, + other_crosswalk_ids: BTreeSet::new(), + geom: geom.clone(), + lookup_idx: 0, + }); + result.push(Turn { + id: turn_id(i.id, l2.id, l1.id), + turn_type: TurnType::SharedSidewalkCorner, + other_crosswalk_ids: BTreeSet::new(), + geom: geom.reversed(), + lookup_idx: 0, + }); + } + } + } result }