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:
@@ -49,4 +49,28 @@ expect <<EOF
|
||||
|
||||
EOF
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
tst "inner offset, polygon cw" <<EOF
|
||||
struct p2d *p = p2d_new();
|
||||
struct p2d *q;
|
||||
|
||||
p2d_append(p, v2d_new(0, 0));
|
||||
p2d_append(p, v2d_new(0, 1));
|
||||
p2d_append(p, v2d_new(2, 1));
|
||||
p2d_append(p, v2d_new(2, 0));
|
||||
p2d_close(p);
|
||||
q = p2d_offset(p, -0.1);
|
||||
p2d_write_gnuplot(stdout, q);
|
||||
EOF
|
||||
|
||||
expect <<EOF
|
||||
0.1 0.1
|
||||
1.9 0.1
|
||||
1.9 0.9
|
||||
0.1 0.9
|
||||
0.1 0.1
|
||||
|
||||
EOF
|
||||
|
||||
###############################################################################
|
||||
|
||||
Reference in New Issue
Block a user