fix location of stop signs / signals, based on bad center

This commit is contained in:
Dustin Carlino 2018-10-31 12:26:29 -07:00
parent 841944f84c
commit 01b230b47f
2 changed files with 8 additions and 2 deletions

View File

@ -20,8 +20,13 @@ pub struct DrawIntersection {
impl DrawIntersection {
pub fn new(inter: &Intersection, map: &Map) -> DrawIntersection {
// Don't skew the center towards the repeated point
let mut pts = inter.polygon.clone();
pts.pop();
let center = Pt2D::center(&pts);
DrawIntersection {
center: Pt2D::center(&inter.polygon),
center,
id: inter.id,
polygon: Polygon::new(&inter.polygon),
crosswalks: calculate_crosswalks(inter, map),

View File

@ -54,7 +54,8 @@ pub fn intersection_polygon(
let angle_diff = (pl1.last_line().angle().opposite().normalized_degrees()
- pl2.last_line().angle().normalized_degrees()).abs();
if angle_diff > 5.0 {
// TODO A tuning challenge. :)
if angle_diff > 15.0 {
// The easy case!
if let Some(hit) = pl1.intersection(&pl2) {
endpoints.push(hit);