[Drawkit] Now with added testing. (was Re: For the brave ; -)

Graham Cox graham.cox at bigpond.com
Tue Aug 5 06:03:54 PDT 2008


Not sure exactly what the problem is, but it would be better to start  
at the top, left point of a notional bounding box of the objects. Then  
you know that searching east should find something sensible in your  
object set. Starting at 0,0 might put the ideal first object outside  
the visibility of the NN search for a given direction.

cheers, Graham


On 5 Aug 2008, at 9:16 am, Brad Larson wrote:

> Testing it out, it's very close, but I'm having a problem with the  
> fact that the pathfinding starts at the first element drawn, rather  
> than the zero point.  This means that if you have a grid, and the  
> first point you drew was in the middle of the grid, you'll get a  
> nonoptimal path.  Our dispenser always starts from the 0,0 point  
> when drawing, so this also reflects the actual behavior of the  
> device.  I tried modifying the nearest-neighbor to do this by  
> inserting a 0,0 point as the first point to test against, then  
> removing that 0,0 point at the end, but I'm getting weird behavior  
> from it (dropped lines, jumpiness at the start) so I must not be  
> doing it the right way.



More information about the Drawkit mailing list