1
0
mirror of git://projects.qi-hardware.com/cae-tools.git synced 2024-12-23 09:17:42 +02:00
cae-tools/poly2d/test/bugs
2015-01-18 20:57:09 -03:00

41 lines
995 B
Bash
Executable File

#!/bin/sh
. ./Common
###############################################################################
tst "bug: p2d_no_intersect could wrap around and bite itself" <<EOF
struct p2d *p = p2d_new();
p2d_append(p, v2d_new(0, 0));
p2d_append(p, v2d_new(1, 27.8058649225));
p2d_append(p, v2d_new(1, 2));
p2d_close(p);
p2d_area(p, 3, 3);
EOF
expect <<EOF
EOF
#------------------------------------------------------------------------------
tst "bug: collinear path segments tripped angle_3" <<EOF
struct p2d *p = p2d_new();
struct p2d *q;
p2d_append(p, v2d_new(0, 0));
p2d_append(p, v2d_new(1, 27.8058649225));
p2d_append(p, v2d_new(1, 2.0947540869));
p2d_append(p, v2d_new(1, 2));
p2d_close(p);
q = p2d_area(p, 3, 3);
p2d_write_gnuplot_all(stdout, q);
EOF
# Not output since the polygon is too small. This did not cause the above bug
# but just happened to be a property of the problem polygon.
expect <<EOF
EOF
###############################################################################