Recent content by Kyudos

  1. K

    Robust Algorithm to Order Parallel Polylines

    Yeah, ordering is straightforward for a group of parallel single lines - rotate them to vertical or horizontal and use the coordinates, rotate them back again. But since the set of lines I'm working on is user selected, I'd have to first try and determine if this was my situation I was...
  2. K

    Robust Algorithm to Order Parallel Polylines

    I considered the convex hull, but it doesn't necessarily include all the points does it? I know that each of the two points on each line are on the boundary of my desired polygon. They all need to be included, that's why I thought a TSP would be the simplest solution, if ordering turned out to...
  3. K

    Robust Algorithm to Order Parallel Polylines

    Hi Chiro and thanks for the welcome. I'm trying to draw (literally, in a CAD program) an operating region (a polygon) defined by two points on each line. In order to draw the polygon, I need to add the points in the correct order. If the lines themselves are "in order" this is simply a case...
  4. K

    Robust Algorithm to Order Parallel Polylines

    I think this will work in most situations: Lines 1) Draw the bounding rectangle (red). 2) Extend the lines to the boundary (blue). 3) Draw diagonal that has largest angle to lines (green) 4) Order is given by distance of intersections along diagonal. Polylines 1) Draw the...
  5. K

    Robust Algorithm to Order Parallel Polylines

    Thinking more about this, if I can draw a (poly) line through all the other (poly) lines, finding the intersections from one end to the other would given me the order I'm after. Now, how to figure that out...
  6. K

    Robust Algorithm to Order Parallel Polylines

    I'm trying to come up with a way to order 'random' (poly) lines, knowing only the coordinates of the vertices (and, obviously, which vertices belong to any given line). I'm not a mathematician or geometrician, but I have a feeling there must be an 'easy' way to do this! Would probably have...
Back
Top