-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.jscad
251 lines (223 loc) · 4.82 KB
/
main.jscad
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
// title : Main - Hand Assembler.
// author : Gino Tubaro
// license : MIT License
// description: General assembly document
// file : main.jscad
// Current files are:
//-------------------> conectores.jscad
//-------------------> barras.jscad
//-------------------> cover.jscad
//-------------------> tornillotuerca.jscad
//-------------------> barras.jscad
//-------------------> barras.jscad
//-------------------> barras.jscad
// Functions:
// Parts: conectores.jscad
// pin_tapa(h, r, lh, lt) Devuelve pin con tapa
// pin(h, r, lh, lt, side) Devuelve pin sin tapa
// pin_doble(h, r, lh, lt, gap)
// Params:
// h:altura, r: radio, lh: lipheight, lt: lipthickness
// bh: base_height br: base_radius, gap: distancia entre pines
//
// Functions:
// Parts: barras.jscad
// slider(x,y,z) devuelve barra
// Params:
// x:pos inicial, y: pos final, z: curvatura (0= barra derecha)
//
// To Implement:
//INCHS - MM -> util.INCH(x)
include('lodash.js');
include("node_modules/jscad-utils/jscad-utils.jscad");
include("node_modules/jscad-utils/jscad-utils-color.jscad");
include('node_modules/jscad-utils/jscad-utils-parts.jscad');
include('node_modules/jscad-utils/jscad-boxes.jscad');
include ("formulas.jscad");
include ("esqueleto.jscad");
include ("conectores.jscad");
include ("barras.jscad");
include ("formulas.jscad");
include ("cover.jscad");
include ("tornillotuerca.jscad");
//include ("bridev2.jscad");
//include ("upperarm.jscad");
//include ("pulgar.jscad");
//include ("lib0.jscad");
//include ("bridge.jscad");
function getParameterDefinitions() {
return [
/* PARAMETROS DE PIEZAS
//parametros Palm connectorx2
{
name: 'x', //longitudinal
type: 'float',
initial: 20,
caption: "x alto:"
},
{
name: 'y', //radial
type: 'float',
initial: 5,
caption: "y ancho:"
},
{
name: 'dual', //Boolean de modo FIXED en 0
type: 'choice',
caption: "Doble",
values:["1", "0"],
captions:["Si", "No"],
initial: "Si"
},
{
name: 'baseh',
type: 'float',
initial: 4,
caption: "anchobase:"
},
//parametros UpperArm - Thumb clip
{
name: 'x1',
type: 'float',
initial: 20,
caption: "CLIPx alto:"
},
{
name: 'y1',
type: 'float',
initial: 5,
caption: "y ancho:"
},
{
name: 'dual1',
type: 'choice',
caption: "Doble",
values:["1", "0"],
captions:["Si", "No"],
initial: "Si" },
{
name: 'baseh1',
type: 'float',
initial: 4,
caption: "anchobase:"
},
//parametros UpperArm - Utilities
{
name: 'x2',
type: 'float',
initial: 20,
caption: "Utilitiesx alto:"
},
{
name: 'y2',
type: 'float',
initial: 5,
caption: "y ancho:"
},
{
name: 'dual2',
type: 'choice',
caption: "Doble",
values:["1", "0"],
captions:["Si", "No"],
initial: "Si" },
{
name: 'baseh2',
type: 'float',
initial: 4,
caption: "anchobase:"
},
//Barras
{
name: 'xbar',
type: 'float',
initial: 11,
caption: "BARRAx alto:"
},
{
name: 'ybar',
type: 'float',
initial: 6,
caption: "y ancho:"
},
*/
//Tamaño muñeca
{
name: 'xtop',
type: 'float',
initial: 70,
caption: "Ancho Superior del muñon"
},
//Tamaño muñon sup
{
name: 'x',
type: 'float',
initial: 50,
caption: "Ancho de la muñeca"
},
//Largo de la palma
{
name: 'ypalm',
type: 'float',
initial: 30,
caption: "Largo del muñon"
},
//Ancho Palma
{
name: 'zpalm',
type: 'float',
initial: 50,
caption: "Ancho del muñon"
},
//Largo Antebrazo
{
name: 'yua',
type: 'float',
initial: 50,
caption: "Largo del Antebrazo"
},
//Ancho Antebrazo
{
name: 'zua',
type: 'float',
initial: 50,
caption: "Ancho del Antebrazo."
},
//longitudinal Antebrazo inferior
{
name: 'xbottomua',
type: 'float',
initial: 50,
caption: "Ancho inferior del Antebrazo"
},
];
}
function main(params) {
util.init(CSG);
var enableall = 0; // test mode
if(enableall){
return [
conector(params.x,params.y,0,params.baseh), // UpperArm - Palm connectorx2
conector(params.x,params.y,0,params.baseh).mirroredY(), // UpperArm - Palm connectorx2
conector(params.x2,params.y2,1,params.baseh2).translate([30, 0, 0]), // UpperArm - Utilities
conector(params.x2,params.y2,1,params.baseh2).translate([30, 30, 0]), // UpperArm - Utilities
conector(params.x1,params.y1,0,params.baseh1).translate([-30, 30, 0]), // UpperArm - Thumb short conector
barra(params.xbar,params.ybar)
];
}else {// TEST AREA
return[
// Crear esqueleto del muñon
//AtomicLabCover(10),anchoprocesado
//AtomicLabCover(30,2)
//slider(0,30,2)
// x2 (50,4)
// slider(10,2)
// stumpE(params.xtop,params.x,params.ypalm,params.zpalm),
// wristE(params.x,params.zpalm),
// UpperArmE(params.x,params.xbottomua,params.yua,params.zua),
//Crear elementos de la protesis
];
}
}
// include:js
// endinject