Routing lines around objects
-
Today I got the idea of creating a new windows workflow foundation designer. For this I'm in need of some theory on how to route lines around objects that I've drawn on a canvas. I can't really find anything useful, but I'm pretty sure there's an article out there laying out the basics of routing lines or some kind of path finding mechanism. Anyone here know of an article explaining the principals of this?
WM. What about weapons of mass-construction? "What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
-
Today I got the idea of creating a new windows workflow foundation designer. For this I'm in need of some theory on how to route lines around objects that I've drawn on a canvas. I can't really find anything useful, but I'm pretty sure there's an article out there laying out the basics of routing lines or some kind of path finding mechanism. Anyone here know of an article explaining the principals of this?
WM. What about weapons of mass-construction? "What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
-
-
Today I got the idea of creating a new windows workflow foundation designer. For this I'm in need of some theory on how to route lines around objects that I've drawn on a canvas. I can't really find anything useful, but I'm pretty sure there's an article out there laying out the basics of routing lines or some kind of path finding mechanism. Anyone here know of an article explaining the principals of this?
WM. What about weapons of mass-construction? "What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
WillemM wrote:
how to route lines around objects that I've drawn on a canvas.
actually... it is easier than that. Keep a bounding circle/sphere and you can rapidly calculate intersections. Point distance from a line is one of the most useful functions from the graphics gems series of books (source available on the internet too). In theory the line connection should go like this:
draw_line(from, to)
{
location=checkhit(from,to);
if (location)
{
breakpoint=move_perpendicular(location); // move point outside of hit volume
draw_line(from,breakpoint);
draw_line(breakpoint,to);
} else
{
do_drawing(from,to);
}
}you can get fancier, and use an A* algorithm declaring all objects as negative zones (stay away) and all white space as positive zones (free movement). But it is kind of overkill to find the most optimized path when all you need is a non-cluttered path. But the A* algorithms are available in the AI game programming wisdom series. :)
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
WillemM wrote:
how to route lines around objects that I've drawn on a canvas.
actually... it is easier than that. Keep a bounding circle/sphere and you can rapidly calculate intersections. Point distance from a line is one of the most useful functions from the graphics gems series of books (source available on the internet too). In theory the line connection should go like this:
draw_line(from, to)
{
location=checkhit(from,to);
if (location)
{
breakpoint=move_perpendicular(location); // move point outside of hit volume
draw_line(from,breakpoint);
draw_line(breakpoint,to);
} else
{
do_drawing(from,to);
}
}you can get fancier, and use an A* algorithm declaring all objects as negative zones (stay away) and all white space as positive zones (free movement). But it is kind of overkill to find the most optimized path when all you need is a non-cluttered path. But the A* algorithms are available in the AI game programming wisdom series. :)
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
Hmm, as unuseful as the A& algorithm may sound at this moment, I think it's a good method to do just what I want. Because it makes the diagram more readable, because lines are shorter. Should be fun to combine that with WPF ;)
WM. What about weapons of mass-construction? "What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
-
Today I got the idea of creating a new windows workflow foundation designer. For this I'm in need of some theory on how to route lines around objects that I've drawn on a canvas. I can't really find anything useful, but I'm pretty sure there's an article out there laying out the basics of routing lines or some kind of path finding mechanism. Anyone here know of an article explaining the principals of this?
WM. What about weapons of mass-construction? "What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
WillemM wrote:
Today I got the idea of creating a new windows workflow foundation designer. For this I'm in need of some theory on how to route lines around objects that I've drawn on a canvas.
:doh: Now why didn't I think of that! It's obvious! Workflows where lines always route around objects, never to objects! ;P Marc
People are just notoriously impossible. --DavidCrow
There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith -
WillemM wrote:
Today I got the idea of creating a new windows workflow foundation designer. For this I'm in need of some theory on how to route lines around objects that I've drawn on a canvas.
:doh: Now why didn't I think of that! It's obvious! Workflows where lines always route around objects, never to objects! ;P Marc
People are just notoriously impossible. --DavidCrow
There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh SmithThat's in the category of workflows for managers trying to avoid nasty questions about the way they work. Unfortunatly, this doesn't have anything to do with a workflow designer...
WM. What about weapons of mass-construction? "What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
-
Hmm, as unuseful as the A& algorithm may sound at this moment, I think it's a good method to do just what I want. Because it makes the diagram more readable, because lines are shorter. Should be fun to combine that with WPF ;)
WM. What about weapons of mass-construction? "What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
WillemM wrote:
I think it's a good method to do just what I want.
the hardest part of the A* is deciding on the exact criteria for deciding what is a bad or good path. After that it works pretty fast at reducing the zillion possible paths to the shortest. I've used it and recommended it in the past. It is a good fast reduction of possible actions. Of course shortness has to be part of the grading criteria or it will simply judge the longer paths as equal to the shorter ones. :)
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
Today I got the idea of creating a new windows workflow foundation designer. For this I'm in need of some theory on how to route lines around objects that I've drawn on a canvas. I can't really find anything useful, but I'm pretty sure there's an article out there laying out the basics of routing lines or some kind of path finding mechanism. Anyone here know of an article explaining the principals of this?
WM. What about weapons of mass-construction? "What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
-
Today I got the idea of creating a new windows workflow foundation designer. For this I'm in need of some theory on how to route lines around objects that I've drawn on a canvas. I can't really find anything useful, but I'm pretty sure there's an article out there laying out the basics of routing lines or some kind of path finding mechanism. Anyone here know of an article explaining the principals of this?
WM. What about weapons of mass-construction? "What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
This may assist ... Paint.net source code is available via here http://www.getpaint.net/download.html[^] which states "Source Code. Interested in looking at almost 140,000 lines of code? This can be useful for students, developers, or anyone interested in checking it out for educational, research, or other purposes."
-
Today I got the idea of creating a new windows workflow foundation designer. For this I'm in need of some theory on how to route lines around objects that I've drawn on a canvas. I can't really find anything useful, but I'm pretty sure there's an article out there laying out the basics of routing lines or some kind of path finding mechanism. Anyone here know of an article explaining the principals of this?
WM. What about weapons of mass-construction? "What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
One of the more famous ones are from the amazing research folks from AT&T http://www.graphviz.org/[^] It has fantastic routing and layout algortihms, and the source has a friendly license to use. - Phil