2021-07-06 03:46:43 +00:00
|
|
|
include <../std.scad>
|
|
|
|
|
|
|
|
|
2022-10-23 03:16:38 +00:00
|
|
|
module test_line_copies() {
|
2023-01-18 09:18:17 +00:00
|
|
|
assert_equal(line_copies(l=100,n=5,p=[0,0,0]), [[-50,0,0],[-25,0,0],[0,0,0],[25,0,0],[50,0,0]]);
|
|
|
|
assert_equal(line_copies(20,n=5,p=[0,0,0]), [[-40,0,0],[-20,0,0],[0,0,0],[20,0,0],[40,0,0]]);
|
|
|
|
assert_equal(line_copies(spacing=20,n=5,p=[0,0,0]), [[-40,0,0],[-20,0,0],[0,0,0],[20,0,0],[40,0,0]]);
|
|
|
|
assert_equal(line_copies(spacing=[0,20],n=5,p=[0,0,0]), [[0,-40,0],[0,-20,0],[0,0,0],[0,20,0],[0,40,0]]);
|
2021-07-06 03:46:43 +00:00
|
|
|
|
2023-01-18 09:18:17 +00:00
|
|
|
assert_equal(line_copies(p1=[0,0],l=100,n=5,p=[0,0,0]), [[0,0,0],[25,0,0],[50,0,0],[75,0,0],[100,0,0]]);
|
|
|
|
assert_equal(line_copies(p1=[0,0],20,n=5,p=[0,0,0]), [[0,0,0],[20,0,0],[40,0,0],[60,0,0],[80,0,0]]);
|
|
|
|
assert_equal(line_copies(p1=[0,0],spacing=20,n=5,p=[0,0,0]), [[0,0,0],[20,0,0],[40,0,0],[60,0,0],[80,0,0]]);
|
|
|
|
assert_equal(line_copies(p1=[0,0],spacing=[0,20],n=5,p=[0,0,0]), [[0,0,0],[0,20,0],[0,40,0],[0,60,0],[0,80,0]]);
|
2021-07-06 03:46:43 +00:00
|
|
|
}
|
2022-10-23 03:16:38 +00:00
|
|
|
test_line_copies();
|
2021-07-06 03:46:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// vim: expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap
|