mirror of
git://projects.qi-hardware.com/cae-tools.git
synced 2025-04-21 12:27:27 +03:00
poly2d/: automatically switch between clockwise and counter-clockwise polygons
The only functions that care about this at the moment are from CGAL, and there we can determine from context what to do.
This commit is contained in:
@@ -16,23 +16,22 @@ operation in cameo. Later, poly2d could replace more parts of
|
||||
cameo.
|
||||
|
||||
poly2d puts more emphasis on simplicity than on performance. Some
|
||||
functions expect clockwise closed polygons that don't self-intersect.
|
||||
functions expect closed polygons that don't self-intersect. For now,
|
||||
it doesn't matter whether polygons are clockwise or counter-clockwise.
|
||||
The table below shows the capabilities
|
||||
|
||||
Open Counter-clockwise
|
||||
| Concave Min. vertices
|
||||
Open Min. vertices
|
||||
| Concave
|
||||
| | Self-intersect
|
||||
| | | | |
|
||||
Y Y Y Y 0 p2d_contains_poly(b), p2d_free, p2d_free_all,
|
||||
p2d_is_closed, p2d_copy, p2d_reverse, p2d_vertices,
|
||||
p2d_write_gnuplog, p2d_write_gnuplot_all
|
||||
Y Y Y Y 1 p2d_read_gnuplot
|
||||
- Y Y Y 0 p2d_simplify
|
||||
- Y - Y 3 p2d_is_cw
|
||||
- Y - - 3 p2d_contains_point, p2d_contains_poly (a),
|
||||
- Y - # 3 p2d_area*, p2d_offset*
|
||||
|
||||
# CGAL uses ccw, poly2d uses cw. Need to switch.
|
||||
| | | |
|
||||
Y Y Y 0 p2d_contains_poly(b), p2d_copy, p2d_free, p2d_free_all,
|
||||
p2d_is_closed, p2d_no_intersect, p2d_reverse,
|
||||
p2d_vertices, p2d_write_gnuplot, p2d_write_gnuplot_all
|
||||
Y Y Y 1 p2d_read_gnuplot
|
||||
- Y Y 0 p2d_simplify
|
||||
- Y - 3 p2d_is_cw
|
||||
- Y - 3 p2d_contains_point, p2d_contains_poly (a),
|
||||
- Y - 3 p2d_area*, p2d_offset*
|
||||
|
||||
Not yet implemented:
|
||||
- p2d_simplify (low priority - the offsetting from CGAL already covers
|
||||
@@ -43,8 +42,6 @@ Not yet specified:
|
||||
|
||||
Other:
|
||||
- change the license from GPL to LGPL
|
||||
- change ccw to cw
|
||||
- make sure CGAL is only fed ccw ploygons and cw holes
|
||||
- transform CGAL's idea of outer polygons into something we can use
|
||||
- use more meaningful offset/overlap model for area fill
|
||||
- check for memory leaks
|
||||
|
||||
Reference in New Issue
Block a user