Root/
| 1 | poly2d - Yet another 2D polygon library |
| 2 | ======================================= |
| 3 | |
| 4 | Why do we need another 2D polygon library, if there are already CGAL, |
| 5 | Boost, Clipper, GPC, ... ? |
| 6 | |
| 7 | All the above are either written in a weird language, are under a |
| 8 | non-Free license, or simply don't provide the feature set we need |
| 9 | here. poly2d is written in C, doesn't depend on non-standard |
| 10 | libraries, and is licensed under the GPL (will change to LGPL). |
| 11 | |
| 12 | poly2d serves itself liberally from code already in cameo but |
| 13 | provides a simpler and cleaner interface. The first objective is |
| 14 | to provide the tools to replace the (badly broken) area filling |
| 15 | operation in cameo. Later, poly2d could replace more parts of |
| 16 | cameo. |
| 17 | |
| 18 | poly2d puts more emphasis on simplicity than on performance. Some |
| 19 | functions expect closed polygons that don't self-intersect. For now, |
| 20 | it doesn't matter whether polygons are clockwise or counter-clockwise. |
| 21 | The table below shows the capabilities |
| 22 | |
| 23 | Open Min. vertices |
| 24 | | Concave |
| 25 | | | Self-intersect |
| 26 | | | | | |
| 27 | Y Y Y 0 p2d_contains_poly(b), p2d_copy, p2d_free, p2d_free_all, |
| 28 | p2d_is_closed, p2d_no_intersect, p2d_reverse, |
| 29 | p2d_vertices, p2d_write_gnuplot, p2d_write_gnuplot_all |
| 30 | Y Y Y 1 p2d_read_gnuplot |
| 31 | - Y Y 0 p2d_simplify |
| 32 | - Y - 3 p2d_is_cw |
| 33 | - Y - 3 p2d_contains_point, p2d_contains_poly (a), |
| 34 | - Y - 3 p2d_area*, p2d_offset* |
| 35 | |
| 36 | Not yet implemented: |
| 37 | - p2d_simplify (low priority - the offsetting from CGAL already covers |
| 38 | the main use case) |
| 39 | |
| 40 | Not yet specified: |
| 41 | - subtraction (do we actually need it ?) |
| 42 | |
| 43 | Other: |
| 44 | - transform CGAL's idea of outer polygons into something we can use |
| 45 | - check for memory leaks |
| 46 | |
| 47 | Prerequisite: |
| 48 | libcgal-dev |
| 49 |
Branches:
master
