1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-25 23:46:32 +02:00
This commit is contained in:
Justin Lin
2020-05-20 16:54:02 +08:00
parent f89e87e146
commit e08f225a0b
31 changed files with 1598 additions and 83 deletions

View File

@@ -1,5 +1,5 @@
use <pixel/px_circle.scad>;
use <pixel/px_polygon.scad>;
use <voxel/vx_circle.scad>;
use <voxel/vx_polygon.scad>;
w = 5;
merged_dino = false;
@@ -136,7 +136,7 @@ module cactus(w) {
translate([2 * w, w * 7])
scale(w)
blocks(
px_polygon([
vx_polygon([
[0, 2],
[3, 2],
[5, 4],
@@ -152,7 +152,7 @@ module cactus(w) {
translate([-2 * w, w * 5])
scale(w)
blocks(
px_polygon([
vx_polygon([
[-1, 0],
[-3, 0],
[-6, 2],
@@ -167,7 +167,7 @@ module cactus(w) {
scale(w)
blocks(
px_polygon([
vx_polygon([
[-2, 0],
[2, 0],
[2, 20],
@@ -187,11 +187,11 @@ module base(w, base_x_blocks, base_y_blocks) {
translate([0, base_y_blocks * w / 2])
scale(w)
blocks(px_circle(base_y_blocks / 2, filled = true));
blocks(vx_circle(base_y_blocks / 2, filled = true));
translate([base_x_blocks * w, base_y_blocks * w / 2])
scale(w)
blocks(px_circle(base_y_blocks / 2, filled = true));
blocks(vx_circle(base_y_blocks / 2, filled = true));
}
}

View File

@@ -1,4 +1,4 @@
use <pixel/px_gray.scad>;
use <voxel/vx_gray.scad>;
use <ptf/ptf_sphere.scad>;
photo_size = [100, 100];
@@ -106,7 +106,7 @@ levels = [
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]
];
dots = px_gray(levels, center = true, normalize = true);
dots = vx_gray(levels, center = true, normalize = true);
color("white")
for(dot = dots) {

View File

@@ -1,4 +1,4 @@
use <pixel/px_gray.scad>;
use <voxel/vx_gray.scad>;
use <stereographic_extrude.scad>;
px_width = 0.8;
@@ -107,7 +107,7 @@ levels = [
];
module shadow(levels, px_width) {
dots = px_gray(levels, center = true, normalize = true);
dots = vx_gray(levels, center = true, normalize = true);
difference() {
square(len(levels), center = true);
render() union() {

View File

@@ -1,8 +1,8 @@
use <shape_taiwan.scad>;
use <pixel/px_polyline.scad>;
use <pixel/px_sphere.scad>;
use <pixel/px_cylinder.scad>;
use <pixel/px_polygon.scad>;
use <voxel/vx_polyline.scad>;
use <voxel/vx_sphere.scad>;
use <voxel/vx_cylinder.scad>;
use <voxel/vx_polygon.scad>;
module blocks(points) {
for(pt = points) {
@@ -14,32 +14,32 @@ module blocks(points) {
// Well, quick and dirty!!
color("MediumSeaGreen")
translate([3, -5, -27])
for(pt = px_polygon([for(p = shape_taiwan(92, distance = 1)) [round(p[0]), round(p[1])]], filled = true)) {
for(pt = vx_polygon([for(p = shape_taiwan(92, distance = 1)) [round(p[0]), round(p[1])]], filled = true)) {
translate(pt)
linear_extrude(1, scale = 0.5)
square(1, center = true);
}
color(c = [0.3, 0.3, 0.3]) {
blocks(px_sphere(10));
translate([7, 0, 9]) blocks(px_sphere(3));
translate([-7, 0, 9]) blocks(px_sphere(3));
translate([0, 0, -13]) blocks(px_sphere(12));
translate([6, 0, -26]) blocks(px_cylinder([3, 4], 6));
translate([-6, 0, -26]) blocks(px_cylinder([3, 4], 6))
blocks(vx_sphere(10));
translate([7, 0, 9]) blocks(vx_sphere(3));
translate([-7, 0, 9]) blocks(vx_sphere(3));
translate([0, 0, -13]) blocks(vx_sphere(12));
translate([6, 0, -26]) blocks(vx_cylinder([3, 4], 6));
translate([-6, 0, -26]) blocks(vx_cylinder([3, 4], 6))
translate([10, 0, -13]) cube([6, 5, 10], center = true);
translate([-10, 0, -13]) cube([6, 5, 10], center = true);
}
color("white") {
translate([3, -7, 2]) blocks(px_sphere(2));
translate([-3, -7, 2]) blocks(px_sphere(2));
translate([0, -7, 0]) blocks(px_sphere(3));
translate([0, -9, -4]) blocks(px_sphere(1));
blocks(px_polyline([[0, -12, -10], [5, -9, -7], [8, -6, -6]]));
blocks(px_polyline([[0, -12, -10], [5, -9, -8], [8, -6, -7]]));
blocks(px_polyline([[0, -12, -10], [5, -9, -9], [8, -6, -8]]));
blocks(px_polyline([[0, -12, -10], [5, -9, -9], [8, -6, -8]]));
blocks(px_polyline([[0, -12, -10], [-5, -9, -7], [-8, -6, -6]]));
blocks(px_polyline([[0, -12, -10], [-5, -9, -8], [-8, -6, -7]]));
blocks(px_polyline([[0, -12, -10], [-5, -9, -9], [-8, -6, -8]]));
translate([3, -7, 2]) blocks(vx_sphere(2));
translate([-3, -7, 2]) blocks(vx_sphere(2));
translate([0, -7, 0]) blocks(vx_sphere(3));
translate([0, -9, -4]) blocks(vx_sphere(1));
blocks(vx_polyline([[0, -12, -10], [5, -9, -7], [8, -6, -6]]));
blocks(vx_polyline([[0, -12, -10], [5, -9, -8], [8, -6, -7]]));
blocks(vx_polyline([[0, -12, -10], [5, -9, -9], [8, -6, -8]]));
blocks(vx_polyline([[0, -12, -10], [5, -9, -9], [8, -6, -8]]));
blocks(vx_polyline([[0, -12, -10], [-5, -9, -7], [-8, -6, -6]]));
blocks(vx_polyline([[0, -12, -10], [-5, -9, -8], [-8, -6, -7]]));
blocks(vx_polyline([[0, -12, -10], [-5, -9, -9], [-8, -6, -8]]));
}

View File

@@ -1,4 +1,4 @@
use <pixel/px_gray.scad>;
use <voxel/vx_gray.scad>;
use <shape_taiwan.scad>;
levels = [
@@ -132,7 +132,7 @@ levels = [
[196, 188, 193, 191, 185, 194, 191, 190, 196, 191, 194, 195, 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
];
dots = px_gray(levels, center = true, invert = true, normalize = true);
dots = vx_gray(levels, center = true, invert = true, normalize = true);
linear_extrude(1.5) difference() {
translate([6.5, -10])
rotate(22.5)

View File

@@ -1,6 +1,6 @@
use <bezier_curve.scad>;
use <pixel/px_polyline.scad>;
use <pixel/px_cylinder.scad>;
use <voxel/vx_polyline.scad>;
use <voxel/vx_cylinder.scad>;
x1 = 5;
x2 = 20;
@@ -18,18 +18,18 @@ module pixel_vase(x1, x2, x3, thickness) {
[p0, p1, p2, p3, p4]
)) [round(pt[0]), round(pt[1]), round(pt[2])]];
px_path = px_polyline(rounded_points);
leng = len(px_path);
vx_path = vx_polyline(rounded_points);
leng = len(vx_path);
for(p = px_cylinder(px_path[0][0], 1, true)) {
for(p = vx_cylinder(vx_path[0][0], 1, true)) {
linear_extrude(1)
translate([p[0], p[1]])
square(1.1, center = true);
}
for(i = [0:leng - 1]) {
r = px_path[i][0];
for(p = px_cylinder(r, 1, thickness = thickness)) {
r = vx_path[i][0];
for(p = vx_cylinder(r, 1, thickness = thickness)) {
translate([0, 0, i])
linear_extrude(1)
translate([p[0], p[1]])

View File

@@ -1,5 +1,5 @@
use <hull_polyline2d.scad>;
use <pixel/px_ascii.scad>;
use <voxel/vx_ascii.scad>;
tx = "3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172";
@@ -9,7 +9,7 @@ linear_extrude(2)
translate(pts[i])
difference() {
square(7, center = true);
render() for(p = px_ascii(tx[i], center = true)) {
render() for(p = vx_ascii(tx[i], center = true)) {
translate(p) square(.8);
}
}

View File

@@ -0,0 +1,54 @@
function _vx_circle_y(f, y) = f >= 0 ? y - 1 : y;
function _vx_circle_ddf_y(f, ddf_y) = f >= 0 ? ddf_y + 2 : ddf_y;
function _vx_circle_f(f, ddf_y) = f >= 0 ? f + ddf_y : f;
function _vx_circle(f, ddf_x, ddf_y, x, y, filled) =
x >= y ? [] :
let(
ny = _vx_circle_y(f, y),
nddf_y = _vx_circle_ddf_y(f, ddf_y),
nx = x + 1,
nddf_x = ddf_x + 2,
nf = _vx_circle_f(f, ddf_y) + nddf_x
)
concat(
filled ?
concat(
[for(xi = -nx; xi <= nx; xi = xi + 1) [xi, -ny]],
[for(xi = -ny; xi <= ny; xi = xi + 1) [xi, -nx]],
[for(xi = -ny; xi <= ny; xi = xi + 1) [xi, nx]],
[for(xi = -nx; xi <= nx; xi = xi + 1) [xi, ny]]
)
:
[
[-nx, -ny], [nx, -ny],
[-ny, -nx], [ny, -nx],
[-ny, nx], [ny, nx],
[-nx, ny], [nx, ny]
],
_vx_circle(nf, nddf_x, nddf_y, nx, ny, filled)
);
function _vx_circle_impl(radius, filled) =
let(
f = 1 - radius,
ddf_x = 1,
ddf_y = -2 * radius,
x = 0,
y = radius
)
concat(
filled ?
concat(
[[0, radius], [0, -radius]],
[for(xi = -radius; xi <= radius; xi = xi + 1) [xi, 0]]
)
:
[
[0, -radius],
[-radius, 0],
[radius, 0],
[0, radius]
],
_vx_circle(f, ddf_x, ddf_y, x, y, filled)
);

View File

@@ -0,0 +1,49 @@
function _vx_cylinder_vx_circle(radius, filled, thickness) =
let(range = [-radius: radius - 1])
filled ? [
for(y = range)
for(x = range)
let(v = [x, y])
if(norm(v) < radius) v
] :
let(ishell = radius * radius - 2 * thickness * radius)
[
for(y = range)
for(x = range)
let(
v = [x, y],
leng = norm(v)
)
if(leng < radius && (leng * leng) > ishell) v
];
function _vx_cylinder_diff_r(r, h, filled, thickness) =
let(
r1 = r[0],
r2 = r[1]
)
r1 == r2 ? _vx_cylinder_same_r(r1, h, filled, thickness) :
let(dr = (r2 - r1) / (h - 1))
[
for(i = 0; i < h; i = i + 1)
let(r = round(r1 + dr * i))
each [
for(pt = _vx_cylinder_vx_circle(r, filled, thickness))
[pt[0], pt[1], i]
]
];
function _vx_cylinder_same_r(r, h, filled, thickness) =
let(c = _vx_cylinder_vx_circle(r, filled, thickness))
[
for(i = 0; i < h; i = i + 1)
each [
for(pt = c)
[pt[0], pt[1], i]
]
];
function _vx_cylinder_impl(r, h, filled, thickness) =
is_num(r) ?
_vx_cylinder_same_r(r, h, filled, thickness) :
_vx_cylinder_diff_r(r, h, filled, thickness);

View File

@@ -0,0 +1,21 @@
function _vx_from_row(r_count, row_bits, width, height, center, invert) =
let(
half_w = width / 2,
half_h = height / 2,
offset_x = center ? 0 : half_w,
offset_y = center ? -half_h : 0,
bit = invert ? 0 : 1
)
[for(i = 0; i < width; i = i + 1) if(row_bits[i] == bit) [i - half_w + offset_x, r_count + offset_y]];
function _vx_from_impl(binaries, center, invert) =
let(
width = len(binaries[0]),
height = len(binaries),
offset_i = height / 2
)
[
for(i = height - 1; i > -1; i = i - 1)
let(row = _vx_from_row(height - i - 1, binaries[i], width, height, center, invert))
if(row != []) each row
];

View File

@@ -0,0 +1,29 @@
function _vx_gray_row(r_count, row_bits, width, height, center, invert, normalize) =
let(
half_w = width / 2,
half_h = height / 2,
offset_x = center ? 0 : half_w,
offset_y = center ? -half_h : 0,
level = invert ? 0 : 255,
nmal = normalize ? 255 : 1
)
[
for(i = 0; i < width; i = i + 1)
if(row_bits[i] != level)
[
[i - half_w + offset_x, r_count + offset_y],
invert ? row_bits[i] / nmal : (255 - row_bits[i]) / nmal
]
];
function _vx_gray_impl(levels, center, invert, normalize) =
let(
width = len(levels[0]),
height = len(levels),
offset_i = height / 2
)
[
for(i = height - 1; i > -1; i = i - 1)
let(row = _vx_gray_row(height - i - 1, levels[i], width, height, center, invert, normalize))
if(row != []) each row
];

View File

@@ -0,0 +1,202 @@
use <../../__comm__/__to3d.scad>;
use <../../__comm__/__to2d.scad>;
function _vx_line_zsgn(a) = a == 0 ? a : a / abs(a);
// x-dominant
function _vx_line_xdominant_y(y, yd, sy) = yd >= 0 ? y + sy : y;
function _vx_line_xdominant_yd(yd, ax, ay) = (yd >= 0 ? yd - ax : yd) + ay;
function _vx_line_xdominant_z(z, zd, sz) = zd >= 0 ? z + sz : z;
function _vx_line_xdominant_zd(zd, ax, az) = (zd >= 0 ? zd - ax : zd) + az;
function _vx_line_xdominant(start, end, a, s) =
let(
x = start[0],
y = start[1],
z = start[2],
ax = a[0],
ay = a[1],
az = a[2],
sx = s[0],
sy = s[1],
sz = s[2],
shrx = floor(ax / 2),
yd = ay - shrx,
zd = az - shrx,
endx = end[0]
)
concat(
[start],
_vx_line_xdominant_sub(
x + sx,
_vx_line_xdominant_y(y, yd, sy),
_vx_line_xdominant_z(z, zd, sz),
endx,
a,
s,
_vx_line_xdominant_yd(yd, ax, ay),
_vx_line_xdominant_zd(zd, ax, az)
)
);
function _vx_line_xdominant_sub(x, y, z, endx, a, s, yd, zd) =
let(
ax = a[0],
ay = a[1],
az = a[2],
sx = s[0],
sy = s[1],
sz = s[2]
)
x == endx ? [] :
concat([[x, y, z]],
_vx_line_xdominant_sub(
x + sx,
_vx_line_xdominant_y(y, yd, sy),
_vx_line_xdominant_z(z, zd, sz),
endx,
a,
s,
_vx_line_xdominant_yd(yd, ax, ay),
_vx_line_xdominant_zd(zd, ax, az)
)
);
// y-dominant
function _vx_line_ydominant_x(x, xd, sx) = xd >= 0 ? x + sx : x;
function _vx_line_ydominant_xd(xd, ax, ay) = (xd >= 0 ? xd - ay : xd) + ax;
function _vx_line_ydominant_z(z, zd, sz) = zd >= 0 ? z + sz : z;
function _vx_line_ydominant_zd(zd, ay, az) = (zd >= 0 ? zd - ay : zd) + az;
function _vx_line_ydominant(start, end, a, s) =
let(
x = start[0],
y = start[1],
z = start[2],
ax = a[0],
ay = a[1],
az = a[2],
sx = s[0],
sy = s[1],
sz = s[2],
shry = floor(ay / 2),
xd = ax - shry,
zd = az - shry,
endy = end[1]
)
concat(
[start],
_vx_line_ydominant_sub(
_vx_line_ydominant_x(x, xd, sx),
y + sy,
_vx_line_ydominant_z(z, zd, sz),
endy,
a,
s,
_vx_line_ydominant_xd(xd, ax, ay),
_vx_line_ydominant_zd(zd, ay, az)
)
);
function _vx_line_ydominant_sub(x, y, z, endy, a, s, xd, zd) =
let(
ax = a[0],
ay = a[1],
az = a[2],
sx = s[0],
sy = s[1],
sz = s[2]
)
y == endy ? [] :
concat([[x, y, z]],
_vx_line_ydominant_sub(
_vx_line_ydominant_x(x, xd, sx),
y + sy,
_vx_line_ydominant_z(z, zd, sz),
endy,
a,
s,
_vx_line_ydominant_xd(xd, ax, ay),
_vx_line_ydominant_zd(zd, ay, az)
)
);
// z-dominant
function _vx_line_zdominant_x(x, xd, sx) = xd >= 0 ? x + sx : x;
function _vx_line_zdominant_xd(xd, ax, az) = (xd >= 0 ? xd - az : xd) + ax;
function _vx_line_zdominant_y(y, yd, sy) = yd >= 0 ? y + sy : y;
function _vx_line_zdominant_yd(yd, ay, az) = (yd >= 0 ? yd - az : yd) + ay;
function _vx_line_zdominant(start, end, a, s) =
let(
x = start[0],
y = start[1],
z = start[2],
ax = a[0],
ay = a[1],
az = a[2],
sx = s[0],
sy = s[1],
sz = s[2],
shrz = floor(az / 2),
xd = ax - shrz,
yd = ay - shrz,
endz = end[2]
)
concat(
[start],
_vx_line_zdominant_sub(
_vx_line_zdominant_x(x, xd, sx),
_vx_line_zdominant_y(y, yd, sy),
z + sz,
endz,
a,
s,
_vx_line_zdominant_xd(xd, ax, az),
_vx_line_zdominant_yd(yd, ay, az)
)
);
function _vx_line_zdominant_sub(x, y, z, endz, a, s, xd, yd) =
let(
ax = a[0],
ay = a[1],
az = a[2],
sx = s[0],
sy = s[1],
sz = s[2]
)
z == endz ? [] :
concat([[x, y, z]],
_vx_line_zdominant_sub(
_vx_line_zdominant_x(x, xd, sx),
_vx_line_zdominant_y(y, yd, sy),
z + sz,
endz,
a,
s,
_vx_line_zdominant_xd(xd, ax, az),
_vx_line_zdominant_yd(yd, ay, az)
)
);
function _vx_line_impl(p1, p2) =
let(
is_2d = len(p1) == 2,
start_pt = is_2d ? __to3d(p1) : p1,
end_pt = is_2d ? __to3d(p2) : p2,
dt = end_pt - start_pt,
ax = floor(abs(dt[0]) * 2),
ay = floor(abs(dt[1]) * 2),
az = floor(abs(dt[2]) * 2),
sx = _vx_line_zsgn(dt[0]),
sy = _vx_line_zsgn(dt[1]),
sz = _vx_line_zsgn(dt[2]),
points = ax >= max(ay, az) ? _vx_line_xdominant(start_pt, end_pt, [ax, ay, az], [sx, sy, sz]) : (
ay >= max(ax, az) ? _vx_line_ydominant(start_pt, end_pt, [ax, ay, az], [sx, sy, sz]) :
_vx_line_zdominant(start_pt, end_pt, [ax, ay, az], [sx, sy, sz])
)
)
is_2d ? [for(pt = points) __to2d(pt)] : points;

971
src/voxel/vx_ascii.scad Normal file
View File

@@ -0,0 +1,971 @@
/**
* vx_ascii.scad
*
* @copyright Justin Lin, 2020
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-vx_ascii.html
*
**/
use <vx_from.scad>;
function vx_ascii(char, center = false, invert = false) =
let(code = ord(char))
assert(code > 31 && code < 127, "not printable character")
let(
idx = code - 32,
binaries = [
[// " "
[0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0]
],
[// "!"
[0,0,0,0,0,0,0,0],
[0,0,0,0,1,0,0,0],
[0,0,0,0,1,0,0,0],
[0,0,0,0,1,0,0,0],
[0,0,0,0,1,0,0,0],
[0,0,0,0,0,0,0,0],
[0,0,0,0,1,0,0,0],
[0,0,0,0,0,0,0,0]
],
[// "\""
[0,0,0,0,0,0,0,0],
[0,0,0,1,0,1,0,0],
[0,0,0,1,0,1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,0,0,0]
],
[// "z"
[0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0],
[0,1,1,1,1,1,1,0],
[0,0,0,0,1,1,0,0],
[0,0,0,1,1,0,0,0],
[0,0,1,1,0,0,0,0],
[0,1,1,1,1,1,1,0],
[0,0,0,0,0,0,0,0]
],
[// "{"
[0,0,0,0,0,0,0,0],
[0,0,0,1,1,1,0,0],
[0,0,1,1,0,0,0,0],
[0,1,1,1,0,0,0,0],
[0,1,1,1,0,0,0,0],
[0,0,1,1,0,0,0,0],
[0,0,0,1,1,1,0,0],
[0,0,0,0,0,0,0,0]
],
[// "|"
[0,0,0,0,0,0,0,0],
[0,0,0,1,1,0,0,0],
[0,0,0,1,1,0,0,0],
[0,0,0,1,1,0,0,0],
[0,0,0,1,1,0,0,0],
[0,0,0,1,1,0,0,0],
[0,0,0,1,1,0,0,0],
[0,0,0,0,0,0,0,0]
],
[// "}"
[0,0,0,0,0,0,0,0],
[0,0,1,1,1,0,0,0],
[0,0,0,0,1,1,0,0],
[0,0,0,0,1,1,1,0],
[0,0,0,0,1,1,1,0],
[0,0,0,0,1,1,0,0],
[0,0,1,1,1,0,0,0],
[0,0,0,0,0,0,0,0]
],
[// "~"
[0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0],
[0,0,1,1,0,0,0,0],
[0,1,0,1,1,0,1,0],
[0,0,0,0,1,1,0,0],
[0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0]
]
]
)
vx_from(binaries[idx], center = center, invert = invert);

17
src/voxel/vx_circle.scad Normal file
View File

@@ -0,0 +1,17 @@
/**
* vx_circle.scad
*
* @copyright Justin Lin, 2020
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-vx_circle.html
*
**/
use <_impl/_vx_circle_impl.scad>;
use <../util/sort.scad>;
use <../util/dedup.scad>;
function vx_circle(radius, filled = false) =
let(all = _vx_circle_impl(radius, filled))
dedup(sort(all, by = "vt"), sorted = true);

View File

@@ -0,0 +1,17 @@
/**
* vx_cylinder.scad
*
* @copyright Justin Lin, 2020
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-vx_cylinder.html
*
**/
use <_impl/_vx_cylinder_impl.scad>;
use <../util/sort.scad>;
use <../util/dedup.scad>;
function vx_cylinder(r, h, filled = false, thickness = 1) =
let(all = _vx_cylinder_impl(r, h, filled, thickness))
dedup(sort(all, by = "vt"), sorted = true);

View File

@@ -0,0 +1,6 @@
use <../util/sort.scad>;
use <../util/has.scad>;
function vx_difference(points1, points2) =
let(sorted = sort(points2, by = "vt"))
[for(p = points1) if(!has(sorted, p, sorted = true)) p];

13
src/voxel/vx_from.scad Normal file
View File

@@ -0,0 +1,13 @@
/**
* vx_from.scad
*
* @copyright Justin Lin, 2020
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-vx_from.html
*
**/
use <_impl/_vx_from_impl.scad>;
function vx_from(binaries, center = false, invert = false) = _vx_from_impl(binaries, center, invert);

14
src/voxel/vx_gray.scad Normal file
View File

@@ -0,0 +1,14 @@
/**
* vx_gray.scad
*
* @copyright Justin Lin, 2020
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-vx_gray.html
*
**/
use <_impl/_vx_gray_impl.scad>;
function vx_gray(levels, center = false, invert = false, normalize = false) =
_vx_gray_impl(levels, center, invert, normalize);

View File

@@ -0,0 +1,11 @@
use <../util/sort.scad>;
use <../util/has.scad>;
function vx_intersection(points1, points2) =
let(
leng1 = len(points1),
leng2 = len(points2),
pts_pair = leng1 > leng2 ? [points1, points2] : [points2, points1],
sorted = sort(pts_pair[1], by = "vt")
)
[for(p = pts_pair[0]) if(has(sorted, p, sorted = true)) p];

13
src/voxel/vx_line.scad Normal file
View File

@@ -0,0 +1,13 @@
/**
* vx_line.scad
*
* @copyright Justin Lin, 2020
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-vx_line.html
*
**/
use <_impl/_vx_line_impl.scad>;
function vx_line(p1, p2) = _vx_line_impl(p1, p2);

31
src/voxel/vx_polygon.scad Normal file
View File

@@ -0,0 +1,31 @@
use <../in_shape.scad>;
use <../util/sort.scad>;
use <../util/dedup.scad>;
use <vx_polyline.scad>;
function vx_polygon(points, filled = false) =
let(contour = vx_polyline(concat(points, [points[0]])))
!filled ? contour :
let(
sortedXY = sort(contour, by = "vt"),
ys = [for(p = sortedXY) p[1]],
rows = [
for(y = [min(ys):max(ys)])
let(
idxes = search(y, sortedXY, num_returns_per_match = 0, index_col_num = 1)
)
[for(i = idxes) sortedXY[i]]
],
all = concat(
sortedXY,
[
for(row = rows)
let(to = len(row) - 1, y = row[0][1])
if(to > 0 && (row[0][0] + 1 != row[to][0]))
for(i = [row[0][0] + 1:row[to][0] - 1])
let(p = [i, y])
if(in_shape(points, p)) p
]
)
)
dedup(sort(all, by = "vt"), sorted = true);

View File

@@ -0,0 +1,28 @@
/**
* vx_polyline.scad
*
* @copyright Justin Lin, 2020
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-vx_polyline.html
*
**/
use <../__comm__/__to3d.scad>;
use <../__comm__/__to2d.scad>;
use <../__comm__/__lines_from.scad>;
use <../util/sort.scad>;
use <../util/dedup.scad>;
use <vx_line.scad>;
function vx_polyline(points) =
let(
is_2d = len(points[0]) == 2,
pts = is_2d ? [for(pt = points) __to3d(pt)] : points,
polyline = [for(line = __lines_from(pts)) each vx_line(line[0], line[1])]
)
dedup(is_2d ?
sort([for(pt = polyline) __to2d(pt)], by = "vt")
:
sort(polyline, by = "vt")
, sorted = true);

31
src/voxel/vx_sphere.scad Normal file
View File

@@ -0,0 +1,31 @@
/**
* vx_sphere.scad
*
* @copyright Justin Lin, 2020
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-vx_sphere.html
*
**/
function vx_sphere(radius, filled = false, thickness = 1) =
let(range = [-radius: radius - 1])
filled ? [
for(z = range)
for(y = range)
for(x = range)
let(v = [x, y, z])
if(norm(v) < radius) v
] :
let(ishell = radius * radius - 2 * thickness * radius)
[
for(z = range)
for(y = range)
for(x = range)
let(
v = [x, y, z],
leng = norm(v)
)
if(leng < radius && (leng * leng) > ishell) v
];

8
src/voxel/vx_union.scad Normal file
View File

@@ -0,0 +1,8 @@
use <../util/sort.scad>;
use <../util/dedup.scad>;
function vx_union(points1, points2) =
dedup(
sort(concat(points1, points2), by = "vt"),
sorted = true
);

View File

@@ -69,13 +69,13 @@ include <util/test_sort.scad>;
include <util/test_reverse.scad>;
include <util/test_fibseq.scad>;
// Pixel
include <pixel/test_px_line.scad>;
include <pixel/test_px_polyline.scad>;
include <pixel/test_px_circle.scad>;
include <pixel/test_px_cylinder.scad>;
include <pixel/test_px_sphere.scad>;
include <pixel/test_px_polygon.scad>;
// Voxel
include <voxel/test_vx_line.scad>;
include <voxel/test_vx_polyline.scad>;
include <voxel/test_vx_circle.scad>;
include <voxel/test_vx_cylinder.scad>;
include <voxel/test_vx_sphere.scad>;
include <voxel/test_vx_polygon.scad>;
// Matrix
include <matrix/test_m_cumulate.scad>;

View File

@@ -1,13 +1,13 @@
use <unittest.scad>;
use <pixel/px_circle.scad>;
use <voxel/vx_circle.scad>;
module test_px_circle() {
echo("==== test_px_circle ====");
module test_vx_circle() {
echo("==== test_vx_circle ====");
expected = [[-3, -10], [-2, -10], [-1, -10], [0, -10], [1, -10], [2, -10], [3, -10], [-5, -9], [-4, -9], [-3, -9], [-2, -9], [-1, -9], [0, -9], [1, -9], [2, -9], [3, -9], [4, -9], [5, -9], [-6, -8], [-5, -8], [-4, -8], [-3, -8], [-2, -8], [-1, -8], [0, -8], [1, -8], [2, -8], [3, -8], [4, -8], [5, -8], [6, -8], [-7, -7], [-6, -7], [-5, -7], [-4, -7], [-3, -7], [-2, -7], [-1, -7], [0, -7], [1, -7], [2, -7], [3, -7], [4, -7], [5, -7], [6, -7], [7, -7], [-8, -6], [-7, -6], [-6, -6], [-5, -6], [-4, -6], [-3, -6], [-2, -6], [-1, -6], [0, -6], [1, -6], [2, -6], [3, -6], [4, -6], [5, -6], [6, -6], [7, -6], [8, -6], [-9, -5], [-8, -5], [-7, -5], [-6, -5], [-5, -5], [-4, -5], [-3, -5], [-2, -5], [-1, -5], [0, -5], [1, -5], [2, -5], [3, -5], [4, -5], [5, -5], [6, -5], [7, -5], [8, -5], [9, -5], [-9, -4], [-8, -4], [-7, -4], [-6, -4], [-5, -4], [-4, -4], [-3, -4], [-2, -4], [-1, -4], [0, -4], [1, -4], [2, -4], [3, -4], [4, -4], [5, -4], [6, -4], [7, -4], [8, -4], [9, -4], [-10, -3], [-9, -3], [-8, -3], [-7, -3], [-6, -3], [-5, -3], [-4, -3], [-3, -3], [-2, -3], [-1, -3], [0, -3], [1, -3], [2, -3], [3, -3], [4, -3], [5, -3], [6, -3], [7, -3], [8, -3], [9, -3], [10, -3], [-10, -2], [-9, -2], [-8, -2], [-7, -2], [-6, -2], [-5, -2], [-4, -2], [-3, -2], [-2, -2], [-1, -2], [0, -2], [1, -2], [2, -2], [3, -2], [4, -2], [5, -2], [6, -2], [7, -2], [8, -2], [9, -2], [10, -2], [-10, -1], [-9, -1], [-8, -1], [-7, -1], [-6, -1], [-5, -1], [-4, -1], [-3, -1], [-2, -1], [-1, -1], [0, -1], [1, -1], [2, -1], [3, -1], [4, -1], [5, -1], [6, -1], [7, -1], [8, -1], [9, -1], [10, -1], [-10, 0], [-9, 0], [-8, 0], [-7, 0], [-6, 0], [-5, 0], [-4, 0], [-3, 0], [-2, 0], [-1, 0], [0, 0], [1, 0], [2, 0], [3, 0], [4, 0], [5, 0], [6, 0], [7, 0], [8, 0], [9, 0], [10, 0], [-10, 1], [-9, 1], [-8, 1], [-7, 1], [-6, 1], [-5, 1], [-4, 1], [-3, 1], [-2, 1], [-1, 1], [0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1], [8, 1], [9, 1], [10, 1], [-10, 2], [-9, 2], [-8, 2], [-7, 2], [-6, 2], [-5, 2], [-4, 2], [-3, 2], [-2, 2], [-1, 2], [0, 2], [1, 2], [2, 2], [3, 2], [4, 2], [5, 2], [6, 2], [7, 2], [8, 2], [9, 2], [10, 2], [-10, 3], [-9, 3], [-8, 3], [-7, 3], [-6, 3], [-5, 3], [-4, 3], [-3, 3], [-2, 3], [-1, 3], [0, 3], [1, 3], [2, 3], [3, 3], [4, 3], [5, 3], [6, 3], [7, 3], [8, 3], [9, 3], [10, 3], [-9, 4], [-8, 4], [-7, 4], [-6, 4], [-5, 4], [-4, 4], [-3, 4], [-2, 4], [-1, 4], [0, 4], [1, 4], [2, 4], [3, 4], [4, 4], [5, 4], [6, 4], [7, 4], [8, 4], [9, 4], [-9, 5], [-8, 5], [-7, 5], [-6, 5], [-5, 5], [-4, 5], [-3, 5], [-2, 5], [-1, 5], [0, 5], [1, 5], [2, 5], [3, 5], [4, 5], [5, 5], [6, 5], [7, 5], [8, 5], [9, 5], [-8, 6], [-7, 6], [-6, 6], [-5, 6], [-4, 6], [-3, 6], [-2, 6], [-1, 6], [0, 6], [1, 6], [2, 6], [3, 6], [4, 6], [5, 6], [6, 6], [7, 6], [8, 6], [-7, 7], [-6, 7], [-5, 7], [-4, 7], [-3, 7], [-2, 7], [-1, 7], [0, 7], [1, 7], [2, 7], [3, 7], [4, 7], [5, 7], [6, 7], [7, 7], [-6, 8], [-5, 8], [-4, 8], [-3, 8], [-2, 8], [-1, 8], [0, 8], [1, 8], [2, 8], [3, 8], [4, 8], [5, 8], [6, 8], [-5, 9], [-4, 9], [-3, 9], [-2, 9], [-1, 9], [0, 9], [1, 9], [2, 9], [3, 9], [4, 9], [5, 9], [-3, 10], [-2, 10], [-1, 10], [0, 10], [1, 10], [2, 10], [3, 10]];
actual = px_circle(10, true);
actual = vx_circle(10, true);
assertEqualPoints(expected, actual);
}
test_px_circle();
test_vx_circle();

File diff suppressed because one or more lines are too long

View File

@@ -1,13 +1,13 @@
use <unittest.scad>;
use <pixel/px_line.scad>;
use <voxel/vx_line.scad>;
module test_px_line() {
echo("==== test_px_line ====");
module test_vx_line() {
echo("==== test_vx_line ====");
expected = [[-10, 0, -10], [-9, 1, -10], [-9, 2, -9], [-8, 3, -9], [-8, 4, -8], [-7, 5, -8], [-6, 6, -8], [-6, 7, -7], [-5, 8, -7], [-5, 9, -6], [-4, 10, -6], [-3, 11, -6], [-3, 12, -5], [-2, 13, -5], [-2, 14, -4], [-1, 15, -4], [0, 16, -4], [0, 17, -3], [1, 18, -3], [1, 19, -2], [2, 20, -2], [3, 21, -2], [3, 22, -1], [4, 23, -1], [4, 24, 0], [5, 25, 0], [6, 26, 0], [6, 27, 1], [7, 28, 1], [7, 29, 2], [8, 30, 2], [9, 31, 2], [9, 32, 3], [10, 33, 3], [10, 34, 4], [11, 35, 4], [12, 36, 4], [12, 37, 5], [13, 38, 5], [13, 39, 6], [14, 40, 6], [15, 41, 6], [15, 42, 7], [16, 43, 7], [16, 44, 8], [17, 45, 8], [18, 46, 8], [18, 47, 9], [19, 48, 9], [19, 49, 10]];
actual = px_line([-10, 0, -10], [20, 50, 10]);
actual = vx_line([-10, 0, -10], [20, 50, 10]);
assertEqualPoints(expected, actual);
}
test_px_line();
test_vx_line();

View File

@@ -1,17 +1,17 @@
use <unittest.scad>;
use <pixel/px_polygon.scad>;
use <voxel/vx_polygon.scad>;
module test_px_polygon() {
echo("==== test_px_polygon ====");
module test_vx_polygon() {
echo("==== test_vx_polygon ====");
expected = [[-5, -10], [-5, -9], [-4, -9], [-6, -8], [-4, -8], [-6, -7], [-3, -7], [-6, -6], [-3, -6], [-7, -5], [-2, -5], [-7, -4], [-2, -4], [-7, -3], [-1, -3], [-8, -2], [-1, -2], [-8, -1], [0, -1], [-8, 0], [0, 0], [-9, 1], [1, 1], [-9, 2], [1, 2], [-9, 3], [2, 3], [-10, 4], [2, 4], [-10, 5], [-9, 5], [3, 5], [-8, 6], [-7, 6], [-6, 6], [3, 6], [-5, 7], [-4, 7], [-3, 7], [4, 7], [-2, 8], [-1, 8], [0, 8], [4, 8], [1, 9], [2, 9], [3, 9], [5, 9], [4, 10], [5, 10]];
actual = px_polygon([[5, 10], [-10, 5], [-5, -10]], false);
actual = vx_polygon([[5, 10], [-10, 5], [-5, -10]], false);
assertEqualPoints(expected, actual);
expected2 = [[-5, -10], [-5, -9], [-4, -9], [-6, -8], [-5, -8], [-4, -8], [-6, -7], [-5, -7], [-4, -7], [-3, -7], [-6, -6], [-5, -6], [-4, -6], [-3, -6], [-7, -5], [-6, -5], [-5, -5], [-4, -5], [-3, -5], [-2, -5], [-7, -4], [-6, -4], [-5, -4], [-4, -4], [-3, -4], [-2, -4], [-7, -3], [-6, -3], [-5, -3], [-4, -3], [-3, -3], [-2, -3], [-1, -3], [-8, -2], [-7, -2], [-6, -2], [-5, -2], [-4, -2], [-3, -2], [-2, -2], [-1, -2], [-8, -1], [-7, -1], [-6, -1], [-5, -1], [-4, -1], [-3, -1], [-2, -1], [-1, -1], [0, -1], [-8, 0], [-7, 0], [-6, 0], [-5, 0], [-4, 0], [-3, 0], [-2, 0], [-1, 0], [0, 0], [-9, 1], [-8, 1], [-7, 1], [-6, 1], [-5, 1], [-4, 1], [-3, 1], [-2, 1], [-1, 1], [0, 1], [1, 1], [-9, 2], [-8, 2], [-7, 2], [-6, 2], [-5, 2], [-4, 2], [-3, 2], [-2, 2], [-1, 2], [0, 2], [1, 2], [-9, 3], [-8, 3], [-7, 3], [-6, 3], [-5, 3], [-4, 3], [-3, 3], [-2, 3], [-1, 3], [0, 3], [1, 3], [2, 3], [-10, 4], [-9, 4], [-8, 4], [-7, 4], [-6, 4], [-5, 4], [-4, 4], [-3, 4], [-2, 4], [-1, 4], [0, 4], [1, 4], [2, 4], [-10, 5], [-9, 5], [-8, 5], [-7, 5], [-6, 5], [-5, 5], [-4, 5], [-3, 5], [-2, 5], [-1, 5], [0, 5], [1, 5], [2, 5], [3, 5], [-8, 6], [-7, 6], [-6, 6], [-5, 6], [-4, 6], [-3, 6], [-2, 6], [-1, 6], [0, 6], [1, 6], [2, 6], [3, 6], [-5, 7], [-4, 7], [-3, 7], [-2, 7], [-1, 7], [0, 7], [1, 7], [2, 7], [3, 7], [4, 7], [-2, 8], [-1, 8], [0, 8], [1, 8], [2, 8], [3, 8], [4, 8], [1, 9], [2, 9], [3, 9], [4, 9], [5, 9], [4, 10], [5, 10]];
actual2 = px_polygon([[5, 10], [-10, 5], [-5, -10]], true);
actual2 = vx_polygon([[5, 10], [-10, 5], [-5, -10]], true);
assertEqualPoints(expected2, actual2);
}
test_px_polygon();
test_vx_polygon();

View File

@@ -1,13 +1,13 @@
use <unittest.scad>;
use <pixel/px_polyline.scad>;
use <voxel/vx_polyline.scad>;
module test_px_polyline() {
echo("==== test_px_polyline ====");
module test_vx_polyline() {
echo("==== test_vx_polyline ====");
expected = [[3, 8, 5], [4, 9, 5], [5, 10, 5], [-3, 2, 6], [-2, 3, 6], [-1, 4, 6], [0, 5, 6], [1, 6, 6], [2, 7, 6], [-9, -4, 7], [-8, -3, 7], [-7, -2, 7], [-6, -1, 7], [-5, 0, 7], [-4, 1, 7], [-15, -10, 8], [-14, -9, 8], [-13, -8, 8], [-12, -7, 8], [-11, -6, 8], [-10, -5, 8], [-21, -16, 9], [-20, -15, 9], [-19, -14, 9], [-18, -13, 9], [-17, -12, 9], [-16, -11, 9], [-25, -20, 10], [-25, -19, 10], [-24, -19, 10], [-25, -18, 10], [-23, -18, 10], [-25, -17, 10], [-22, -17, 10], [-25, -16, 11], [-25, -15, 11], [-25, -14, 11], [-25, -13, 11], [-25, -12, 11], [-25, -11, 11], [-25, -10, 11], [-25, -9, 12], [-25, -8, 12], [-25, -7, 12], [-25, -6, 12], [-25, -5, 12], [-25, -4, 12], [-25, -3, 12], [-25, -2, 13], [-25, -1, 13], [-25, 0, 13], [-25, 1, 13], [-25, 2, 13], [-25, 3, 13], [-25, 4, 13], [-25, 5, 14], [-25, 6, 14], [-25, 7, 14], [-25, 8, 14], [-25, 9, 14], [-25, 10, 14], [-25, 11, 14], [-25, 12, 15], [-25, 13, 15], [-25, 14, 15], [-25, 15, 15], [-24, 15, 15], [-23, 15, 15], [-22, 16, 15], [-21, 16, 15], [-20, 16, 16], [-19, 16, 16], [-18, 16, 16], [-17, 17, 16], [-16, 17, 16], [-15, 17, 16], [-14, 17, 16], [-13, 17, 16], [-12, 18, 16], [-11, 18, 16], [-10, 18, 17], [-9, 18, 17], [-8, 18, 17], [-7, 19, 17], [-6, 19, 17], [-5, 19, 17], [-4, 19, 17], [-3, 19, 17], [-2, 20, 17], [-1, 20, 17], [0, 20, 18], [1, 20, 18], [2, 20, 18], [3, 21, 18], [4, 21, 18], [5, 21, 18], [6, 21, 18], [7, 21, 18], [8, 22, 18], [9, 22, 18], [10, 22, 19], [11, 22, 19], [12, 22, 19], [13, 23, 19], [14, 23, 19], [15, 23, 19], [16, 23, 19], [17, 23, 19], [18, 24, 19], [19, 24, 19], [20, 24, 20], [21, 24, 20], [22, 24, 20], [23, 25, 20], [24, 25, 20]];
actual = px_polyline([[5, 10, 5], [-25, -20, 10], [-25, 15, 15], [25, 25, 20]]);
actual = vx_polyline([[5, 10, 5], [-25, -20, 10], [-25, 15, 15], [25, 25, 20]]);
assertEqualPoints(expected, actual);
}
test_px_polyline();
test_vx_polyline();

View File

@@ -1,13 +1,13 @@
use <unittest.scad>;
use <pixel/px_sphere.scad>;
use <voxel/vx_sphere.scad>;
module test_px_sphere() {
echo("==== test_px_sphere ====");
module test_vx_sphere() {
echo("==== test_vx_sphere ====");
expected = [[-2, -2, -4], [-1, -2, -4], [0, -2, -4], [1, -2, -4], [2, -2, -4], [-2, -1, -4], [-1, -1, -4], [0, -1, -4], [1, -1, -4], [2, -1, -4], [-2, 0, -4], [-1, 0, -4], [0, 0, -4], [1, 0, -4], [2, 0, -4], [-2, 1, -4], [-1, 1, -4], [0, 1, -4], [1, 1, -4], [2, 1, -4], [-2, 2, -4], [-1, 2, -4], [0, 2, -4], [1, 2, -4], [2, 2, -4], [-2, -3, -3], [-1, -3, -3], [0, -3, -3], [1, -3, -3], [2, -3, -3], [-3, -2, -3], [-2, -2, -3], [2, -2, -3], [3, -2, -3], [-3, -1, -3], [3, -1, -3], [-3, 0, -3], [3, 0, -3], [-3, 1, -3], [3, 1, -3], [-3, 2, -3], [-2, 2, -3], [2, 2, -3], [3, 2, -3], [-2, 3, -3], [-1, 3, -3], [0, 3, -3], [1, 3, -3], [2, 3, -3], [-2, -4, -2], [-1, -4, -2], [0, -4, -2], [1, -4, -2], [2, -4, -2], [-3, -3, -2], [-2, -3, -2], [2, -3, -2], [3, -3, -2], [-4, -2, -2], [-3, -2, -2], [3, -2, -2], [4, -2, -2], [-4, -1, -2], [4, -1, -2], [-4, 0, -2], [4, 0, -2], [-4, 1, -2], [4, 1, -2], [-4, 2, -2], [-3, 2, -2], [3, 2, -2], [4, 2, -2], [-3, 3, -2], [-2, 3, -2], [2, 3, -2], [3, 3, -2], [-2, 4, -2], [-1, 4, -2], [0, 4, -2], [1, 4, -2], [2, 4, -2], [-2, -4, -1], [-1, -4, -1], [0, -4, -1], [1, -4, -1], [2, -4, -1], [-3, -3, -1], [3, -3, -1], [-4, -2, -1], [4, -2, -1], [-4, -1, -1], [4, -1, -1], [-4, 0, -1], [4, 0, -1], [-4, 1, -1], [4, 1, -1], [-4, 2, -1], [4, 2, -1], [-3, 3, -1], [3, 3, -1], [-2, 4, -1], [-1, 4, -1], [0, 4, -1], [1, 4, -1], [2, 4, -1], [-2, -4, 0], [-1, -4, 0], [0, -4, 0], [1, -4, 0], [2, -4, 0], [-3, -3, 0], [3, -3, 0], [-4, -2, 0], [4, -2, 0], [-4, -1, 0], [4, -1, 0], [-4, 0, 0], [4, 0, 0], [-4, 1, 0], [4, 1, 0], [-4, 2, 0], [4, 2, 0], [-3, 3, 0], [3, 3, 0], [-2, 4, 0], [-1, 4, 0], [0, 4, 0], [1, 4, 0], [2, 4, 0], [-2, -4, 1], [-1, -4, 1], [0, -4, 1], [1, -4, 1], [2, -4, 1], [-3, -3, 1], [3, -3, 1], [-4, -2, 1], [4, -2, 1], [-4, -1, 1], [4, -1, 1], [-4, 0, 1], [4, 0, 1], [-4, 1, 1], [4, 1, 1], [-4, 2, 1], [4, 2, 1], [-3, 3, 1], [3, 3, 1], [-2, 4, 1], [-1, 4, 1], [0, 4, 1], [1, 4, 1], [2, 4, 1], [-2, -4, 2], [-1, -4, 2], [0, -4, 2], [1, -4, 2], [2, -4, 2], [-3, -3, 2], [-2, -3, 2], [2, -3, 2], [3, -3, 2], [-4, -2, 2], [-3, -2, 2], [3, -2, 2], [4, -2, 2], [-4, -1, 2], [4, -1, 2], [-4, 0, 2], [4, 0, 2], [-4, 1, 2], [4, 1, 2], [-4, 2, 2], [-3, 2, 2], [3, 2, 2], [4, 2, 2], [-3, 3, 2], [-2, 3, 2], [2, 3, 2], [3, 3, 2], [-2, 4, 2], [-1, 4, 2], [0, 4, 2], [1, 4, 2], [2, 4, 2], [-2, -3, 3], [-1, -3, 3], [0, -3, 3], [1, -3, 3], [2, -3, 3], [-3, -2, 3], [-2, -2, 3], [2, -2, 3], [3, -2, 3], [-3, -1, 3], [3, -1, 3], [-3, 0, 3], [3, 0, 3], [-3, 1, 3], [3, 1, 3], [-3, 2, 3], [-2, 2, 3], [2, 2, 3], [3, 2, 3], [-2, 3, 3], [-1, 3, 3], [0, 3, 3], [1, 3, 3], [2, 3, 3], [-2, -2, 4], [-1, -2, 4], [0, -2, 4], [1, -2, 4], [2, -2, 4], [-2, -1, 4], [-1, -1, 4], [0, -1, 4], [1, -1, 4], [2, -1, 4], [-2, 0, 4], [-1, 0, 4], [0, 0, 4], [1, 0, 4], [2, 0, 4], [-2, 1, 4], [-1, 1, 4], [0, 1, 4], [1, 1, 4], [2, 1, 4], [-2, 2, 4], [-1, 2, 4], [0, 2, 4], [1, 2, 4], [2, 2, 4]];
actual = px_sphere(5, false);
actual = vx_sphere(5, false);
assertEqualPoints(expected, actual);
}
test_px_sphere();
test_vx_sphere();