mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-12 09:44:16 +02:00
add test
This commit is contained in:
@@ -91,6 +91,7 @@ include <voxel/test_vx_cylinder.scad>;
|
||||
include <voxel/test_vx_sphere.scad>;
|
||||
include <voxel/test_vx_polygon.scad>;
|
||||
include <voxel/test_vx_intersection.scad>;
|
||||
include <voxel/test_vx_difference.scad>;
|
||||
|
||||
// Matrix
|
||||
include <matrix/test_m_scaling.scad>;
|
||||
|
17
test/voxel/test_vx_difference.scad
Normal file
17
test/voxel/test_vx_difference.scad
Normal file
@@ -0,0 +1,17 @@
|
||||
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();
|
Reference in New Issue
Block a user