Merge pull request #715 from adrianVmariano/master

Add 1-region, make all* functions non-recursive
This commit is contained in:
Revar Desmera
2021-11-01 15:37:51 -07:00
committed by GitHub
20 changed files with 817 additions and 533 deletions

View File

@@ -55,6 +55,7 @@ test_ccw_polygon();
test_reverse_polygon();
test_polygon_normal();
test_rot_decode();
//tests to migrate to other files
test_convex_distance();
@@ -966,4 +967,37 @@ module test_convex_collision() {
}
*test_convex_distance();
module test_rot_decode() {
Tlist = [
rot(37),
xrot(49),
yrot(88),
rot(37,v=[1,3,3]),
rot(41,v=[2,-3,4]),
rot(180),
xrot(180),
yrot(180),
rot(180, v=[3,2,-5], cp=[3,5,18]),
rot(0.1, v=[1,2,3]),
rot(-47,v=[3,4,5],cp=[9,3,4]),
rot(197,v=[13,4,5],cp=[9,-3,4]),
move([3,4,5]),
move([3,4,5]) * rot(a=56, v=[5,3,-3], cp=[2,3,4]),
ident(4)
];
errlist = [for(T = Tlist)
let(
parm = rot_decode(T),
restore = move(parm[3])*rot(a=parm[0],v=parm[1],cp=parm[2])
)
norm_fro(restore-T)];
assert(max(errlist)<1e-13);
}
*test_rot_decode();
// vim: expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap