New year's day!
Here's the design for the intersection code. This is going to get more complex from here; keeping the code real clean is going to become a serious priority now.
- Intersection on 3d is very complex, but is going to have to be considered to future. Right now what's needed is a good 2d implementation, so I'll ignore the z coordinates for testing lines and will assign the average to the resulting intersection.
- Lines not on the same bounding box should not be tested.
- Lines that may or not intersect should be tested first for intersection with a cheap algorithm before expending on finding the intersection itself.
- Lines that are found to intersect have their distance to the cursor tested for a minimum.
Points one to three are easy to cache; such cache would then have to be updated after adding lines.
I'll take advantage of this chance to advertise a shameless plug to my project, Fandango. Testers are welcome, and anybody that can understand the current code is encouraged to improve into it, on particular on the python modules that are really easy to hack. I'll be available by mail to help, and the project page has already some basic documentation.