Skip to content

Commit

Permalink
Fix some of the worst zig-zaggy bugs with drawing intersection curbs.
Browse files Browse the repository at this point in the history
Net improvement, but still not perfect. #74
  • Loading branch information
dabreegster committed Oct 30, 2021
1 parent 1eb7ec7 commit a476328
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 22 deletions.
36 changes: 18 additions & 18 deletions data/MANIFEST.json
Original file line number Diff line number Diff line change
Expand Up @@ -796,9 +796,9 @@
"compressed_size_bytes": 2566467
},
"data/input/gb/great_kneighton/screenshots/center.zip": {
"checksum": "b74f1a5be0404bbe115b310e4dd6e762",
"uncompressed_size_bytes": 53309674,
"compressed_size_bytes": 53296832
"checksum": "5d30640754528a5ed996af74c262f8d2",
"uncompressed_size_bytes": 53252447,
"compressed_size_bytes": 53239548
},
"data/input/gb/halsnead/osm/center.osm": {
"checksum": "9b4aedf25220e29e11d0970cf7c70a26",
Expand Down Expand Up @@ -1566,9 +1566,9 @@
"compressed_size_bytes": 3224297
},
"data/input/pl/krakow/screenshots/center.zip": {
"checksum": "fe4771ae6caad54ebbc1f080cb0a70fb",
"uncompressed_size_bytes": 36805171,
"compressed_size_bytes": 36801593
"checksum": "c3a67958f4bf025ced57858d53731a94",
"uncompressed_size_bytes": 36787987,
"compressed_size_bytes": 36784418
},
"data/input/pl/warsaw/osm/center.osm": {
"checksum": "b41830dd375674ffc9f7ec15d6cf9c0c",
Expand Down Expand Up @@ -2111,9 +2111,9 @@
"compressed_size_bytes": 389560
},
"data/input/us/phoenix/screenshots/tempe.zip": {
"checksum": "4f07ae0e71df767d17950e09cce404e5",
"uncompressed_size_bytes": 10067156,
"compressed_size_bytes": 10065406
"checksum": "afddc565e2a4144afd615f7546a39765",
"uncompressed_size_bytes": 10044161,
"compressed_size_bytes": 10042265
},
"data/input/us/providence/osm/downtown.osm": {
"checksum": "463b986adc83ae4d1174496a4ce744d1",
Expand Down Expand Up @@ -2416,19 +2416,19 @@
"compressed_size_bytes": 4943183
},
"data/input/us/seattle/screenshots/downtown.zip": {
"checksum": "1ce83e6d683097380fb0b3b743eb985a",
"uncompressed_size_bytes": 28109872,
"compressed_size_bytes": 28102104
"checksum": "9a856c29a48ab006d4a10ccac19f3e6c",
"uncompressed_size_bytes": 28072581,
"compressed_size_bytes": 28065003
},
"data/input/us/seattle/screenshots/lakeslice.zip": {
"checksum": "bd14fc7c65b670960b6537bd64593302",
"uncompressed_size_bytes": 27065486,
"compressed_size_bytes": 27059765
"checksum": "0d18354d2f5d5b18f15afb9c2627ef4a",
"uncompressed_size_bytes": 27012818,
"compressed_size_bytes": 27007148
},
"data/input/us/seattle/screenshots/montlake.zip": {
"checksum": "33e6dbb7b64d7e7feedac44e5ab94e6b",
"uncompressed_size_bytes": 5421711,
"compressed_size_bytes": 5421637
"checksum": "de9300b3e37e3d1bf3f8c23d3533ae86",
"uncompressed_size_bytes": 5410497,
"compressed_size_bytes": 5410435
},
"data/input/us/seattle/trips_2014.csv": {
"checksum": "d4a8e733045b28c0385fb81359d6df03",
Expand Down
17 changes: 13 additions & 4 deletions map_gui/src/render/intersection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,21 @@ fn calculate_corner_curbs(i: &Intersection, map: &Map) -> Vec<Polygon> {

if let Some(pl) = (|| {
let mut pts = turn.geom.shift_either_direction(width).ok()?.into_points();
// TODO Connecting the SharedSidewalkCorner geometry to the curb usually
// requires adding a few points from the sidewalk on each end. But sometimes
// this causes "zig-zaggy" artifacts. The approx_eq check helps some (but not
// all) of those cases, but sometimes introduces visual "gaps". This still
// needs more work.
let first_line = l2.first_line().shift_either_direction(width);
pts.push(first_line.pt1());
pts.push(first_line.unbounded_dist_along(thickness));
if !pts.last().unwrap().approx_eq(first_line.pt1(), thickness) {
pts.push(first_line.pt1());
pts.push(first_line.unbounded_dist_along(thickness));
}
let last_line = l1.last_line().shift_either_direction(width).reversed();
pts.insert(0, last_line.pt1());
pts.insert(0, last_line.unbounded_dist_along(thickness));
if !pts[0].approx_eq(last_line.pt1(), thickness) {
pts.insert(0, last_line.pt1());
pts.insert(0, last_line.unbounded_dist_along(thickness));
}
PolyLine::deduping_new(pts).ok()
})() {
curbs.push(pl.make_polygons(thickness));
Expand Down

0 comments on commit a476328

Please sign in to comment.