mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-05 22:37:35 +02:00
clean deprecated modules/functions
This commit is contained in:
@@ -1,22 +0,0 @@
|
|||||||
use <../util/reverse.scad>;
|
|
||||||
|
|
||||||
function __polytransversals(transversals) =
|
|
||||||
let(
|
|
||||||
leng_trs = len(transversals),
|
|
||||||
leng_tr = len(transversals[0]),
|
|
||||||
lefts = [
|
|
||||||
for(i = 1; i < leng_trs - 1; i = i + 1)
|
|
||||||
let(tr = transversals[leng_trs - i])
|
|
||||||
tr[0]
|
|
||||||
],
|
|
||||||
rights = [
|
|
||||||
for(i = 1; i < leng_trs - 1; i = i + 1)
|
|
||||||
let(tr = transversals[i])
|
|
||||||
tr[leng_tr - 1]
|
|
||||||
]
|
|
||||||
) concat(
|
|
||||||
transversals[0],
|
|
||||||
rights,
|
|
||||||
reverse(transversals[leng_trs - 1]),
|
|
||||||
lefts
|
|
||||||
);
|
|
@@ -1,66 +0,0 @@
|
|||||||
use <../ptf/ptf_rotate.scad>;
|
|
||||||
use <../shape_pie.scad>;
|
|
||||||
use <../bezier_curve.scad>;
|
|
||||||
|
|
||||||
function _glued2circles_pie_curve(radius, centre_dist, tangent_angle) =
|
|
||||||
let(
|
|
||||||
begin_ang = 90 + tangent_angle,
|
|
||||||
shape_pts = shape_pie(radius, [-begin_ang, begin_ang]),
|
|
||||||
leng = len(shape_pts)
|
|
||||||
)
|
|
||||||
[
|
|
||||||
for(i = 1; i < leng; i = i + 1)
|
|
||||||
shape_pts[i] + [centre_dist / 2, 0]
|
|
||||||
];
|
|
||||||
|
|
||||||
function _glued2circles_bezier(radius, centre_dist, tangent_angle, t_step, ctrl_p1) =
|
|
||||||
let(
|
|
||||||
ctrl_p = ptf_rotate([radius * tan(tangent_angle), -radius], tangent_angle),
|
|
||||||
ctrl_p2 = [-ctrl_p[0], ctrl_p[1]] + [centre_dist / 2, 0],
|
|
||||||
ctrl_p3 = [-ctrl_p2[0], ctrl_p2[1]],
|
|
||||||
ctrl_p4 = [-ctrl_p1[0], ctrl_p1[1]]
|
|
||||||
)
|
|
||||||
bezier_curve(
|
|
||||||
t_step,
|
|
||||||
[
|
|
||||||
ctrl_p1,
|
|
||||||
ctrl_p2,
|
|
||||||
ctrl_p3,
|
|
||||||
ctrl_p4
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
function _glued2circles_lower_half_curve(curve_pts, leng) =
|
|
||||||
[
|
|
||||||
for(i = 0; i < leng; i = i + 1)
|
|
||||||
let(p = curve_pts[leng - 1 - i])
|
|
||||||
if(p[0] >= 0) p
|
|
||||||
];
|
|
||||||
|
|
||||||
function _glued2circles_half_glued_circle(radius, centre_dist, tangent_angle, t_step) =
|
|
||||||
let(
|
|
||||||
pie_curve_pts = _glued2circles_pie_curve(radius, centre_dist, tangent_angle),
|
|
||||||
curve_pts = _glued2circles_bezier(radius, centre_dist, tangent_angle, t_step, pie_curve_pts[0]),
|
|
||||||
lower_curve_pts = _glued2circles_lower_half_curve(curve_pts, len(curve_pts)),
|
|
||||||
leng_half_curve_pts = len(lower_curve_pts),
|
|
||||||
upper_curve_pts = [
|
|
||||||
for(i = 0; i < leng_half_curve_pts; i = i + 1)
|
|
||||||
let(pt = lower_curve_pts[leng_half_curve_pts - 1 - i])
|
|
||||||
[pt[0], -pt[1]]
|
|
||||||
]
|
|
||||||
) concat(
|
|
||||||
lower_curve_pts,
|
|
||||||
pie_curve_pts,
|
|
||||||
upper_curve_pts
|
|
||||||
);
|
|
||||||
|
|
||||||
function _shape_glued2circles_impl(radius, centre_dist, tangent_angle, t_step) =
|
|
||||||
let(
|
|
||||||
half_glued_circles = _glued2circles_half_glued_circle(radius, centre_dist, tangent_angle, t_step),
|
|
||||||
leng_half_glued_circles = len(half_glued_circles),
|
|
||||||
left_half_glued_circles = [
|
|
||||||
for(i = 0; i < leng_half_glued_circles; i = i + 1)
|
|
||||||
let(pt = half_glued_circles[leng_half_glued_circles - 1 - i])
|
|
||||||
[-pt[0], pt[1]]
|
|
||||||
]
|
|
||||||
) concat(half_glued_circles, left_half_glued_circles);
|
|
@@ -1,6 +1,27 @@
|
|||||||
use <../__comm__/__to3d.scad>;
|
use <../__comm__/__to3d.scad>;
|
||||||
use <../__comm__/__polytransversals.scad>;
|
|
||||||
use <../ptf/ptf_rotate.scad>;
|
use <../ptf/ptf_rotate.scad>;
|
||||||
|
use <../util/reverse.scad>;
|
||||||
|
|
||||||
|
function __polytransversals(transversals) =
|
||||||
|
let(
|
||||||
|
leng_trs = len(transversals),
|
||||||
|
leng_tr = len(transversals[0]),
|
||||||
|
lefts = [
|
||||||
|
for(i = 1; i < leng_trs - 1; i = i + 1)
|
||||||
|
let(tr = transversals[leng_trs - i])
|
||||||
|
tr[0]
|
||||||
|
],
|
||||||
|
rights = [
|
||||||
|
for(i = 1; i < leng_trs - 1; i = i + 1)
|
||||||
|
let(tr = transversals[i])
|
||||||
|
tr[leng_tr - 1]
|
||||||
|
]
|
||||||
|
) concat(
|
||||||
|
transversals[0],
|
||||||
|
rights,
|
||||||
|
reverse(transversals[leng_trs - 1]),
|
||||||
|
lefts
|
||||||
|
);
|
||||||
|
|
||||||
function _shape_path_extend_az(p1, p2) =
|
function _shape_path_extend_az(p1, p2) =
|
||||||
let(
|
let(
|
||||||
|
@@ -1,23 +0,0 @@
|
|||||||
/**
|
|
||||||
* circle_path.scad
|
|
||||||
*
|
|
||||||
* @copyright Justin Lin, 2017
|
|
||||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
|
||||||
*
|
|
||||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-circle_path.html
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
use <__comm__/__frags.scad>;
|
|
||||||
|
|
||||||
function circle_path(radius, n) =
|
|
||||||
let(
|
|
||||||
_ = echo("<b><i>circle_path</i> is deprecated: use <i>shape_circle</i> instead.</b>"),
|
|
||||||
_frags = __frags(radius),
|
|
||||||
step_a = 360 / _frags,
|
|
||||||
end_a = 360 - step_a * ((is_undef(n) || n > _frags) ? 1 : _frags - n + 1)
|
|
||||||
)
|
|
||||||
[
|
|
||||||
for(a = 0; a <= end_a; a = a + step_a)
|
|
||||||
[radius * cos(a), radius * sin(a)]
|
|
||||||
];
|
|
@@ -1,54 +0,0 @@
|
|||||||
function _px_circle_y(f, y) = f >= 0 ? y - 1 : y;
|
|
||||||
function _px_circle_ddf_y(f, ddf_y) = f >= 0 ? ddf_y + 2 : ddf_y;
|
|
||||||
function _px_circle_f(f, ddf_y) = f >= 0 ? f + ddf_y : f;
|
|
||||||
|
|
||||||
function _px_circle(f, ddf_x, ddf_y, x, y, filled) =
|
|
||||||
x >= y ? [] :
|
|
||||||
let(
|
|
||||||
ny = _px_circle_y(f, y),
|
|
||||||
nddf_y = _px_circle_ddf_y(f, ddf_y),
|
|
||||||
nx = x + 1,
|
|
||||||
nddf_x = ddf_x + 2,
|
|
||||||
nf = _px_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]
|
|
||||||
],
|
|
||||||
_px_circle(nf, nddf_x, nddf_y, nx, ny, filled)
|
|
||||||
);
|
|
||||||
|
|
||||||
function _px_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]
|
|
||||||
],
|
|
||||||
_px_circle(f, ddf_x, ddf_y, x, y, filled)
|
|
||||||
);
|
|
@@ -1,50 +0,0 @@
|
|||||||
|
|
||||||
function _px_cylinder_px_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 _px_cylinder_diff_r(r, h, filled, thickness) =
|
|
||||||
let(
|
|
||||||
r1 = r[0],
|
|
||||||
r2 = r[1]
|
|
||||||
)
|
|
||||||
r1 == r2 ? _px_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 = _px_cylinder_px_circle(r, filled, thickness))
|
|
||||||
[pt[0], pt[1], i]
|
|
||||||
]
|
|
||||||
];
|
|
||||||
|
|
||||||
function _px_cylinder_same_r(r, h, filled, thickness) =
|
|
||||||
let(c = _px_cylinder_px_circle(r, filled, thickness))
|
|
||||||
[
|
|
||||||
for(i = 0; i < h; i = i + 1)
|
|
||||||
each [
|
|
||||||
for(pt = c)
|
|
||||||
[pt[0], pt[1], i]
|
|
||||||
]
|
|
||||||
];
|
|
||||||
|
|
||||||
function _px_cylinder_impl(r, h, filled, thickness) =
|
|
||||||
is_num(r) ?
|
|
||||||
_px_cylinder_same_r(r, h, filled, thickness) :
|
|
||||||
_px_cylinder_diff_r(r, h, filled, thickness);
|
|
@@ -1,21 +0,0 @@
|
|||||||
function _px_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 _px_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 = _px_from_row(height - i - 1, binaries[i], width, height, center, invert))
|
|
||||||
if(row != []) each row
|
|
||||||
];
|
|
@@ -1,29 +0,0 @@
|
|||||||
function _px_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 _px_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 = _px_gray_row(height - i - 1, levels[i], width, height, center, invert, normalize))
|
|
||||||
if(row != []) each row
|
|
||||||
];
|
|
@@ -1,202 +0,0 @@
|
|||||||
|
|
||||||
use <../../__comm__/__to3d.scad>;
|
|
||||||
use <../../__comm__/__to2d.scad>;
|
|
||||||
|
|
||||||
function _px_line_zsgn(a) = a == 0 ? a : a / abs(a);
|
|
||||||
|
|
||||||
// x-dominant
|
|
||||||
function _px_line_xdominant_y(y, yd, sy) = yd >= 0 ? y + sy : y;
|
|
||||||
function _px_line_xdominant_yd(yd, ax, ay) = (yd >= 0 ? yd - ax : yd) + ay;
|
|
||||||
function _px_line_xdominant_z(z, zd, sz) = zd >= 0 ? z + sz : z;
|
|
||||||
function _px_line_xdominant_zd(zd, ax, az) = (zd >= 0 ? zd - ax : zd) + az;
|
|
||||||
|
|
||||||
function _px_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],
|
|
||||||
_px_line_xdominant_sub(
|
|
||||||
x + sx,
|
|
||||||
_px_line_xdominant_y(y, yd, sy),
|
|
||||||
_px_line_xdominant_z(z, zd, sz),
|
|
||||||
endx,
|
|
||||||
a,
|
|
||||||
s,
|
|
||||||
_px_line_xdominant_yd(yd, ax, ay),
|
|
||||||
_px_line_xdominant_zd(zd, ax, az)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
function _px_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]],
|
|
||||||
_px_line_xdominant_sub(
|
|
||||||
x + sx,
|
|
||||||
_px_line_xdominant_y(y, yd, sy),
|
|
||||||
_px_line_xdominant_z(z, zd, sz),
|
|
||||||
endx,
|
|
||||||
a,
|
|
||||||
s,
|
|
||||||
_px_line_xdominant_yd(yd, ax, ay),
|
|
||||||
_px_line_xdominant_zd(zd, ax, az)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// y-dominant
|
|
||||||
function _px_line_ydominant_x(x, xd, sx) = xd >= 0 ? x + sx : x;
|
|
||||||
function _px_line_ydominant_xd(xd, ax, ay) = (xd >= 0 ? xd - ay : xd) + ax;
|
|
||||||
function _px_line_ydominant_z(z, zd, sz) = zd >= 0 ? z + sz : z;
|
|
||||||
function _px_line_ydominant_zd(zd, ay, az) = (zd >= 0 ? zd - ay : zd) + az;
|
|
||||||
|
|
||||||
function _px_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],
|
|
||||||
_px_line_ydominant_sub(
|
|
||||||
_px_line_ydominant_x(x, xd, sx),
|
|
||||||
y + sy,
|
|
||||||
_px_line_ydominant_z(z, zd, sz),
|
|
||||||
endy,
|
|
||||||
a,
|
|
||||||
s,
|
|
||||||
_px_line_ydominant_xd(xd, ax, ay),
|
|
||||||
_px_line_ydominant_zd(zd, ay, az)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
function _px_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]],
|
|
||||||
_px_line_ydominant_sub(
|
|
||||||
_px_line_ydominant_x(x, xd, sx),
|
|
||||||
y + sy,
|
|
||||||
_px_line_ydominant_z(z, zd, sz),
|
|
||||||
endy,
|
|
||||||
a,
|
|
||||||
s,
|
|
||||||
_px_line_ydominant_xd(xd, ax, ay),
|
|
||||||
_px_line_ydominant_zd(zd, ay, az)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// z-dominant
|
|
||||||
function _px_line_zdominant_x(x, xd, sx) = xd >= 0 ? x + sx : x;
|
|
||||||
function _px_line_zdominant_xd(xd, ax, az) = (xd >= 0 ? xd - az : xd) + ax;
|
|
||||||
|
|
||||||
function _px_line_zdominant_y(y, yd, sy) = yd >= 0 ? y + sy : y;
|
|
||||||
function _px_line_zdominant_yd(yd, ay, az) = (yd >= 0 ? yd - az : yd) + ay;
|
|
||||||
|
|
||||||
function _px_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],
|
|
||||||
_px_line_zdominant_sub(
|
|
||||||
_px_line_zdominant_x(x, xd, sx),
|
|
||||||
_px_line_zdominant_y(y, yd, sy),
|
|
||||||
z + sz,
|
|
||||||
endz,
|
|
||||||
a,
|
|
||||||
s,
|
|
||||||
_px_line_zdominant_xd(xd, ax, az),
|
|
||||||
_px_line_zdominant_yd(yd, ay, az)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
function _px_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]],
|
|
||||||
_px_line_zdominant_sub(
|
|
||||||
_px_line_zdominant_x(x, xd, sx),
|
|
||||||
_px_line_zdominant_y(y, yd, sy),
|
|
||||||
z + sz,
|
|
||||||
endz,
|
|
||||||
a,
|
|
||||||
s,
|
|
||||||
_px_line_zdominant_xd(xd, ax, az),
|
|
||||||
_px_line_zdominant_yd(yd, ay, az)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
function _px_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 = _px_line_zsgn(dt[0]),
|
|
||||||
sy = _px_line_zsgn(dt[1]),
|
|
||||||
sz = _px_line_zsgn(dt[2]),
|
|
||||||
points = ax >= max(ay, az) ? _px_line_xdominant(start_pt, end_pt, [ax, ay, az], [sx, sy, sz]) : (
|
|
||||||
ay >= max(ax, az) ? _px_line_ydominant(start_pt, end_pt, [ax, ay, az], [sx, sy, sz]) :
|
|
||||||
_px_line_zdominant(start_pt, end_pt, [ax, ay, az], [sx, sy, sz])
|
|
||||||
)
|
|
||||||
)
|
|
||||||
is_2d ? [for(pt = points) __to2d(pt)] : points;
|
|
@@ -1,974 +0,0 @@
|
|||||||
/**
|
|
||||||
* px_ascii.scad
|
|
||||||
*
|
|
||||||
* @copyright Justin Lin, 2019
|
|
||||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
|
||||||
*
|
|
||||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-px_ascii.html
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
use <px_from.scad>;
|
|
||||||
|
|
||||||
function px_ascii(char, center = false, invert = false) =
|
|
||||||
let(
|
|
||||||
_ = echo("<b><i>pixel/px_ascii</i> is deprecated: use <i>voxel/vx_ascii</i> instead.</b>"),
|
|
||||||
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,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,1,0,0],
|
|
||||||
[0,1,1,1,1,1,1,0],
|
|
||||||
[0,0,1,0,0,1,0,0],
|
|
||||||
[0,0,1,0,0,1,0,0],
|
|
||||||
[0,1,1,1,1,1,1,0],
|
|
||||||
[0,0,1,0,0,1,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,1,1,1,1,0,0],
|
|
||||||
[0,1,0,1,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,0,1,0,0,1,0],
|
|
||||||
[0,1,1,1,1,1,0,0],
|
|
||||||
[0,0,0,1,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "%"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,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,1,1,0],
|
|
||||||
[0,1,0,0,0,1,1,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,0,1,0,0,0],
|
|
||||||
[0,0,1,1,0,0,0,0],
|
|
||||||
[0,1,0,0,1,0,1,0],
|
|
||||||
[0,1,0,0,0,1,0,0],
|
|
||||||
[0,0,1,1,1,0,1,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,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,1,1,0,0],
|
|
||||||
[0,0,1,1,1,0,0,0],
|
|
||||||
[0,0,1,1,0,0,0,0],
|
|
||||||
[0,0,1,1,0,0,0,0],
|
|
||||||
[0,0,1,1,1,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,1,1,1,0,0,0],
|
|
||||||
[0,0,0,1,1,1,0,0],
|
|
||||||
[0,0,0,0,1,1,0,0],
|
|
||||||
[0,0,0,0,1,1,0,0],
|
|
||||||
[0,0,0,1,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,1,0,1,0,1,0,0],
|
|
||||||
[0,0,1,1,1,0,0,0],
|
|
||||||
[0,0,0,1,0,0,0,0],
|
|
||||||
[0,0,1,1,1,0,0,0],
|
|
||||||
[0,1,0,1,0,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,0,1,1,0,0,0],
|
|
||||||
[0,1,1,1,1,1,1,0],
|
|
||||||
[0,1,1,1,1,1,1,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,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,1,0,0,0],
|
|
||||||
[0,0,0,1,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,0,0],
|
|
||||||
[0,1,1,1,1,1,1,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,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,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,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,0,0,0,0],
|
|
||||||
[0,1,1,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,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,1,1,1,0],
|
|
||||||
[0,1,1,1,1,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "1"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,1,1,0,0,0],
|
|
||||||
[0,0,1,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,1,1,1,1,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "2"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,1,1,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,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "3"
|
|
||||||
[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,0,0,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "4"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,0,1,1,0,0],
|
|
||||||
[0,0,0,1,1,1,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,1,1,0,0],
|
|
||||||
[0,1,1,1,1,1,1,0],
|
|
||||||
[0,0,0,0,1,1,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "5"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,1,0],
|
|
||||||
[0,1,1,0,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "6"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "7"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,1,0],
|
|
||||||
[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,0,0,0,0],
|
|
||||||
[0,0,1,1,0,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "8"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "9"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,1,0],
|
|
||||||
[0,0,0,0,0,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,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,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,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,0,0,0,0,0],
|
|
||||||
[0,0,0,1,1,0,0,0],
|
|
||||||
[0,0,0,1,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,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,0,0,1,1,0,0,0],
|
|
||||||
[0,0,0,0,1,1,0,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,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,1,0],
|
|
||||||
[0,0,0,0,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,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,0,0,0],
|
|
||||||
[0,0,1,1,0,0,0,0],
|
|
||||||
[0,0,0,1,1,0,0,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,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "?"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,0,0,1,1,0,0],
|
|
||||||
[0,0,0,1,1,0,0,0],
|
|
||||||
[0,0,0,0,0,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,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,1,0,1,0],
|
|
||||||
[0,1,1,0,1,1,1,0],
|
|
||||||
[0,1,1,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "A"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,1,1,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,1,1,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "B"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "C"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "D"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,1,1,0,0,0],
|
|
||||||
[0,1,1,0,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,1,1,0,0],
|
|
||||||
[0,1,1,1,1,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "E"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,1,0],
|
|
||||||
[0,1,1,0,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "F"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,1,0],
|
|
||||||
[0,1,1,0,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,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]
|
|
||||||
],
|
|
||||||
[// "G"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,1,0],
|
|
||||||
[0,1,1,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,0,0,0],
|
|
||||||
[0,1,1,0,1,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "H"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,1,1,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "I"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,1,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,1,1,1,1,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "J"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,1,1,1,1,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,1,0,0,1,1,0,0],
|
|
||||||
[0,1,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
],
|
|
||||||
[// "K"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,1,1,0,0],
|
|
||||||
[0,1,1,1,1,0,0,0],
|
|
||||||
[0,1,1,1,1,0,0,0],
|
|
||||||
[0,1,1,0,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "L"
|
|
||||||
[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,1,1,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "M"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[1,1,0,0,0,1,1,0],
|
|
||||||
[1,1,1,0,1,1,1,0],
|
|
||||||
[1,1,1,1,1,1,1,0],
|
|
||||||
[1,1,0,1,0,1,1,0],
|
|
||||||
[1,1,0,0,0,1,1,0],
|
|
||||||
[1,1,0,0,0,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "N"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,1,0,1,1,0],
|
|
||||||
[0,1,1,1,1,1,1,0],
|
|
||||||
[0,1,1,1,1,1,1,0],
|
|
||||||
[0,1,1,0,1,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "O"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "P"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,1,1,1,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]
|
|
||||||
],
|
|
||||||
[// "Q"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,1,1,1,0,0],
|
|
||||||
[0,0,1,1,0,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "R"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "S"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,1,1,0],
|
|
||||||
[0,0,0,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "T"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,1,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]
|
|
||||||
],
|
|
||||||
[// "U"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,1,1,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "V"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,0,1,1,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "W"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[1,1,0,0,0,1,1,0],
|
|
||||||
[1,1,0,0,0,1,1,0],
|
|
||||||
[1,1,0,1,0,1,1,0],
|
|
||||||
[1,1,1,1,1,1,1,0],
|
|
||||||
[1,1,1,0,1,1,1,0],
|
|
||||||
[1,1,0,0,0,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "X"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "Y"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,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]
|
|
||||||
],
|
|
||||||
[// "Z"
|
|
||||||
[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,0,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,1,1,1,1,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,1,1,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,0,1,1,0,0,0,0],
|
|
||||||
[0,0,0,1,1,0,0,0],
|
|
||||||
[0,0,0,0,1,1,0,0],
|
|
||||||
[0,0,0,0,0,1,1,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,1,1,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,1,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,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,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,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,1,1,1,1,1,1,1]
|
|
||||||
],
|
|
||||||
[// "`"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,1,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,0,0,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "a"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "b"
|
|
||||||
[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,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "c"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,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,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "d"
|
|
||||||
[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,1,1,1,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "e"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,1,1,1,1,0],
|
|
||||||
[0,1,1,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "f"
|
|
||||||
[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,1,1,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]
|
|
||||||
],
|
|
||||||
[// "g"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,1,0],
|
|
||||||
[0,0,0,0,0,1,1,0],
|
|
||||||
[0,1,1,1,1,1,0,0]
|
|
||||||
],
|
|
||||||
[// "h"
|
|
||||||
[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,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "i"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,1,1,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,0,0,0],
|
|
||||||
[0,0,0,1,1,0,0,0],
|
|
||||||
[0,0,0,1,1,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "j"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,0,0,1,1,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,1,1,1,1,0,0]
|
|
||||||
],
|
|
||||||
[// "k"
|
|
||||||
[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,1,1,0,0],
|
|
||||||
[0,1,1,1,1,0,0,0],
|
|
||||||
[0,1,1,0,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "l"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,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,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "m"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,1,1,1,1,1],
|
|
||||||
[0,1,1,1,1,1,1,1],
|
|
||||||
[0,1,1,0,1,0,1,1],
|
|
||||||
[0,1,1,0,0,0,1,1],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "n"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "o"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "p"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "q"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,1,0],
|
|
||||||
[0,0,0,0,0,1,1,0],
|
|
||||||
[0,0,0,0,0,1,1,0]
|
|
||||||
],
|
|
||||||
[// "r"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,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]
|
|
||||||
],
|
|
||||||
[// "s"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,1,0],
|
|
||||||
[0,1,1,0,0,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,1,1,0],
|
|
||||||
[0,1,1,1,1,1,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "t"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,1,1,0,0,0],
|
|
||||||
[0,1,1,1,1,1,1,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,1,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "u"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "v"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,0,1,1,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "w"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,0,1,1],
|
|
||||||
[0,1,1,0,1,0,1,1],
|
|
||||||
[0,1,1,1,1,1,1,1],
|
|
||||||
[0,0,1,1,1,1,1,0],
|
|
||||||
[0,0,1,1,0,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "x"
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,0,0,0,0,0,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,0,0,1,1,0,0,0],
|
|
||||||
[0,0,1,1,1,1,0,0],
|
|
||||||
[0,1,1,0,0,1,1,0],
|
|
||||||
[0,0,0,0,0,0,0,0]
|
|
||||||
],
|
|
||||||
[// "y"
|
|
||||||
[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]
|
|
||||||
],
|
|
||||||
[// "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]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
)
|
|
||||||
px_from(binaries[idx], center = center, invert = invert);
|
|
@@ -1,20 +0,0 @@
|
|||||||
/**
|
|
||||||
* px_circle.scad
|
|
||||||
*
|
|
||||||
* @copyright Justin Lin, 2019
|
|
||||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
|
||||||
*
|
|
||||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-px_circle.html
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
use <_impl/_px_circle_impl.scad>;
|
|
||||||
use <../util/sort.scad>;
|
|
||||||
use <../util/dedup.scad>;
|
|
||||||
|
|
||||||
function px_circle(radius, filled = false) =
|
|
||||||
let(
|
|
||||||
_ = echo("<b><i>pixel/px_circle</i> is deprecated: use <i>voxel/vx_circle</i> instead.</b>"),
|
|
||||||
all = _px_circle_impl(radius, filled)
|
|
||||||
)
|
|
||||||
dedup(sort(all, by = "vt"), sorted = true);
|
|
@@ -1,20 +0,0 @@
|
|||||||
/**
|
|
||||||
* px_cylinder.scad
|
|
||||||
*
|
|
||||||
* @copyright Justin Lin, 2019
|
|
||||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
|
||||||
*
|
|
||||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-px_cylinder.html
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
use <_impl/_px_cylinder_impl.scad>;
|
|
||||||
use <../util/sort.scad>;
|
|
||||||
use <../util/dedup.scad>;
|
|
||||||
|
|
||||||
function px_cylinder(r, h, filled = false, thickness = 1) =
|
|
||||||
let(
|
|
||||||
_ = echo("<b><i>pixel/px_cylinder</i> is deprecated: use <i>voxel/vx_cylinder</i> instead.</b>"),
|
|
||||||
all = _px_cylinder_impl(r, h, filled, thickness)
|
|
||||||
)
|
|
||||||
dedup(sort(all, by = "vt"), sorted = true);
|
|
@@ -1,17 +0,0 @@
|
|||||||
/**
|
|
||||||
* px_from.scad
|
|
||||||
*
|
|
||||||
* @copyright Justin Lin, 2019
|
|
||||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
|
||||||
*
|
|
||||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-px_from.html
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
use <_impl/_px_from_impl.scad>;
|
|
||||||
|
|
||||||
function px_from(binaries, center = false, invert = false) =
|
|
||||||
let(
|
|
||||||
_ = echo("<b><i>pixel/px_from</i> is deprecated: use <i>voxel/vx_from</i> instead.</b>")
|
|
||||||
)
|
|
||||||
_px_from_impl(binaries, center, invert);
|
|
@@ -1,17 +0,0 @@
|
|||||||
/**
|
|
||||||
* px_gray.scad
|
|
||||||
*
|
|
||||||
* @copyright Justin Lin, 2019
|
|
||||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
|
||||||
*
|
|
||||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-px_gray.html
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
use <_impl/_px_gray_impl.scad>;
|
|
||||||
|
|
||||||
function px_gray(levels, center = false, invert = false, normalize = false) =
|
|
||||||
let(
|
|
||||||
_ = echo("<b><i>pixel/px_gray</i> is deprecated: use <i>voxel/vx_gray</i> instead.</b>")
|
|
||||||
)
|
|
||||||
_px_gray_impl(levels, center, invert, normalize);
|
|
@@ -1,17 +0,0 @@
|
|||||||
/**
|
|
||||||
* px_line.scad
|
|
||||||
*
|
|
||||||
* @copyright Justin Lin, 2019
|
|
||||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
|
||||||
*
|
|
||||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-px_line.html
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
use <_impl/_px_line_impl.scad>;
|
|
||||||
|
|
||||||
function px_line(p1, p2) =
|
|
||||||
let(
|
|
||||||
_ = echo("<b><i>pixel/px_line</i> is deprecated: use <i>voxel/vx_line</i> instead.</b>")
|
|
||||||
)
|
|
||||||
_px_line_impl(p1, p2);
|
|
@@ -1,34 +0,0 @@
|
|||||||
use <../in_shape.scad>;
|
|
||||||
use <../util/sort.scad>;
|
|
||||||
use <../util/dedup.scad>;
|
|
||||||
use <px_polyline.scad>;
|
|
||||||
|
|
||||||
function px_polygon(points, filled = false) =
|
|
||||||
let(
|
|
||||||
_ = echo("<b><i>pixel/px_polygon</i> is deprecated: use <i>voxel/vx_polygon</i> instead.</b>"),
|
|
||||||
contour = px_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);
|
|
@@ -1,29 +0,0 @@
|
|||||||
/**
|
|
||||||
* px_polyline.scad
|
|
||||||
*
|
|
||||||
* @copyright Justin Lin, 2019
|
|
||||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
|
||||||
*
|
|
||||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-px_polyline.html
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
use <../__comm__/__to3d.scad>;
|
|
||||||
use <../__comm__/__to2d.scad>;
|
|
||||||
use <../__comm__/__lines_from.scad>;
|
|
||||||
use <../util/sort.scad>;
|
|
||||||
use <../util/dedup.scad>;
|
|
||||||
use <px_line.scad>;
|
|
||||||
|
|
||||||
function px_polyline(points) =
|
|
||||||
let(
|
|
||||||
_ = echo("<b><i>pixel/px_polyline</i> is deprecated: use <i>voxel/vx_polyline</i> instead.</b>"),
|
|
||||||
is_2d = len(points[0]) == 2,
|
|
||||||
pts = is_2d ? [for(pt = points) __to3d(pt)] : points,
|
|
||||||
polyline = [for(line = __lines_from(pts)) each px_line(line[0], line[1])]
|
|
||||||
)
|
|
||||||
dedup(is_2d ?
|
|
||||||
sort([for(pt = polyline) __to2d(pt)], by = "vt")
|
|
||||||
:
|
|
||||||
sort(polyline, by = "vt")
|
|
||||||
, sorted = true);
|
|
@@ -1,34 +0,0 @@
|
|||||||
/**
|
|
||||||
* px_sphere.scad
|
|
||||||
*
|
|
||||||
* @copyright Justin Lin, 2019
|
|
||||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
|
||||||
*
|
|
||||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-px_sphere.html
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
function px_sphere(radius, filled = false, thickness = 1) =
|
|
||||||
let(
|
|
||||||
_ = echo("<b><i>pixel/px_sphere</i> is deprecated: use <i>voxel/vx_sphere</i> instead.</b>"),
|
|
||||||
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
|
|
||||||
];
|
|
||||||
|
|
@@ -1,255 +0,0 @@
|
|||||||
/**
|
|
||||||
* polysections.scad
|
|
||||||
*
|
|
||||||
* @copyright Justin Lin, 2017
|
|
||||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
|
||||||
*
|
|
||||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-polysections.html
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
use <util/reverse.scad>;
|
|
||||||
|
|
||||||
module polysections(sections, triangles = "SOLID") {
|
|
||||||
echo("<b><i>polysections</i> is deprecated: use <i>sweep</i> instead.</b>");
|
|
||||||
|
|
||||||
function side_indexes(sects, begin_idx = 0) =
|
|
||||||
let(
|
|
||||||
leng_sects = len(sects),
|
|
||||||
leng_pts_sect = len(sects[0]),
|
|
||||||
range_j = [begin_idx:leng_pts_sect:begin_idx + (leng_sects - 2) * leng_pts_sect],
|
|
||||||
range_i = [0:leng_pts_sect - 1]
|
|
||||||
)
|
|
||||||
concat(
|
|
||||||
[
|
|
||||||
for(j = range_j)
|
|
||||||
for(i = range_i)
|
|
||||||
[
|
|
||||||
j + i,
|
|
||||||
j + (i + 1) % leng_pts_sect,
|
|
||||||
j + (i + 1) % leng_pts_sect + leng_pts_sect
|
|
||||||
]
|
|
||||||
],
|
|
||||||
[
|
|
||||||
for(j = range_j)
|
|
||||||
for(i = range_i)
|
|
||||||
[
|
|
||||||
j + i,
|
|
||||||
j + (i + 1) % leng_pts_sect + leng_pts_sect ,
|
|
||||||
j + i + leng_pts_sect
|
|
||||||
]
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
function search_at(f_sect, p, leng_pts_sect, i = 0) =
|
|
||||||
i < leng_pts_sect ?
|
|
||||||
(p == f_sect[i] ? i : search_at(f_sect, p, leng_pts_sect, i + 1)) : -1;
|
|
||||||
|
|
||||||
function the_same_after_twisting(f_sect, l_sect, leng_pts_sect) =
|
|
||||||
let(
|
|
||||||
found_at_i = search_at(f_sect, l_sect[0], leng_pts_sect)
|
|
||||||
)
|
|
||||||
found_at_i <= 0 ? false :
|
|
||||||
l_sect == concat(
|
|
||||||
[for(i = found_at_i; i < leng_pts_sect; i = i + 1) f_sect[i]],
|
|
||||||
[for(i = 0; i < found_at_i; i = i + 1) f_sect[i]]
|
|
||||||
);
|
|
||||||
|
|
||||||
function to_v_pts(sects) =
|
|
||||||
[
|
|
||||||
for(sect = sects)
|
|
||||||
for(pt = sect)
|
|
||||||
pt
|
|
||||||
];
|
|
||||||
|
|
||||||
module solid_sections(sects) {
|
|
||||||
|
|
||||||
leng_sects = len(sects);
|
|
||||||
leng_pts_sect = len(sects[0]);
|
|
||||||
first_sect = sects[0];
|
|
||||||
last_sect = sects[leng_sects - 1];
|
|
||||||
|
|
||||||
v_pts = [
|
|
||||||
for(sect = sects)
|
|
||||||
for(pt = sect)
|
|
||||||
pt
|
|
||||||
];
|
|
||||||
|
|
||||||
begin_end_the_same =
|
|
||||||
first_sect == last_sect ||
|
|
||||||
the_same_after_twisting(first_sect, last_sect, leng_pts_sect);
|
|
||||||
|
|
||||||
if(begin_end_the_same) {
|
|
||||||
f_idxes = side_indexes(sects);
|
|
||||||
|
|
||||||
polyhedron(
|
|
||||||
v_pts,
|
|
||||||
f_idxes
|
|
||||||
);
|
|
||||||
|
|
||||||
// hook for testing
|
|
||||||
test_polysections_solid(v_pts, f_idxes, triangles);
|
|
||||||
} else {
|
|
||||||
range_i = [0:leng_pts_sect - 1];
|
|
||||||
first_idxes = [for(i = range_i) leng_pts_sect - 1 - i];
|
|
||||||
last_idxes = [
|
|
||||||
for(i = range_i)
|
|
||||||
i + leng_pts_sect * (leng_sects - 1)
|
|
||||||
];
|
|
||||||
|
|
||||||
f_idxes = concat([first_idxes], side_indexes(sects), [last_idxes]);
|
|
||||||
|
|
||||||
polyhedron(
|
|
||||||
v_pts,
|
|
||||||
f_idxes
|
|
||||||
);
|
|
||||||
|
|
||||||
// hook for testing
|
|
||||||
test_polysections_solid(v_pts, f_idxes, triangles);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module hollow_sections(sects) {
|
|
||||||
leng_sects = len(sects);
|
|
||||||
leng_sect = len(sects[0]);
|
|
||||||
half_leng_sect = leng_sect / 2;
|
|
||||||
half_leng_v_pts = leng_sects * half_leng_sect;
|
|
||||||
|
|
||||||
function strip_sects(begin_idx, end_idx) =
|
|
||||||
[
|
|
||||||
for(i = 0; i < leng_sects; i = i + 1)
|
|
||||||
[
|
|
||||||
for(j = begin_idx; j <= end_idx; j = j + 1)
|
|
||||||
sects[i][j]
|
|
||||||
]
|
|
||||||
];
|
|
||||||
|
|
||||||
function first_idxes() =
|
|
||||||
[
|
|
||||||
for(i = 0; i < half_leng_sect; i = i + 1)
|
|
||||||
[
|
|
||||||
i,
|
|
||||||
i + half_leng_v_pts,
|
|
||||||
(i + 1) % half_leng_sect + half_leng_v_pts,
|
|
||||||
(i + 1) % half_leng_sect
|
|
||||||
]
|
|
||||||
];
|
|
||||||
|
|
||||||
function last_idxes(begin_idx) =
|
|
||||||
[
|
|
||||||
for(i = 0; i < half_leng_sect; i = i + 1)
|
|
||||||
[
|
|
||||||
begin_idx + i,
|
|
||||||
begin_idx + (i + 1) % half_leng_sect,
|
|
||||||
begin_idx + (i + 1) % half_leng_sect + half_leng_v_pts,
|
|
||||||
begin_idx + i + half_leng_v_pts
|
|
||||||
]
|
|
||||||
];
|
|
||||||
|
|
||||||
outer_sects = strip_sects(0, half_leng_sect - 1);
|
|
||||||
inner_sects = strip_sects(half_leng_sect, leng_sect - 1);
|
|
||||||
|
|
||||||
outer_v_pts = to_v_pts(outer_sects);
|
|
||||||
inner_v_pts = to_v_pts(inner_sects);
|
|
||||||
|
|
||||||
outer_idxes = side_indexes(outer_sects);
|
|
||||||
inner_idxes = [
|
|
||||||
for(idxes = side_indexes(inner_sects, half_leng_v_pts))
|
|
||||||
reverse(idxes)
|
|
||||||
];
|
|
||||||
|
|
||||||
first_outer_sect = outer_sects[0];
|
|
||||||
last_outer_sect = outer_sects[leng_sects - 1];
|
|
||||||
first_inner_sect = inner_sects[0];
|
|
||||||
last_inner_sect = inner_sects[leng_sects - 1];
|
|
||||||
|
|
||||||
leng_pts_sect = len(first_outer_sect);
|
|
||||||
|
|
||||||
begin_end_the_same =
|
|
||||||
(first_outer_sect == last_outer_sect && first_inner_sect == last_inner_sect) ||
|
|
||||||
(
|
|
||||||
the_same_after_twisting(first_outer_sect, last_outer_sect, leng_pts_sect) &&
|
|
||||||
the_same_after_twisting(first_inner_sect, last_inner_sect, leng_pts_sect)
|
|
||||||
);
|
|
||||||
|
|
||||||
v_pts = concat(outer_v_pts, inner_v_pts);
|
|
||||||
|
|
||||||
if(begin_end_the_same) {
|
|
||||||
f_idxes = concat(outer_idxes, inner_idxes);
|
|
||||||
|
|
||||||
polyhedron(
|
|
||||||
v_pts,
|
|
||||||
f_idxes
|
|
||||||
);
|
|
||||||
|
|
||||||
// hook for testing
|
|
||||||
test_polysections_solid(v_pts, f_idxes, triangles);
|
|
||||||
} else {
|
|
||||||
first_idxes = first_idxes();
|
|
||||||
last_idxes = last_idxes(half_leng_v_pts - half_leng_sect);
|
|
||||||
|
|
||||||
f_idxes = concat(first_idxes, outer_idxes, inner_idxes, last_idxes);
|
|
||||||
|
|
||||||
polyhedron(
|
|
||||||
v_pts,
|
|
||||||
f_idxes
|
|
||||||
);
|
|
||||||
|
|
||||||
// hook for testing
|
|
||||||
test_polysections_solid(v_pts, f_idxes, triangles);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module triangles_defined_sections() {
|
|
||||||
module tri_sections(tri1, tri2) {
|
|
||||||
hull() polyhedron(
|
|
||||||
points = concat(tri1, tri2),
|
|
||||||
faces = [
|
|
||||||
[0, 1, 2],
|
|
||||||
[3, 5, 4],
|
|
||||||
[1, 3, 4], [2, 1, 4], [2, 3, 0],
|
|
||||||
[0, 3, 1], [2, 4, 5], [2, 5, 3]
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
module two_sections(section1, section2) {
|
|
||||||
for(idx = triangles) {
|
|
||||||
tri_sections(
|
|
||||||
[
|
|
||||||
section1[idx[0]],
|
|
||||||
section1[idx[1]],
|
|
||||||
section1[idx[2]]
|
|
||||||
],
|
|
||||||
[
|
|
||||||
section2[idx[0]],
|
|
||||||
section2[idx[1]],
|
|
||||||
section2[idx[2]]
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(i = [0:len(sections) - 2]) {
|
|
||||||
two_sections(
|
|
||||||
sections[i],
|
|
||||||
sections[i + 1]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(triangles == "SOLID") {
|
|
||||||
solid_sections(sections);
|
|
||||||
} else if(triangles == "HOLLOW") {
|
|
||||||
hollow_sections(sections);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
triangles_defined_sections();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// override it to test
|
|
||||||
|
|
||||||
module test_polysections_solid(points, faces, triangles) {
|
|
||||||
|
|
||||||
}
|
|
@@ -1,18 +0,0 @@
|
|||||||
/**
|
|
||||||
* polytransversals.scad
|
|
||||||
*
|
|
||||||
* @copyright Justin Lin, 2017
|
|
||||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
|
||||||
*
|
|
||||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-polytransversals.html
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
use <__comm__/__polytransversals.scad>;
|
|
||||||
|
|
||||||
module polytransversals(transversals) {
|
|
||||||
echo("<b><i>polytransversals</i> is deprecated.</b>");
|
|
||||||
polygon(
|
|
||||||
__polytransversals(transversals)
|
|
||||||
);
|
|
||||||
}
|
|
@@ -1,15 +0,0 @@
|
|||||||
/**
|
|
||||||
* rotate_p.scad
|
|
||||||
*
|
|
||||||
* @copyright Justin Lin, 2017
|
|
||||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
|
||||||
*
|
|
||||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-rotate_p.html
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
use <ptf/_impl/_ptf_rotate_impl.scad>;
|
|
||||||
|
|
||||||
function rotate_p(point, a, v) =
|
|
||||||
let(_ = echo("<b><i>rotate_p</i> is deprecated: use <i>ptf_rotate</i> instead.</b>"))
|
|
||||||
_rotate_p_impl(point, a, v);
|
|
@@ -1,15 +0,0 @@
|
|||||||
|
|
||||||
/**
|
|
||||||
* shape_glued2circles.scad
|
|
||||||
*
|
|
||||||
* @copyright Justin Lin, 2017
|
|
||||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
|
||||||
*
|
|
||||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-shape_glued2circles.html
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
use <_impl/_shape_glued2circles_impl.scad>;
|
|
||||||
|
|
||||||
function shape_glued2circles(radius, centre_dist, tangent_angle = 30, t_step = 0.1) =
|
|
||||||
_shape_glued2circles_impl(radius, centre_dist, tangent_angle, t_step);
|
|
@@ -1,57 +0,0 @@
|
|||||||
/**
|
|
||||||
* voronoi2d.scad
|
|
||||||
*
|
|
||||||
* @copyright Justin Lin, 2019
|
|
||||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
|
||||||
*
|
|
||||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-voronoi2d.html
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
module voronoi2d(points, spacing = 1, r = 0, delta = 0, chamfer = false, region_type = "square") {
|
|
||||||
echo("<b><i>voronoi2d</i> is deprecated: use <i>voronoi/vrn2_from</i> instead.</b>");
|
|
||||||
|
|
||||||
xs = [for(p = points) p[0]];
|
|
||||||
ys = [for(p = points) abs(p[1])];
|
|
||||||
|
|
||||||
region_size = max([(max(xs) - min(xs) / 2), (max(ys) - min(ys)) / 2]);
|
|
||||||
half_region_size = 0.5 * region_size;
|
|
||||||
offset_leng = spacing * 0.5 + half_region_size;
|
|
||||||
|
|
||||||
function normalize(v) = v / norm(v);
|
|
||||||
|
|
||||||
module region(pt) {
|
|
||||||
intersection_for(p = points) {
|
|
||||||
if(pt != p) {
|
|
||||||
v = p - pt;
|
|
||||||
translate((pt + p) / 2 - normalize(v) * offset_leng)
|
|
||||||
rotate(atan2(v[1], v[0]))
|
|
||||||
children();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module offseted_region(pt) {
|
|
||||||
if(r != 0) {
|
|
||||||
offset(r)
|
|
||||||
region(pt)
|
|
||||||
children();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
offset(delta = delta, chamfer = chamfer)
|
|
||||||
region(pt)
|
|
||||||
children();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(p = points) {
|
|
||||||
if(region_type == "square") {
|
|
||||||
offseted_region(p)
|
|
||||||
square(region_size, center = true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
offseted_region(p)
|
|
||||||
circle(half_region_size);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,45 +0,0 @@
|
|||||||
/**
|
|
||||||
* voronoi3d.scad
|
|
||||||
*
|
|
||||||
* @copyright Justin Lin, 2019
|
|
||||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
|
||||||
*
|
|
||||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-voronoi3d.html
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
use <__comm__/__angy_angz.scad>;
|
|
||||||
|
|
||||||
// slow but workable
|
|
||||||
|
|
||||||
module voronoi3d(points, spacing = 1) {
|
|
||||||
echo("<b><i>voronoi3d</i> is deprecated: use <i>voronoi/vrn3_from</i> instead.</b>");
|
|
||||||
|
|
||||||
xs = [for(p = points) p[0]];
|
|
||||||
ys = [for(p = points) abs(p[1])];
|
|
||||||
zs = [for(p = points) abs(p[2])];
|
|
||||||
|
|
||||||
space_size = max([max(xs) - min(xs), max(ys) - min(ys), max(zs) - min(zs)]);
|
|
||||||
half_space_size = 0.5 * space_size;
|
|
||||||
double_space_size = 2 * space_size;
|
|
||||||
offset_leng = (spacing + space_size) * 0.5;
|
|
||||||
|
|
||||||
function normalize(v) = v / norm(v);
|
|
||||||
|
|
||||||
module space(pt) {
|
|
||||||
intersection_for(p = points) {
|
|
||||||
if(pt != p) {
|
|
||||||
v = p - pt;
|
|
||||||
ryz = __angy_angz(p, pt);
|
|
||||||
|
|
||||||
translate((pt + p) / 2 - normalize(v) * offset_leng)
|
|
||||||
rotate([0, -ryz[0], ryz[1]])
|
|
||||||
cube([space_size, double_space_size, double_space_size], center = true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(p = points) {
|
|
||||||
space(p);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -44,7 +44,6 @@ include <test_shape_circle.scad>;
|
|||||||
include <test_shape_arc.scad>;
|
include <test_shape_arc.scad>;
|
||||||
include <test_shape_cyclicpolygon.scad>;
|
include <test_shape_cyclicpolygon.scad>;
|
||||||
include <test_shape_ellipse.scad>;
|
include <test_shape_ellipse.scad>;
|
||||||
include <test_shape_glued2circles.scad>;
|
|
||||||
include <test_shape_pie.scad>;
|
include <test_shape_pie.scad>;
|
||||||
include <test_shape_square.scad>;
|
include <test_shape_square.scad>;
|
||||||
include <test_shape_trapezium.scad>;
|
include <test_shape_trapezium.scad>;
|
||||||
|
Reference in New Issue
Block a user