LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sort drawing lines to a xy (out of a dxf)

hello all

 

i wrote a parser for dxf where i extract multiple line elements.

in the dxf, this lines together forms a countour, so the order of lines is unique to get the right visible output.

 

now, the dxf itself stores this lines in an own, random order (an unordered list).

i have to concatenate them by myself. as i want to show it in an xy graph, it is necessary to have the correct sort of circulation. otherwise crossing lines are shown (from an end of a line to the begin of another).

 

does anyone know, or already have, an existing algorithm to do this?

(taking an endpoint of a line, compare it with the both endpoints of all other lines, take the line with the nearest end, take this line out of the selection and starts again for the endpoint of this line)

 

thanks in advance for any help

 

 

0 Kudos
Message 1 of 6
(3,266 Views)

oh, what i forget to mention:

 

or is there a way in xy graph to interrupt a connection from a point to the next? this would also solve my problem.

i asked myself this before several times already. how to handle multiple parts in an xy without connecting it (a line from a point to the next).

 

or to draw each segment on an own layer and merge it to one at the end?

 

thanks for a hint

0 Kudos
Message 2 of 6
(3,264 Views)

You could plot every line as a separate plot.  Have you considered using a picture indicator instead, and drawing individual lines that way?

0 Kudos
Message 3 of 6
(3,259 Views)

picture is not possible.

 

xy graph:

is it not possible to draw two lines in parallel on the same layer without a connection between?

 

thanks

0 Kudos
Message 4 of 6
(3,256 Views)

No, unless you make them separate plots.  (This isn't some LabVIEW-specific behavior, Excel does the same thing.)  Separate plots are not the same thing as separate graphs - you can put multiple plots on the same graph, and each plot is a separate series of points.  You can change the plot style so there are no lines at all, just points, but I don't think that helps you either.  Why is a picture not possible?

0 Kudos
Message 5 of 6
(3,254 Views)

picture is not possible, because i have to add the data to an existing xy graph (with zooming, alignment and a lot of other operations on it).

 

in meantime i think i have found the solution: between points in a plot where no line should be drawn, simply a 'Nan' can be inserted.

(http://forums.ni.com/t5/LabVIEW/How-to-create-Pen-up-and-Pen-down-option-in-X-Y-graph/m-p/1332722/hi...)

 

i will test it as soon as i am back in the office later....

0 Kudos
Message 6 of 6
(3,251 Views)