Tuesday 15 April 2014

algorithm - How to connect 2 shapes with straight lines (like a diagram editor) -



algorithm - How to connect 2 shapes with straight lines (like a diagram editor) -

i have 2 rects , need draw set of lines connect them. straight lines allowed (no diagonal).

initially i've made grid , i've used a* path finding algorithm find way connect 2 points located @ edges of figures.

it works seems little overkill; in fact can avoid obstacles check (the rect of objects) assuming can connect nearest (and visible) edges. can suggest me simpler algorithm it?

algorithm a-star

No comments:

Post a Comment