Milestone: .Net Boolean Path Engine

Well, today I am celebrating bit of a milestone with regard to my graphics project. I finally have an operational 2D vector path engine which is capable of boolean operations. It supports union, intersection and subtraction of bezier and straight line paths with holes and seems to be working really well, at long last!

One of the things that has really helped develop this engine is the vast suite of unit tests. It's amazing just how many tricky path operations you can devise that can really stress the engine. What may originally seem a relatively simple task reveals itself to have many complications with several degenerate or special cases.

There have been a number of 'what if?' test cases I have thrown at the engine that have revealed areas that need to be improved. Particularly tricky problems include: subtraction of a subpath from a path, e.g. half a hexagon from a hexagon, union and subtraction operations on paths which include shared edges, paths that contain perfectly overlapping bezier sections, bezier curves that lie almost on top of each other and many more. In fact, I now have nearly 100 test cases for path operations, which I will continue to add to.

One thing I am really pleased about is just how well my engine compares to other commercial and non commercial engines. It's fun to take some of the trickiest test cases to see how the results compare to dedicated vector applications such as Xara X, Inkscape and Expression Blend. Because I have tweaked my engine to cope with these test cases, I can say that the output compares very favourably with each of the other applications - so I must be doing something right. That's not to say that the engine is perfect, there are bound to be new test cases that expose some limitations, but overall I am pleased. However, if you have any ideas for tricky operations, please let me know and I'll add them to my tests. I'll also try and post some images of some of the trickiest tests.

Certainly, one area that could still do with some extra tweaks is the performance with asymptotic paths, which can be slow. However, overall I'm in the mood to celebrate.

Comments

Popular posts from this blog

Straight Skeleton Madness (a plea for help)

Holographic Capture using Multiple Kinect - A DIY Approach with Lessons Learned!