2D Geometry library: LGPL alternative to CGAL?

Zoomulator picture Zoomulator · Feb 19, 2012 · Viewed 11.7k times · Source

CGAL seems to do just about everything I need and a little more for my upcoming project. It can create polygons out of arc line segments and run boolean operations on them. It has spatial sorting packages already that would save me a lot of time regarding a few things and the whole library seems quite standardized and well planned.

There's just the issue with the license being QPL (GPL for the upcoming version 4.0) for most of the packages (except the very basic ones). I've got a meager budget and can likely not gather funds to buy the commercial licenses for those specific packages in CGAL that require it.

My specific needs of such a library would be:

  • Exact precision 2D euclidean space
  • Complex polygons
  • Polygons able to have curved line (arc) segments
  • Boolean operations on those polygons
  • Polygon offsetting
  • Polygon partitioning or effective triangulation
  • Inscribed area and polygon fitting algorithms
  • Possibly some spatial sorting structures with circular range searches

All in all, I'm looking for a well rounded 2D geometry C++ library with exact precision. Preferably with MIT, LGPL at a stretch, or a low cost one-time royalty-free license below $500.

Boost got some basic structures down, but from what I can tell they lack a lot of the higher level functionality. Any libraries that has expanded on this? I would consider doing it myself, but I lack the expertise to do it well and it'd prolong my project by quite a bit.

Just to be clear, I'm not looking for a 2D graphics library, just pure geometry structures.

Answer

Ram picture Ram · Apr 13, 2012

Have a look at Wykobi. It is a templated library and you can template the dimension as 2D.

It is distributed under the MIT License.