-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crossify adjustments #3 #7
base: develop
Are you sure you want to change the base?
Conversation
Needs default parameters, I suggest 2 for the distance and .5 for the angle |
Hey! Thanks for the pull request/idea. A couple things, though:
The reason the angles generated are sometimes not orthogonal to the street is part of the candidate generation step. The algorithm goes like this: A. Increment the B. Find the closest point on the sidewalk to the left, and closest on the right. C. Draw a line between them. D. Go to A until a set maximum distance down the street has been met. The reason this strategy is used is that it's compatible with many different shapes / situations of sidewalks, and won't accidentally miss any so long as they're within a set distance of the street. But there are some tweaks that could increase the chance of finding an orthogonal crossing, either by messing with the candidates generated or by making adjustments after a pair have been found. Changing how candidates are generatedRather than selecting left/right points and just drawing a line between them, do a search with each. Example:
This will more often create orthogonal-ish lines, as the sidewalks' shapes will usually track the street shape, so the nearest one will be nearly straight across. In addition, this would be a good time to incorporate the This will also increase the run time of the algorithms (which is almost entirely spent on candidate generation), but if the cost function is always convex then we can stop generating candidates once a minimum has been found (the cost starts to increase). Making adjustments laterIf you want the crossings to be as perfect as possible, you could also attempt to tweak the chosen candidate: draw true orthogonal lines from the start/end and through the street, check to see if it still intersects the same sidewalk. So, I'm totally open to this direction, but I think the focus should be on the candidates. |
I missed the updates you made in the morning! Will rebase! I agree the best direction moving forward is how the candidates are generated, but this was meant as an incremental step. It gives me slightly more acceptable results than just evaluating based on length of line and closeness to intersection. |
Cool. I'm making some structural changes, so you may want to wait on that push I said would take "a few minutes". |
Still needs commenting, input variables are handled poorly.