Rework design of corners #4

Closed
opened 2022-03-28 23:50:20 +00:00 by zyxw59 · 4 comments
zyxw59 commented 2022-03-28 23:50:20 +00:00 (Migrated from github.com)

Here are some of the cases that need to be considered:

  1. single route turning: constant area of arc kite (r ~ sqrt(tan(θ/2)))
  2. two (or more) parallel routes turning along the same path: innermost radius as (1), others have same center point
  3. single route turning across a non-turning route: ignore the non-turning route
  4. two or more parallel routes turning along the same path, but shifting relative to each other: both routes treated as innermost
  5. two or more parallel routes turning with a non-turning route between them on both ends of the turn
  6. two or more parallel routes turning with a non-turning route between them on one end of the turn (the turning routes are closer on the other end of the turn)
  7. two routes turning in opposite directions, away from each other: arcs start at same perpendicular of their shared line
  8. two routes turning in opposite directions, across each other
  9. two routes turning in the same direction by different angles

  • resolve all the cases
  • implement it
Here are some of the cases that need to be considered: 1. ~~single route turning~~: constant area of arc kite (`r ~ sqrt(tan(θ/2))`) 2. ~~two (or more) parallel routes turning along the same path~~: innermost radius as (1), others have same center point 3. ~~single route turning across a non-turning route~~: ignore the non-turning route 4. ~~two or more parallel routes turning along the same path, but shifting relative to each other~~: both routes treated as innermost 5. two or more parallel routes turning with a non-turning route between them on both ends of the turn 6. two or more parallel routes turning with a non-turning route between them on one end of the turn (the turning routes are closer on the other end of the turn) 7. ~~two routes turning in opposite directions, away from each other~~: arcs start at same perpendicular of their shared line 8. two routes turning in opposite directions, across each other 9. two routes turning in the same direction by different angles --- - [ ] resolve all the cases - [ ] implement it
zyxw59 commented 2022-03-29 00:03:16 +00:00 (Migrated from github.com)

cases (3) and (4) are annoying:
shifting-parallel

Top row is case (2) as a control; middle row is case (3); bottom row is case (4). First column calculates the radius for the red route as if it were the outer of two concentric routes; second column calculates it as if it were the inner of two concentric routes. (In case (4), the blue route has the same radius as the red route)

People seem to prefer the first column for case (3) but the second column for case (4). I'm not sure how to reconcile these programmatically.

cases (3) and (4) are annoying: ![shifting-parallel](https://user-images.githubusercontent.com/3157093/160506363-27b06162-1580-4500-be41-20d1132e1e3a.png) Top row is case (2) as a control; middle row is case (3); bottom row is case (4). First column calculates the radius for the red route as if it were the outer of two concentric routes; second column calculates it as if it were the inner of two concentric routes. (In case (4), the blue route has the same radius as the red route) People seem to prefer the first column for case (3) but the second column for case (4). I'm not sure how to reconcile these programmatically.
zyxw59 commented 2022-04-24 22:41:46 +00:00 (Migrated from github.com)

I think the answer is that the second column is good enough for the first case.

I think the answer is that the second column is good enough for the first case.
zyxw59 commented 2022-04-25 01:34:58 +00:00 (Migrated from github.com)

I was going to write out an outline of an idea for the algorithm, but ran into trouble with step 3.

  1. for each route thru the corner, calculate its "preferred" radius:
    1. calculate its distance from the inside edge of its segment on each end; take the minimum of the two values as Δr
    2. calculate its minimum radius r = R * sqrt(tan(θ/2)) where R is the global inner radius value, and θ is the angle the arc sweeps.
    3. preferred radius = r + Δr
  2. along each segment, find the points where each arc starts. Select the one furthest (along the line) from the corner.
  3. The trouble is, case (7) wants to say, adjust all arcs such that they start no closer to the corner than the points found in step 2. But in case (4), this has the effect of increasing the radius of the crossing arcs, which we don't want
I was going to write out an outline of an idea for the algorithm, but ran into trouble with step 3. 1. for each route thru the corner, calculate its "preferred" radius: 1. calculate its distance from the inside edge of its segment on each end; take the minimum of the two values as `Δr` 2. calculate its minimum radius `r` = `R * sqrt(tan(θ/2))` where `R` is the global inner radius value, and `θ` is the angle the arc sweeps. 3. preferred radius = `r + Δr` 2. along each segment, find the points where each arc starts. Select the one furthest (along the line) from the corner. 3. The trouble is, case (7) wants to say, adjust all arcs such that they start no closer to the corner than the points found in step 2. But in case (4), this has the effect of increasing the radius of the crossing arcs, which we don't want
zyxw59 commented 2022-05-16 11:33:44 +00:00 (Migrated from github.com)

new idea:

  1. for each segment, calculate the perpendicular where its arcs should start:
    1. find the left-turning route which is furthest to the left, and the right-turning route which is furthest to the right
    2. calculate their radii r = R * sqrt(tan(θ/2)) and arc starting point
    3. select the perpendicular thru the arc starting point further from the corner
  2. for each route, select a radius such that the arc points on both ends are no closer than that segment's perpendicular, and also such that the radius isn't smaller than the minimum radius
new idea: 1. for each segment, calculate the perpendicular where its arcs should start: 1. find the left-turning route which is furthest to the left, and the right-turning route which is furthest to the right 2. calculate their radii `r = R * sqrt(tan(θ/2))` and arc starting point 3. select the perpendicular thru the arc starting point further from the corner 2. for each route, select a radius such that the arc points on both ends are no closer than that segment's perpendicular, and also such that the radius isn't smaller than the minimum radius
Sign in to join this conversation.
No description provided.