Fixed docs for path2d.

Modified pointlist_bounds to give output that matches input
dimension and to work on any input dimension.  Also made it ~20 times faster.
This commit is contained in:
Adrian Mariano
2020-07-24 16:36:57 -04:00
parent 68459776e2
commit 1dda5b088c
3 changed files with 27 additions and 8 deletions

View File

@@ -613,6 +613,23 @@ module test_pointlist_bounds() {
[23,57,-42]
];
assert(pointlist_bounds(pts) == [[-63,-32,-42], [84,97,42]]);
pts2d = [
[-53,12],
[-63,36],
[84,-5],
[63,42],
[23,-42]
];
assert(pointlist_bounds(pts2d) == [[-63,-42],[84,42]]);
pts5d = [
[-53,27,12,-53,12],
[-63,97,36,-63,36],
[84,-32,-5,84,-5],
[63,-24,42,63,42],
[23,57,-42,23,-42]
];
assert(pointlist_bounds(pts5d) == [[-63,-32,-42,-63,-42],[84,97,42,84,42]]);
assert(pointlist_bounds([[3,4,5,6]]), [[3,4,5,6],[3,4,5,6]]);
}
test_pointlist_bounds();