/
squarevise.scad
133 lines (116 loc) · 3.28 KB
/
squarevise.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
include <defs.scad>
use <threads.scad>
use <slab.scad>
use <short_wall.scad>
use <tall_wall.scad>
use <assembly.scad>
module PinMatrix()
{
pin_z = 150;
pin_x = 2;
matrix_pad = 15;
pin_pad = 0.0000;
mx_pin_start = tall_wall_thickness + linear_rod_offset + matrix_pad + ptol;
mx_pin_end = tall_wall_thickness + short_wall_l - linear_rod_offset - matrix_pad - ptol;
my_pin_start = short_wall_thickness + slab_thickness + ptol + matrix_pad;
my_pin_end = tall_wall_l - short_wall_thickness - slab_thickness - ptol - matrix_pad;
step = pin_x + pin_pad;
steps_x = (mx_pin_end - mx_pin_start)/step;
steps_y = (my_pin_end - my_pin_start)/step;
translate([tall_wall_thickness + linear_rod_offset + matrix_pad + ptol,
short_wall_thickness + slab_thickness + ptol + matrix_pad, -50])
{
for (x = [0 : 1 : steps_x])
for (y = [0 : 1 : steps_y])
{
xx = abs(steps_x/2 - x + .5);
yy = abs(steps_y/2 - y + .5);
translate([step*x,step*y,
apply_mold ? ((x == 0 || x == floor(steps_x) || y == 0 || y == floor(steps_y)) ? 0 : -abs(xx)+-abs(yy)) : 0
])
cube([pin_x,pin_x,pin_z]);
}
}
}
module Solids()
{
short_wall_origin()
{
ShortWall();
translate([0, inside_width + short_wall_thickness + ptol]) ShortWall();
}
tall_wall_origin()
{
TallWall();
translate([tall_wall_thickness + outside_width + ptol,0,0])
{
TallWall();
}
}
to_slab_positions()
{
color("green") make_slab();
}
}
module Holes()
{
to_slab_positions()
{
make_slab_holes()
{
make_linear_hole();
make_bearing_insert();
make_linear_hole();
}
}
}
module Assembly()
{
to_slab_positions_x(0,0)
{
make_slab_holes()
{
color("purple")
{
translate([0,-outside_width/12,0]) rotate([-90,0,0]) cylinder(outside_width+20,linear_bearing_inside_r,linear_bearing_inside_r);
cube([0,0,0]);
translate([0,-outside_width/12,0]) rotate([-90,0,0]) cylinder(outside_width+20,linear_bearing_inside_r,linear_bearing_inside_r);
}
}
}
to_slab_positions_y(0,0)
{
make_slab_holes()
{
color("purple")
{
translate([0,-outside_width/9,0]) rotate([-90,0,0]) cylinder(outside_width,linear_bearing_inside_r,linear_bearing_inside_r);
cube([0,0,0]);
translate([0,-outside_width/9,0]) rotate([-90,0,0]) cylinder(outside_width,linear_bearing_inside_r,linear_bearing_inside_r);
}
}
}
to_slab_positions()
{
make_slab_holes()
{
cube([0,0,0]);
color("blue") rotate([-90,0,180])
if (model_threads)
metric_thread(bearing_inside_r*2,1,outside_width/2);
else
cylinder(outside_width/2,bearing_inside_r,bearing_inside_r);
cube([0,0,0]);
}
}
PinMatrix();
}
translate([0,0,0])
{
difference()
{
Solids();
Holes();
}
Assembly();
}