Skip to content
GitLab
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Jan Koniarik
schpin-robot
Commits
9456697c
Commit
9456697c
authored
Dec 22, 2021
by
Jan Koniarik
Browse files
updates to koke shape, new body
parent
e7c3b8af
Pipeline
#105304
passed with stage
in 23 minutes and 28 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
schpin_koke/src/Main.hs
View file @
9456697c
...
...
@@ -107,6 +107,7 @@ leg leg_pos conf_type = Leg
FL
->
"fl"
FR
->
"fr"
,
root_joint
=
coxa
,
neutral_dir
=
pos
$
legPose
leg_pos
conf_type
}
where
coxa
::
SimpleJoint
...
...
schpin_koke/src/scad/LX15D/tiles.scad
View file @
9456697c
include
<../LX15D.scad>
include
<../part.scad>
include<../LX15D.scad>
;
include<../part.scad>
;
LX15D_U_h = 6;
LX15D_U_c = 0.2;
...
...
@@ -7,10 +7,8 @@ LX15D_U_offset = [ 40, 0, 0 ];
LX15D_U_screw_y = 16;
module LX15D_U_body(class)
part("blue",
part_name = str("LX15D_U_body(", Tname(class), ")"),
printed = true) difference()
{
part("blue", part_name = str("LX15D_U_body(", Tname(class), ")"),
printed = true) difference() {
t = 2;
translate([ -LX15D_U_h / 2, 0, 0 ])
cube([ LX15D_U_h, Ta(T24), LX15D_dim[2] ], center = true);
...
...
@@ -23,29 +21,28 @@ module LX15D_U_body(class)
for (i = [ -0.5, 0.5 ])
for (m = [ 0, 1 ])
mirror([ 0, 0, m ]) translate(
[
-LX15D_U_h / 2, i * LX15D_U_screw_y, -LX15D_dim[2] / 2 - t
])
{
mirror([ 0, 0, m ]) translate(
[
-LX15D_U_h / 2, i * LX15D_U_screw_y, -LX15D_dim[2] / 2 - t
])
{
Mscrew_hole(M2L8C);
translate([ 0, 0, 2 * t ]) Mnut_sidehole(M2N, l = 10);
}
}
module LX15D_U_plate(class, t = 2)
part("yellow",
p
art_name
=
s
tr
("LX15D_U_plate(", Tname(class), ")"),
printed = true) mirror([ 0, 0, 1 ]) difference()
{
union()
{
translate(LX15D_U_offset -
[ LX15D_U_h / 2, 0, LX15D_dim[2] / 2 + t / 2 ]
)
cube([ LX15D_U_h, Ta(T24), t ], center = true);
mirror([ 0, 0, 1 ]) LX15D_bottom_screw_pos()
hull() for (x = [ 0, LX15D_U_h / 2 ]) translate([ x, 0, 0 ])
c
ylinder(d = LX15D_screw_clearance_d, h
= t);
part("yellow",
part_name = str("LX15D_U_plate(", Tname(class), ")"),
p
rinted
= tr
ue) mirror([ 0, 0, 1 ]) difference() {
intersection() {
union()
{
translate(LX15D_U_offset -
[ LX15D_U_h / 2, 0, LX15D_dim[2] / 2 + t / 2 ])
cube([ LX15D_U_h, Ta(T24), t ], center = true);
mirror([ 0, 0, 1 ]) LX15D_bottom_screw_pos(
)
hull() for (x = [ 0, LX15D_U_h / 2 ]) translate([ x, 0, 0 ])
cylinder(d = LX15D_screw_clearance_d, h = t);
}
c
ube([ 1000, Ta(class), 1000 ], center
= t
rue
);
}
translate(LX15D_U_offset - [ LX15D_U_h / 2, 0, LX15D_dim[2] / 2 + t ])
{
translate(LX15D_U_offset - [ LX15D_U_h / 2, 0, LX15D_dim[2] / 2 + t ]) {
for (i = [ -0.5, 0.5 ])
translate([ 0, i * LX15D_U_screw_y, 0 ]) Mscrew_hole(M2L8C);
}
...
...
@@ -53,10 +50,8 @@ module LX15D_U_plate(class, t = 2)
cylinder(d = LX15D_body_screw_d, h = 100, center = true);
}
module LX15D_U_plate_cable(class, t, s)
part("yellow",
part_name = str("LX15D_U_plate_cable(", Tname(class), ")"),
printed = true) difference()
{
part("yellow", part_name = str("LX15D_U_plate_cable(", Tname(class), ")"),
printed = true) difference() {
LX15D_U_plate(class, t = t + s / 2);
translate(LX15D_U_offset -
[ LX15D_U_h / 2, 0, LX15D_dim[2] / 2 + t + s / 2 ])
...
...
@@ -64,25 +59,17 @@ module LX15D_U_plate_cable(class, t, s)
}
module LX15D_U_plate_cable_lock(class, t, s)
part("blue",
part_name = str("LX15D_U_plate_cable_lock(",
Tname(class),
",",
t,
",",
s,
")"),
printed = true) difference()
{
part_name = str("LX15D_U_plate_cable_lock(", Tname(class), ",", t, ",",
s, ")"),
printed = true) difference() {
hull() translate(LX15D_U_offset -
[ LX15D_U_h / 2, 0, LX15D_dim[2] / 2 + t + s / 2 ])
{
[ LX15D_U_h / 2, 0, LX15D_dim[2] / 2 + t + s / 2 ]) {
for (i = [ -0.5, 0.5 ])
translate([ 0, i * LX15D_U_screw_y, 0 ]) rotate([ 180, 0, 0 ])
cylinder(d = LX15D_U_h, h = t + s);
}
translate(LX15D_U_offset -
[ LX15D_U_h / 2, 0, LX15D_dim[2] / 2 + 2 * t + s ])
{
[ LX15D_U_h / 2, 0, LX15D_dim[2] / 2 + 2 * t + s ]) {
for (i = [ -0.5, 0.5 ])
translate([ 0, i * LX15D_U_screw_y, 0 ]) Mscrew_hole(M2L8C);
}
...
...
@@ -92,8 +79,7 @@ module LX15D_U_plate_cable_lock(class, t, s)
cable_harness(w = LX15D_U_screw_y, s = s, r = t, l = LX15D_U_h);
}
// this is meh, refactor
module LX15D_U(class, expand = 0) assembly("LX15D_U") union()
{
module LX15D_U(class, expand = 0) assembly("LX15D_U") union() {
t = 2;
cable_s = 2;
...
...
@@ -106,8 +92,7 @@ module LX15D_U(class, expand = 0) assembly("LX15D_U") union()
LX15D_U_plate_cable_lock(class, t = t, s = cable_s);
translate(LX15D_U_offset) for (i = [ -0.5, 0.5 ]) translate([
-LX15D_U_h / 2,
i * LX15D_U_screw_y,
-LX15D_U_h / 2, i * LX15D_U_screw_y,
-LX15D_dim[2] / 2 - 2 * t - cable_s - 2 * 2 *
expand
]) Mscrew(M2L12C);
...
...
@@ -115,12 +100,10 @@ module LX15D_U(class, expand = 0) assembly("LX15D_U") union()
translate(LX15D_U_offset) for (i = [ -0.5, 0.5 ]) translate([
-LX15D_U_h / 2,
i * LX15D_U_screw_y,
LX15D_dim[2] / 2 + t + 2 *
expand
, ]) rotate([ 180, 0, 0 ]) Mscrew(M2L8C);
LX15D_dim[2] / 2 + t + 2 * expand,
]) rotate([ 180, 0, 0 ]) Mscrew(M2L8C);
LX15D_bottom_screw_pos()
{
LX15D_bottom_screw_pos() {
translate([ 0, 0, -LX15D_dim[2] - 3 * expand - t ]) Mscrew(M2L8C);
translate([ 0, 0, 3 * expand + t ]) rotate([ 180, 0, 0 ]) Mscrew(M2L8C);
}
...
...
@@ -128,8 +111,7 @@ module LX15D_U(class, expand = 0) assembly("LX15D_U") union()
for (i = [ -0.5, 0.5 ])
for (j = [ -0.5, 0.5 ])
translate(LX15D_U_offset + [
expand - LX15D_U_h / 2,
i * LX15D_U_screw_y,
expand - LX15D_U_h / 2, i * LX15D_U_screw_y,
j * (LX15D_dim[2] - 2 * t)
]) rotate([ j * 180 + 90, 0, 0 ]) Mnut(M2N);
}
...
...
@@ -138,15 +120,12 @@ LX15D_BU_h = 6;
LX15D_BU_t = 3;
LX15D_BU_screw_a = 10;
LX15D_BU_offset = [ -25, 0, 0 ];
module
LX15D_BU_plate() part("blue", printed = true) difference()
{
module LX15D_BU_plate() part("blue", printed = true) difference() {
t = LX15D_BU_t;
h = 5;
horn_a = LX15D_horn_screw_d + t;
bu_screw_a = Md(M2L8C) + t;
translate([ 0, 0, h / 2 ]) hull()
{
translate([ 0, 0, h / 2 ]) hull() {
LX15D_horn_screw_pos() cube([ horn_a, horn_a, h ], center = true);
for (i = [ -0.5, 0.5 ])
translate(LX15D_BU_offset +
...
...
@@ -160,14 +139,11 @@ LX15D_BU_plate() part("blue", printed = true) difference()
translate(LX15D_BU_offset + [ LX15D_BU_h / 2, i * LX15D_BU_screw_a, t ])
rotate([ 180, 0, 0 ]) Mscrew_hole(M2L8C);
}
module
LX15D_BU_body() part("yellow", printed = true)
translate(LX15D_BU_offset + [ LX15D_BU_h / 2, 0, 0 ]) difference()
{
module LX15D_BU_body() part("yellow", printed = true)
translate(LX15D_BU_offset + [ LX15D_BU_h / 2, 0, 0 ]) difference() {
t = LX15D_BU_t;
dim = [ LX15D_BU_h, LX15D_BU_screw_a + t * 2, LX15D_horn_w ];
union()
{
union() {
rotate([ 0, 90, 0 ]) tile_pos(T24, LX15D_BU_h, center = true);
cube(dim, center = true);
}
...
...
@@ -176,21 +152,18 @@ LX15D_BU_body() part("yellow", printed = true)
for (j = [ -1, 1 ])
for (i = [ -0.5, 0.5 ])
translate([ 0, i * LX15D_BU_screw_a, j * dim[2] / 2 ])
rotate([ j * 90 + 90, 0, 0 ])
{
rotate([ j * 90 + 90, 0, 0 ]) {
Mscrew_hole(M2L8C);
translate([ 0, 0, t ]) Mnut_sidehole(M2N, l = 10);
}
}
module LX15D_BU(expand = 0)
{
module LX15D_BU(expand = 0) {
t = LX15D_BU_t;
plate_h = 5;
LX15D_BU_body();
for (an = [ 0, 180 ])
rotate([ an, 0, 0 ]) translate([ 0, 0, LX15D_horn_w / 2 + expand ])
{
rotate([ an, 0, 0 ]) translate([ 0, 0, LX15D_horn_w / 2 + expand ]) {
LX15D_BU_plate();
for (i = [ -0.5, 0.5 ])
...
...
@@ -204,11 +177,9 @@ module LX15D_BU(expand = 0)
for (j = [ -1, 1 ])
for (i = [ -0.5, 0.5 ])
translate(LX15D_BU_offset + [
LX15D_BU_h / 2 + expand,
i * LX15D_BU_screw_a,
LX15D_BU_h / 2 + expand, i * LX15D_BU_screw_a,
j * LX15D_horn_w / 2
]) rotate([ j * 90 + 90, 0, 0 ])
{
]) rotate([ j * 90 + 90, 0, 0 ]) {
translate([ 0, 0, t ]) Mnut(M2N);
}
}
schpin_koke/src/scad/body.scad
View file @
9456697c
include
<LX15D.scad>
include
<LX15D/cables.scad>
include
<LX15D/tiles.scad>
include
<bat.scad>
include
<camera.scad>
include
<metric.scad>
include
<rpi_box.scad>
include
<tile.scad>
include
<util.scad>
include<LX15D.scad>
;
include<LX15D/cables.scad>
;
include<LX15D/tiles.scad>
;
include<bat.scad>
;
include<camera.scad>
;
include<metric.scad>
;
include<rpi_box.scad>
;
include<tile.scad>
;
include<util.scad>
;
screw_d = 3;
t = 3;
...
...
@@ -17,10 +17,8 @@ xplate_tile_h = 6;
xplate_w = Ta(T24) * 2;
xplate_l = Ta(T24) * 7;
module body_collision(positions)
{
hull() for (pos = positions)
{
module body_collision(positions) {
hull() for (pos = positions) {
translate(pos)
cube([ LX15D_dim[1], LX15D_dim[1], LX15D_horn_w ], center = true);
}
...
...
@@ -28,54 +26,148 @@ module body_collision(positions)
center = true);
}
module
spine() part("white", printed = true)
{
for (i = [-2.5:2.5])
translate([ i * Ta(T24), 0, Ta(T24) ]) tile_box(T24);
for (i = [ -2.5, 2.5 ])
translate([ i * Ta(T24), 0, 0 ]) tile_box(T24);
module spine() part("white", printed = true) {
middle_h = 6;
difference() {
translate([ 0, 0, 0 ]) {
for (i = [ -1, 1 ]) {
for (x = [-Ta(T24):6:Ta(T24)])
translate([ x, Ta(T24) * i * 2, Ta(T24) / 2 ])
rotate([ 0, 90, 0 ]) hull()
tile_raw_plate(T24, 1, 1, 0.3);
translate([ i * Ta(T24) * 7 / 2, 0, Ta(T24) / 2 ])
tile_box(T24);
for (p = [
[ 5 / 2, 0 ], [ 3 / 2, 0 ], [ 3 / 2, 1 ], [ 3 / 2, -1 ]
])
translate(
[ i * Ta(T24) * p[0], Ta(T24) * p[1], Ta(T24) / 2 ]) {
tile_box_base(T24);
}
}
hull() for (j = [ -1, 1 ]) for (i = [ -1, 1 ]) {
translate([ i * Ta(T24) * 3 / 2, j * Ta(T24), 0 ])
tile_pos(T24, middle_h);
}
translate([ 0, 0, Ta(T24) - middle_h ])
hull() for (j = [ -1, 1 ]) for (i = [ -1, 1 ]) {
translate([ i * Ta(T24) * 3 / 2, j * Ta(T24), 0 ])
tile_pos(T24, middle_h);
translate([ i * Ta(T24) * 1 / 2, j * Ta(T24) * 2, 0 ])
tile_pos(T24, middle_h);
}
for (i = [ -1, 1 ])
for (j = [ -1, 1 ])
translate(
[ i * Ta(T24) / 2, j * Ta(T24) * 5 / 2, Ta(T24) / 2 ])
rotate([ j * 90, 0, 0 ]) tile_pos(T24, middle_h);
}
cube([ 2 * Ta(T24), Ta(T24), 100 ], center = true);
translate([ 0, 0, middle_h + Ta(T24) / 2 ])
cube([ 2 * Ta(T24), Ta(T24) * 3, Ta(T24) ], center = true);
for (i = [ -1, 1 ])
for (p = [
[ 5 / 2, 0 ], [ 3 / 2, 0 ], [ 3 / 2, 1 ], [ 3 / 2, -1 ]
])
translate([ i * Ta(T24) * p[0], Ta(T24) * p[1], Ta(T24) / 2 ]) {
tile_box_side_pos() cylinder(d = Ta(T24) / 2, h = Ta(T24));
}
for (j = [ -1, 1 ])
for (i = [ -1, 1 ]) {
translate([ Ta(T24) * i * 1 / 2, Ta(T24) * j * 1, 0 ])
tile_neg(T24, middle_h);
translate([
Ta(T24) * i * 1 / 2, Ta(T24) * j * 2, Ta(T24) - middle_h / 2
]) {
tile_screw_neg(T24, middle_h);
tile_center_hole(T24, middle_h + 2, center = true);
}
translate([
Ta(T24) * i * 1 / 2, j * (Ta(T24) * 5 / 2 - middle_h / 2),
Ta(T24) / 2
]) rotate([ j * -90, 0, 0 ]) {
tile_screw_neg(T24, middle_h);
tile_center_hole(T24, middle_h + 2, center = true);
}
}
for (j = [ -1, 1 ])
for (i = [ -1, 1 ]) {
for (p = [
[ 3 / 2, 1 ], [ 3 / 2, 0 ], [ 7 / 2, 1 ], [ 5 / 2, 0 ]
])
translate([ Ta(T24) * p[0] * i, Ta(T24) * p[1] * j, 0 ])
tile_neg(T24, Ta(T24));
}
}
}
module servo_pos(coord)
{
translate(coord) if (coord[1] > 0) { rotate([ 0, 0, -90 ]) children(); }
else { rotate([ 0, 0, 90 ]) children(); }
module bot_holder() part("red", part_name = "bot_holder", printed = true) {
bot_t = 8;
difference() {
hull() {
rotate([ 90, 0, 0 ]) tile_pos(T24, h = Ta(T24), center = true);
for (i = [ -1, 1 ])
translate([ i * Ta(T24), 0, Ta(T24) / 2 - bot_t ])
tile_pos(T24, h = bot_t, center = false);
}
rotate([ -90, 0, 0 ]) tile_neg(T24, Ta(T24), center = true);
for (i = [ -1, 1 ])
translate([ i * Ta(T24), 0, 0 ]) mirror([ 1, 0, 0 ]){
tile_screw_pos(T24){
tile_screw_hole(T24, Ta(T24), centered_hole = false);
translate([0,0,Ta(T24)/2 - bot_t]) rotate([180, 0, 0]) cylinder(r=4,h=100);
}
tile_center_hole(T24, Ta(T24)+2, center = true);
}
}
}
module
rpi4() part("green", part_name = "rpi4")
{
module servo_pos(coord) {
translate(coord) {
if (coord[1] > 0) {
rotate([ 0, 0, -90 ]) children();
} else {
rotate([ 0, 0, 90 ]) children();
}
}
}
module rpi4() part("green", part_name = "rpi4") {
translate([ -85 / 2, -56 / 2, 0 ]) import("rpi4.stl");
}
module
nucleo() part("white", part_name = "nucleo")
{
module nucleo() part("white", part_name = "nucleo") {
translate([ -43.2 / 2, -17.8 / 2, 0 ]) import("nucleo.stl");
}
module body(positions, expand = 0)
{
translate([ 0, -Ta(T24), Ta(T24) / 2 ]) rotate([ 0, 0, 90 ]) bat_set();
translate([ 0, Ta(T24), Ta(T24) / 2 ]) rotate([ 0, 0, 90 ]) bat_set();
module body(positions, expand = 0) {
translate([ 0, -Ta(T24) * 3 / 2, Ta(T24) / 2 ]) rotate([ 0, 0, 90 ])
bat_set();
translate([ 0, Ta(T24) * 3 / 2, Ta(T24) / 2 ]) rotate([ 0, 0, 90 ])
bat_set();
for (x = [ -5 / 2, 5 / 2 ]) translate([ Ta(T24) * x, 0, 0 ]) bot_holder();
for (pos = positions)
servo_pos(pos)
{
for (pos = positions) servo_pos(pos) {
rotate([ 180, 0, 0 ])
LX15D_cable_holder_B(z_offset = 2, expand = expand);
translate([ -5 * expand, 0, 0 ]) LX15D();
// TODO: this pattern repeats, make a module with LX15D_u and some
// set of screws also in: tibia
translate(LX15D_U_offset + [ -4 * expand - LX15D_U_h, 0, 0 ])
{
translate(LX15D_U_offset + [ -4 * expand - LX15D_U_h, 0, 0 ]) {
rotate([ 0, 90, 0 ]) tile_screw_pos(T24) Mscrew(M2L12C);
}
translate([ -2 * expand, 0, 0 ]) LX15D_U(T24, expand = expand);
}
translate([ -Ta(T24) * 3, 0, Ta(T24) * 1.5 + expand ])
rotate([ 0, 0, 180 ])
{
translate([ -Ta(T24) * 3, 0, Ta(T24) * 1.5 + expand ])
rotate([ 0, 0, 180 ])
{
translate([ -Ta(T24) / 2, 0, 0 ]) tile_screw_pos(T24)
rotate([ 180, 0, 0 ]) translate([ 0, 0, -2 - expand * 2 ])
Mscrew(M2L8C);
...
...
@@ -85,6 +177,6 @@ module body(positions, expand = 0)
bot_rpi_holder();
rpi_screw_pos() translate([ 0, 0, 3 - expand * 2.5 ]) Mscrew(M3L16C);
}
spine();
translate([ 0, 0, Ta(T24) / 2 ])
spine();
// translate([ 140, 0, 25 ]) { D415(); }
}
schpin_koke/src/scad/metric.scad
View file @
9456697c
...
...
@@ -3,7 +3,7 @@ include <part.scad>
// 0 1 2 3 4 5 6 7 8
// d, nut_d, nut_h, l, head_d, head_h, type, groove_offset, part_name
function M2gen(l, type, head_h, head_d, groove_offset, part_name) = //
[ 2, 4.3
2
0, 1.600, l, head_d, head_h, type, groove_offset, part_name ];
[ 2, 4.3
5
0, 1.600, l, head_d, head_h, type, groove_offset, part_name ];
function M3gen(l, type, head_h, head_d, groove_offset, part_name) = //
[ 3, 6.300, 2.500, l, head_d, head_h, type, groove_offset, part_name ];
...
...
schpin_koke/src/scad/tile.scad
View file @
9456697c
...
...
@@ -2,7 +2,7 @@
// 0 1 2 3 4 5 6 7
// [ a, screw_coord, corner_r, t, nut_d, nut_h, screw_d, name]
T36 = [ 36, [ 13, 8, 0 ], 6.000000, 3, 6.000, 2.500, 3, "T24" ];
T24 = [ 24, [ 08, 4, 0 ], 4.000000, 2, 4.
6
00, 1.800, 2, "T24" ];
T24 = [ 24, [ 08, 4, 0 ], 4.000000, 2, 4.
7
00, 1.800, 2, "T24" ];
function Ta(class) = class[0];
function Tscrew_coord(class) = class[1];
...
...
@@ -13,18 +13,16 @@ function Tnut_h(class) = class[5];
function Tscrew_d(class) = class[6];
function Tname(class) = class[7];
module tile(class, h, center = false, centered_hole = false) difference()
{
module tile(class, h, center = false, centered_hole = false) difference() {
tile_pos(class = class, h = h, center = center);
tile_neg(
class = class, h = h, center = center,
centered_hole = centered_hole);
tile_neg(
class = class, h = h, center = center,
centered_hole = centered_hole);
}
module tile_neg(class, h, center = false, centered_hole = false)
{
module tile_neg(class, h, center = false, centered_hole = false) {
translate([ 0, 0, center ? 0 : h / 2 ]) for (alpha = [ 0, 180 ])
rotate([ alpha, 0, 0 ])
tile_screw_pos(class = class) tile_screw_hole(
class = class, h = h, centered_hole = centered_hole);
rotate([ alpha, 0, 0 ])
tile_screw_neg(
class = class, h = h, centered_hole = centered_hole);
tile_center_hole(class, h + 2, center = center);
}
...
...
@@ -32,18 +30,16 @@ module tile_pos(class, h, center = false)
linear_extrude(height = h, center = center, convexity = 10)
tile_relief(class = class);
module tile_H(class, h, n = 1, center_t = undef) part(
"purple",
part_name =
str("tile_H(", Tname(class), ",", h, ",", h, ",", center_t, ")"),
printed = true) render() difference()
{
module tile_H(class, h, n = 1, center_t = undef)
part("purple",
part_name = str("tile_H(", Tname(class), ",", h, ",", h, ",", center_t,
")"),
printed = true) render() difference() {
top_offset = n * Ta(class) + h;
z_center = n * Ta(class) / 2 + h;
center_t = (center_t == undef) ? Tt(class) + 2 * Tnut_h(class) : center_t;
union()
{
union() {
translate([ 0, 0, z_center ])
cube([ Ta(class), center_t, n * Ta(class) + 2 * h ], center = true);
for (z = [ 0, top_offset ])
...
...
@@ -52,8 +48,7 @@ module tile_H(class, h, n = 1, center_t = undef) part(
}
for (i = [0.5:n])
translate([ 0, 0, h + i * Ta(class) ]) rotate([ 90, 0, 0 ])
{
translate([ 0, 0, h + i * Ta(class) ]) rotate([ 90, 0, 0 ]) {
tile_neg(class, h = center_t, center = true, centered_hole = true);
tile_center_hole(class, h = center_t, center = true);
}
...
...
@@ -68,24 +63,23 @@ module tile_H(class, h, n = 1, center_t = undef) part(
tile_screw_hole(class = class, h = h);
}
module
tile_box_side_pos()
{
module tile_box_side_pos() {
children();
for (alpha = [0:90:360])
rotate([ 90, 0, alpha ]) children();
for (alpha = [0:90:360]) rotate([ 90, 0, alpha ]) children();
rotate([ 180, 0, 0 ]) children();
}
module tile_box(class) difference()
{
hull()
{
module tile_box_base(class) {
hull() {
r = Tt(class);
cube([ Ta(class) - r, Ta(class) - r, Ta(class) ], center = true);
cube([ Ta(class), Ta(class) - r, Ta(class) - r ], center = true);
cube([ Ta(class) - r, Ta(class), Ta(class) - r ], center = true);
}
}
module tile_box(class) difference() {
tile_box_base(class);
tile_box_side_pos() cylinder(d = Ta(class) / 2, h = Ta(class));
...
...
@@ -96,12 +90,10 @@ module tile_box(class) difference()
cylinder(d = Tscrew_d(class), h = 20);
}
module tile_raw_plate(class, x, y, t)
{
module tile_raw_plate(class, x, y, t) {
for (i = [0:x - 1])
for (j = [0:y - 1])
translate([ i * Ta(class), j * Ta(class), 0 ]) difference()
{
translate([ i * Ta(class), j * Ta(class), 0 ]) difference() {
tile_pos(class, h = t, center = false);
tile_screw_pos(class = class)
cylinder(d = Tscrew_d(class), h = 100, center = true);
...
...
@@ -111,56 +103,47 @@ module tile_raw_plate(class, x, y, t)
// Implementation
// ------------------------------------
module tile_center_hole(class, h, center = false)
{
module tile_center_hole(class, h, center = false) {
cylinder(d = Ta(class) / 2, h = h, center = center, $fn = 8);
}
module tile_base_shape(l, corner_r)
{
hull()
{
module tile_base_shape(l, corner_r) {
hull() {
square([ l - corner_r * 2, l ], center = true);
square([ l, l - corner_r * 2 ], center = true);
}
}
module tile_relief(class, a, corner_r, t, nut_d)
{
module tile_relief(class, a, corner_r, t, nut_d) {
tile_base_shape(Ta(class), Tcorner(class));
}
module tile_screw_pos(class)
{
module tile_screw_pos(class) {
for (alpha = [0:90:360])
rotate([ 0, 0, alpha ]) translate(Tscrew_coord(class)) children();
}
module tile_plate(class, t) difference()
{
module tile_plate(class, t) difference() {
linear_extrude(height = t) tile_base_shape(Ta(class), Tcorner(class));
mirror([ 1, 0, 0 ]) tile_screw_pos(class)
cylinder(d = Tscrew_d(class), h = t * 3, center = true);
}
module tile_screw_hole(class, h, centered_hole = false)
{
module tile_screw_hole(class, h, centered_hole = false) {
layer_t = 0.3;
nut_e = sqrt(pow(Tnut_d(class), 2) - pow(Tnut_d(class) / 2, 2));
cylinder(d = Tscrew_d(class), h = h + 2, center = true);
if (centered_hole) {
for (alpha = [ 0, 180 ])
rotate([ alpha, 0, 0 ]) translate([ 0, 0, Tt(class) / 2 ])
{
rotate([ alpha, 0, 0 ]) translate([ 0, 0, Tt(class) / 2 ]) {
cube([ nut_e, Tscrew_d(class), layer_t * 2 ], center = true);
rotate([ 0, 0, 30 ])
cylinder(d = Tnut_d(class), h = h, $fn = 6);
}
} else {
rotate([ 180, 0, 0 ]) translate([ 0, 0, Tt(class) - h / 2 ])
{
rotate([ 180, 0, 0 ]) translate([ 0, 0, Tt(class) - h / 2 ]) {
cube([ nut_e, Tscrew_d(class), layer_t * 2 ], center = true);
rotate([ 0, 0, 30 ]) cylinder(
d = Tnut_d(class), h = h - Tt(class) + Tnut_h(class), $fn = 6);
...
...
@@ -168,7 +151,12 @@ module tile_screw_hole(class, h, centered_hole = false)
}
}
module tile_tube_hole(d)
{
module tile_screw_neg(class, h, centered_hole = false) {