Domain changed to archive.palanq.win . Feb 14-25 still awaits import.
[6 / 1 / 1]

algorithm help

No.1527921 View ViewReplyOriginalReport
please help me write a better pathing algorithm. it's meant to be a super simple method to generate a list of orthogonal keypoints to draw a line on a canvas between two squares while avoiding the squares so the path and squares don't intersect. what i have works most of the time but there are always a few cases where the pathing glitches out and intersects the end object or the line turns diagonal when it should be entirely orthogonal. feels like i'm playing whack-a-mole and it doesn't end. specifically, the pathing screws up usually when the two objects are in-line with each other horizontally or vertically, and the path ends up going through the end object to the other side even though it's meant to swerve around.

i'd really appreciate if anyone could take a look at this code and give me some pointers on how to improve it, though i'm also not averse to scrapping it and doing something that works better. this is written in dart, btw.

code found here:
https://pastebin.com/kAmQBAxY