Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Routing lines around objects

Routing lines around objects

Scheduled Pinned Locked Moved The Lounge
tutorialquestionworkspace
11 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W WillemM

    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

    M Offline
    M Offline
    Maxwell Chen
    wrote on last edited by
    #2

    "Edge detection". Edge detection (Wikipedia)[^].


    Maxwell Chen

    W 1 Reply Last reply
    0
    • M Maxwell Chen

      "Edge detection". Edge detection (Wikipedia)[^].


      Maxwell Chen

      W Offline
      W Offline
      WillemM
      wrote on last edited by
      #3

      Great, I'm going to read that. It seems I've been looking for the wrong keywords.

      WM. What about weapons of mass-construction? "What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson

      1 Reply Last reply
      0
      • W WillemM

        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

        E Offline
        E Offline
        El Corazon
        wrote on last edited by
        #4

        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)

        W 1 Reply Last reply
        0
        • E El Corazon

          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)

          W Offline
          W Offline
          WillemM
          wrote on last edited by
          #5

          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

          E 1 Reply Last reply
          0
          • W WillemM

            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

            M Offline
            M Offline
            Marc Clifton
            wrote on last edited by
            #6

            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

            Thyme In The Country
            Interacx

            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

            W 1 Reply Last reply
            0
            • M Marc Clifton

              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

              Thyme In The Country
              Interacx

              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

              W Offline
              W Offline
              WillemM
              wrote on last edited by
              #7

              That'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

              1 Reply Last reply
              0
              • W WillemM

                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

                M Offline
                M Offline
                Maximilien
                wrote on last edited by
                #8

                think 3D, just use over-pass and under-pass !!!


                Maximilien Lincourt Your Head A Splode - Strong Bad

                1 Reply Last reply
                0
                • W WillemM

                  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

                  E Offline
                  E Offline
                  El Corazon
                  wrote on last edited by
                  #9

                  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)

                  1 Reply Last reply
                  0
                  • W WillemM

                    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

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #10

                    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."

                    1 Reply Last reply
                    0
                    • W WillemM

                      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

                      P Offline
                      P Offline
                      Phil Martin
                      wrote on last edited by
                      #11

                      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

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups