开发者

Looking for Polygon Geometry library with specific capabilities

I am doing a survey of polygon/geometric algorithm libraries implemented in Objective C, C or C++ (in that order of preference). I ha开发者_JS百科ve very specific needs, so I figured I'd ask the community to see if anyone knows of one that meets some or all of them since I'd prefer to use one library/API for all my needs. This is what I need to be able to do:

  1. Intersection of 2 polygons
  2. Determine if two polygons are congruent (i.e. the same shape and size though they may be rotated or mirrored)
  3. 2d bin packing of convex polygons (aka sheet cutting - or open-ended bin packing so I'm maximizing the use of a run of material of fixed width)
  4. Same as #3 but for concave polygons
  5. The ability to take a set of line segments, some of which share endpoints and some of which intersect each other and turn it into a set of polygon
  6. Same as #5 but with the added ability to detect polygons with holes and break it into 2 polygons (at least one of which would be concave)
  7. Bonus: any or all of the above with closed shapes that consist of lines and curves

These are in the order of priority and I can work around the absence of any of them (my application just becomes less useful). so for example, if I had a library that only did 1 and 2, I would find that more useful than one that did 3-7.


In C++ it exists some libraries to work with the polygon geometry but I don't know one that fully corresponds to your needs.

A very useful library that I know in C++ is CGAL. It covers some of your needs, but not all.


Some of the things you need are covered by GEOS.

Spatial relations between geometries (intersects, touches, overlaps, is within, contains, etc) are implemented quite nicely by GEOS.

I don't know if 3-7 are built in (you can do line merging (5)).

As for 7, GEOS does not model curves (only points that form lines or polygons). The only closed shapes that you can define in GEOS are polygons.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜