1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-09-02 03:02:34 +02:00

refactored

This commit is contained in:
Justin Lin
2017-05-25 14:05:19 +08:00
parent d922a1e55c
commit 0ab91ad8ca
7 changed files with 82 additions and 26 deletions

View File

@@ -1,15 +1,18 @@
include <unittest.scad>;
include <shape_trapezium.scad>;
echo("==== test_shape_trapezium ====");
module test_shape_trapezium() {
echo("==== test_shape_trapezium ====");
expected = [[16.7639, -10], [18.4469, -9.0806], [18.5825, -7.1677], [18.5528, -7.10557], [10.5528, 8.89443], [8.97782, 9.98853], [8.76393, 10], [-8.76393, 10], [-8.97782, 9.98853], [-10.5528, 8.89443], [-18.5528, -7.10557], [-18.5825, -7.1677], [-18.4469, -9.0806], [-16.7639, -10]];
expected = [[16.7639, -10], [18.4469, -9.0806], [18.5825, -7.1677], [18.5528, -7.10557], [10.5528, 8.89443], [8.97782, 9.98853], [8.76393, 10], [-8.76393, 10], [-8.97782, 9.98853], [-10.5528, 8.89443], [-18.5528, -7.10557], [-18.5825, -7.1677], [-18.4469, -9.0806], [-16.7639, -10]];
actual = shape_trapezium(
[40, 20],
h = 20,
corner_r = 2
);
actual = shape_trapezium(
[40, 20],
h = 20,
corner_r = 2
);
assertEqualPoints(expected, actual);
assertEqualPoints(expected, actual);
}
test_shape_trapezium();