1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
dotSCAD/test/voxel/test_vx_difference.scad
2022-06-06 13:11:46 +08:00

17 lines
2.5 KiB
OpenSCAD

use <voxel/vx_difference.scad>
use <voxel/vx_cylinder.scad>
use <voxel/vx_sphere.scad>
module test_vx_difference() {
echo("==== test_vx_difference ====");
expected = [[-3, -5, 0], [-2, -5, 0], [-1, -5, 0], [0, -5, 0], [1, -5, 0], [2, -5, 0], [3, -5, 0], [-4, -4, 0], [-3, -4, 0], [3, -4, 0], [4, -4, 0], [-5, -3, 0], [-4, -3, 0], [4, -3, 0], [5, -3, 0], [-5, -2, 0], [5, -2, 0], [-5, -1, 0], [5, -1, 0], [-5, 0, 0], [5, 0, 0], [-5, 1, 0], [5, 1, 0], [-5, 2, 0], [5, 2, 0], [-5, 3, 0], [-4, 3, 0], [4, 3, 0], [5, 3, 0], [-4, 4, 0], [-3, 4, 0], [3, 4, 0], [4, 4, 0], [-3, 5, 0], [-2, 5, 0], [-1, 5, 0], [0, 5, 0], [1, 5, 0], [2, 5, 0], [3, 5, 0], [-3, -5, 1], [-2, -5, 1], [-1, -5, 1], [0, -5, 1], [1, -5, 1], [2, -5, 1], [3, -5, 1], [-4, -4, 1], [-3, -4, 1], [3, -4, 1], [4, -4, 1], [-5, -3, 1], [-4, -3, 1], [4, -3, 1], [5, -3, 1], [-5, -2, 1], [5, -2, 1], [-5, -1, 1], [5, -1, 1], [-5, 0, 1], [5, 0, 1], [-5, 1, 1], [5, 1, 1], [-5, 2, 1], [5, 2, 1], [-5, 3, 1], [-4, 3, 1], [4, 3, 1], [5, 3, 1], [-4, 4, 1], [-3, 4, 1], [3, 4, 1], [4, 4, 1], [-3, 5, 1], [-2, 5, 1], [-1, 5, 1], [0, 5, 1], [1, 5, 1], [2, 5, 1], [3, 5, 1], [-3, -5, 2], [-2, -5, 2], [-1, -5, 2], [0, -5, 2], [1, -5, 2], [2, -5, 2], [3, -5, 2], [-4, -4, 2], [-3, -4, 2], [3, -4, 2], [4, -4, 2], [-5, -3, 2], [-4, -3, 2], [4, -3, 2], [5, -3, 2], [-5, -2, 2], [5, -2, 2], [-5, -1, 2], [5, -1, 2], [-5, 0, 2], [5, 0, 2], [-5, 1, 2], [5, 1, 2], [-5, 2, 2], [5, 2, 2], [-5, 3, 2], [-4, 3, 2], [4, 3, 2], [5, 3, 2], [-4, 4, 2], [-3, 4, 2], [3, 4, 2], [4, 4, 2], [-3, 5, 2], [-2, 5, 2], [-1, 5, 2], [0, 5, 2], [1, 5, 2], [2, 5, 2], [3, 5, 2], [-3, -5, 3], [-2, -5, 3], [-1, -5, 3], [0, -5, 3], [1, -5, 3], [2, -5, 3], [3, -5, 3], [-4, -4, 3], [-3, -4, 3], [-2, -4, 3], [-1, -4, 3], [0, -4, 3], [1, -4, 3], [2, -4, 3], [3, -4, 3], [4, -4, 3], [-5, -3, 3], [-4, -3, 3], [-3, -3, 3], [3, -3, 3], [4, -3, 3], [5, -3, 3], [-5, -2, 3], [-4, -2, 3], [4, -2, 3], [5, -2, 3], [-5, -1, 3], [-4, -1, 3], [4, -1, 3], [5, -1, 3], [-5, 0, 3], [-4, 0, 3], [4, 0, 3], [5, 0, 3], [-5, 1, 3], [-4, 1, 3], [4, 1, 3], [5, 1, 3], [-5, 2, 3], [-4, 2, 3], [4, 2, 3], [5, 2, 3], [-5, 3, 3], [-4, 3, 3], [-3, 3, 3], [3, 3, 3], [4, 3, 3], [5, 3, 3], [-4, 4, 3], [-3, 4, 3], [-2, 4, 3], [-1, 4, 3], [0, 4, 3], [1, 4, 3], [2, 4, 3], [3, 4, 3], [4, 4, 3], [-3, 5, 3], [-2, 5, 3], [-1, 5, 3], [0, 5, 3], [1, 5, 3], [2, 5, 3], [3, 5, 3]];
actual = vx_difference(
vx_cylinder(6, 4, filled = true),
vx_sphere(5, filled = true)
);
assert(expected == actual);
}
test_vx_difference();