CAD CAM EDM DRO - Yahoo Group Archive

Algorithm

on 2002-07-09 14:26:01 UTC
Hi all,

I do'nt know if this is the right place to put my question ?
I 'm writing an application that will convert DXF (2D) to G-code for
cuttong out contours on a plasma cutter.

I have a list of lines (X,Y coordinates) and I want to find out if those
lines make part of a closed contour (so if the endpoint of the previous line
fits to the startpoint of the next line). The coordinates are not sorted.
Following is an example of two closed rectangles. How do I sort those
coordinates ?

Line : (26.00,43.50) => (114.00,43.50) (could also be (114.00,43.50) =>
(26.00,43.50))
Line : (114.00,6.50) => (26.00,6.50)
Line : (140.00,0.00) => (0.00,0.00)
Line : (0.00,50.00) => (140.00,50.00)
Line : (0.00,0.00) => (0.00,50.00)
Line : (26.00,6.50) => (26.00,43.50)
Line : (114.00,43.50) =>(114.00,6.50)
Line : (140.00,50.00) => (140.00,0.00)

Thanks

Luc

Discussion Thread

Luc Vercruysse 2002-07-09 14:26:01 UTC Algorithm dumbdrive 2002-07-09 18:23:21 UTC Re: Algorithm Raymond Heckert 2002-07-10 12:10:33 UTC Re: [CAD_CAM_EDM_DRO] Algorithm Luc Vercruysse 2002-07-10 12:34:52 UTC Re: [CAD_CAM_EDM_DRO] Algorithm