[Drawkit] SonoDraw source available, incorporating DXFReader

Brad Larson larson at sonoplot.com
Tue Jul 7 15:54:42 PDT 2009


I thought that people might be interested in the source code for the  
latest build of our in-house CAD application SonoDraw.  A full source  
bundle, including all supporting frameworks, can be downloaded from  
here:

http://www.sonoplot.com/SonoDraw/SonoDrawBundle-2.2.zip

This version finally integrates work that Allan Daly and Michael Caron  
have done on the DXFReader framework and its connection to DrawKit.   
Only simple drawing elements are imported from DXFs right now.   
Because DXF doesn't do a good job of specifying units, the user is  
prompted for the conversion factor when a DXF is loaded.  Also, in  
order to account for the difference in starting origin between DrawKit  
(and our machine) and standard CAD programs, I manually go through and  
flip the items about the center of the drawing when the DXF has  
finished loading.  Still, this is workable for many of our users.   
Thanks again, Allan and Michael, for enabling this functionality.

Additionally, Graham, I've made some modifications to the  
DKRouteFinder class in the DrawKit framework bundled with the source  
above.  I've added support for having two points for each object to be  
sorted, where the sort now finds the shortest distance between an  
object and either point on each other object.  This lets paths be  
sorted in a more natural manner for our robot (connected lines are  
sorted to be drawn one after another, etc.).  Also, I was running into  
some glitches with sorts on grids, so I found that if I replaced the  
side-to-side sweeping heuristic with a simple Y distance check, I was  
able to eliminate these problems.  When searching for the next object,  
if more than one object is equidistant from the current one, the  
object with the smallest difference in Y location is preferred.  I  
haven't had a chance to clean up the code in this class, so I  
apologize for the mess.

______________________
Brad Larson, Ph.D.
SonoPlot, Inc.
3030 Laura Lane, Suite 120
Middleton, WI 53562






More information about the Drawkit mailing list