2020-07-22 00:05:21 +00:00
|
|
|
include <../std.scad>
|
|
|
|
include <../skin.scad>
|
2019-11-09 00:25:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
module test_skin() {
|
2020-05-30 02:04:34 +00:00
|
|
|
profiles = [
|
|
|
|
[[-100,-100,0], [0,100,0], [100,-100,0]],
|
|
|
|
[[-100,-100,100], [-100,100,100], [100,100,100], [100,-100,100]],
|
|
|
|
];
|
2020-06-15 08:29:23 +00:00
|
|
|
vnf1 = skin(profiles, slices=0, caps=false, method="distance");
|
2021-04-14 00:21:19 +00:00
|
|
|
assert_equal(vnf1, [[[-100,-100,0],[0,100,0],[0,100,0],[100,-100,0],[-100,-100,100],[-100,100,100],[100,100,100],[100,-100,100]],[[0,5,4],[0,1,5],[5,2,6],[2,3,6],[6,3,7],[3,0,7],[7,0,4]]]);
|
|
|
|
|
2020-06-15 08:29:23 +00:00
|
|
|
vnf2 = skin(profiles, slices=0, caps=true, method="distance");
|
2021-10-17 21:50:35 +00:00
|
|
|
assert_equal(vnf2,[[[-100,-100,0],[0,100,0],[0,100,0],[100,-100,0],[-100,-100,100],[-100,100,100],[100,100,100],[100,-100,100]],[[3,2,1,0],[4,5,6,7],[0,5,4],[0,1,5],[5,2,6],[2,3,6],[6,3,7],[3,0,7],[7,0,4]]]);
|
2019-11-09 00:25:47 +00:00
|
|
|
}
|
|
|
|
test_skin();
|
|
|
|
|
|
|
|
|
2024-01-01 21:28:13 +00:00
|
|
|
module test_sweep() {
|
|
|
|
multi_region = [
|
|
|
|
[[10, 0], [ 0, 0], [ 0, 10], [10, 10]],
|
|
|
|
[[30, 0], [20, 0], [20, 10], [30, 10]]
|
|
|
|
];
|
|
|
|
transforms = [ up(10), down(10) ];
|
|
|
|
|
|
|
|
vnf1 = sweep(multi_region,transforms,closed=false,caps=false);
|
|
|
|
assert(len(vnf1[0])==8*2 && len(vnf1[1])==8*2);
|
|
|
|
|
|
|
|
vnf2 = sweep(multi_region,transforms,closed=false,caps=false,style="quincunx");
|
|
|
|
assert(len(vnf2[0])==8*3 && len(vnf2[1])==8*4);
|
|
|
|
}
|
|
|
|
test_sweep();
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-30 02:04:34 +00:00
|
|
|
// vim: expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap
|