forked from URJCMakerGroup/MakerWorkbench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prueba.py
471 lines (410 loc) · 22.1 KB
/
prueba.py
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
# scrip de prube para la generación de una placa con cuatro orificios para tornillos. Así mismo como la generación de los cuatro tornillos.
# En total tendremos cuatro objetos.
# El primer objeto será una placa con cuatro orificios. Los otros cuatro orificios serán tornillos.
import FreeCAD
import fcfun
from fcfun import VX, VY, VZ, V0
import parts
import fc_clss
import shp_clss
import kcomp
def placa_con_tornillos_fun():
# generamos una placa de dimensiones 100x100x10
shp_placa = fcfun.shp_box_dir(box_w=100.,
box_d=100.,
box_h=10.,
fc_axis_w=VX,
fc_axis_d=VY,
fc_axis_h=VZ,
cw=0, cd=0, ch=0,
pos=V0)
# añadimos un tornillo en la posición 1x1x1
shp_bolt1 = fcfun.shp_cyl(3., 10., normal=VZ, pos=FreeCAD.Vector(10, 10, 0))
# sustraemos la forma del primer tornillo de la placa
shp_placa_1hole = shp_placa.cut(shp_bolt1)
# añadimos un tornillo en la posición 9x1x1
shp_bolt2 = fcfun.shp_cyl(3., 10., normal=VZ, pos=FreeCAD.Vector(90, 10, 0))
# sustraemos la forma del segundo tornillo de la placa
shp_placa_2hole = shp_placa_1hole.cut(shp_bolt2)
# añadimos un tornillo en la posición 9x9x1
shp_bolt3 = fcfun.shp_cyl(3., 10., normal=VZ, pos=FreeCAD.Vector(90, 90, 0))
# sustraemos la forma del tercero tornillo de la placa
shp_placa_3hole = shp_placa_2hole.cut(shp_bolt3)
# añadimos un tornillo en la posición 1x9x1
shp_bolt4 = fcfun.shp_cyl(3., 10., normal=VZ, pos=FreeCAD.Vector(10, 90, 0))
# sustraemos la forma del cuarto tornillo de la placa
shp_placa_4hole = shp_placa_3hole.cut(shp_bolt4)
# convertimos la placa con cuatro tornillos en objeto
placa_4hole = FreeCAD.ActiveDocument.addObject("Part::Feature", "Placa_perforada")
placa_4hole.Shape = shp_placa_4hole
# generamos cuatro tornillos individualmente y los convertimos a objetos individualmente
tornillo_1 = fc_clss.Din912Bolt(metric=3, shank_l=10,
shank_l_adjust=0,
shank_out=0,
head_out=0,
axis_h=-VZ, axis_d=None, axis_w=None,
pos_h=0, pos_d=0, pos_w=0,
pos=V0 + FreeCAD.Vector(10, 10, 10),
model_type=0,
name='bolt1')
tornillo_2 = fc_clss.Din912Bolt(metric=3, shank_l=10,
shank_l_adjust=0,
shank_out=0,
head_out=0,
axis_h=-VZ, axis_d=None, axis_w=None,
pos_h=0, pos_d=0, pos_w=0,
pos=V0 + FreeCAD.Vector(90, 10, 10),
model_type=0,
name='bolt2')
tornillo_3 = fc_clss.Din912Bolt(metric=3, shank_l=10,
shank_l_adjust=0,
shank_out=0,
head_out=0,
axis_h=-VZ, axis_d=None, axis_w=None,
pos_h=0, pos_d=0, pos_w=0,
pos=V0 + FreeCAD.Vector(90, 90, 10),
model_type=0,
name='bolt3')
tornillo_4 = fc_clss.Din912Bolt(metric=3, shank_l=10,
shank_l_adjust=0,
shank_out=0,
head_out=0,
axis_h=-VZ, axis_d=None, axis_w=None,
pos_h=0, pos_d=0, pos_w=0,
pos=V0 + FreeCAD.Vector(10, 90, 10),
model_type=0,
name='bolt4')
class placa(shp_clss.Obj3D):
"""
w_0 w_1 w_2
. . .
. . .
_____________________ _ _ _ h_1
/ /| _ _ _ d_2 h_0
/ / /
/ / / _ _ _ d_1
/____________________/ /
|____________________|/ _ _ _ d_0
"""
def __init__(self, w, d, h, pos):
shp_clss.Obj3D.__init__(self, axis_d=VY, axis_w=V0, axis_h=VZ)
self.shp_placa = fcfun.shp_box_dir_xtr(box_w=w, box_d=d, box_h=h, fc_axis_h=VZ, fc_axis_d=VY, fc_axis_w=V0,
cw=0, cd=0, ch=0, pos=pos)
class placa_con_tornillos(fc_clss.Din912Bolt, placa):
def __init__(self, d, w, h, pos):
placa.__init__(self, w, d, h, pos)
shp_placa = self.shp_placa
metric = 3
bolt_dict = kcomp.D912[metric]
thread_l = 18
shank_l = 30
shp_clss.ShpBolt.__init__(self, shank_r=bolt_dict['d'] / 2.,
shank_l=shank_l,
head_r=bolt_dict['head_r'],
head_l=bolt_dict['head_l'],
thread_l=thread_l,
head_type=0, # cylindrical. 1: hexagonal
socket_l=bolt_dict['head_l'],
socket_2ap=bolt_dict['ap2'],
shank_out=0,
head_out=1,
axis_h=-VZ, axis_d=None, axis_w=None,
pos_h=0, pos_d=0, pos_w=0,
pos=pos + FreeCAD.Vector(w * 0.1, d * 0.1, h))
shp_placa = shp_placa.cut(self.shp)
shp_clss.ShpBolt.__init__(self, shank_r=bolt_dict['d'] / 2.,
shank_l=shank_l,
head_r=bolt_dict['head_r'],
head_l=bolt_dict['head_l'],
thread_l=thread_l,
head_type=0, # cylindrical. 1: hexagonal
socket_l=bolt_dict['head_l'],
socket_2ap=bolt_dict['ap2'],
shank_out=0,
head_out=1,
axis_h=-VZ, axis_d=None, axis_w=None,
pos_h=0, pos_d=0, pos_w=0,
pos=pos + FreeCAD.Vector(w * 0.9, d * 0.1, h))
shp_placa = shp_placa.cut(self.shp)
shp_clss.ShpBolt.__init__(self, shank_r=bolt_dict['d'] / 2.,
shank_l=shank_l,
head_r=bolt_dict['head_r'],
head_l=bolt_dict['head_l'],
thread_l=thread_l,
head_type=0, # cylindrical. 1: hexagonal
socket_l=bolt_dict['head_l'],
socket_2ap=bolt_dict['ap2'],
shank_out=0,
head_out=1,
axis_h=-VZ, axis_d=None, axis_w=None,
pos_h=0, pos_d=0, pos_w=0,
pos=pos + FreeCAD.Vector(w * 0.9, d * 0.9, h))
shp_placa = shp_placa.cut(self.shp)
shp_clss.ShpBolt.__init__(self, shank_r=bolt_dict['d'] / 2.,
shank_l=shank_l,
head_r=bolt_dict['head_r'],
head_l=bolt_dict['head_l'],
thread_l=thread_l,
head_type=0, # cylindrical. 1: hexagonal
socket_l=bolt_dict['head_l'],
socket_2ap=bolt_dict['ap2'],
shank_out=0,
head_out=1,
axis_h=-VZ, axis_d=None, axis_w=None,
pos_h=0, pos_d=0, pos_w=0,
pos=pos + FreeCAD.Vector(w * 0.1, d * 0. * 9, h))
self.shp_placa_con_tornillos = shp_placa.cut(self.shp)
# placa con tornillos tertminada
class fco_placa_con_tornillos(placa_con_tornillos):
def __init__(self, w, d, h, pos):
fco = FreeCAD.ActiveDocument.addObject("Part::Feature", "Placa con tornillos")
placa_con_tornillos.__init__(self, w, d, h, pos) # return self.shp
metric = 3
bolt_dict = kcomp.D912[metric]
thread_l = 18
shank_l = 30
shp_clss.ShpBolt.__init__(self, shank_r=bolt_dict['d'] / 2.,
shank_l=shank_l,
head_r=bolt_dict['head_r'],
head_l=bolt_dict['head_l'],
thread_l=thread_l,
head_type=0, # cylindrical. 1: hexagonal
socket_l=bolt_dict['head_l'],
socket_2ap=bolt_dict['ap2'],
shank_out=0,
head_out=1,
axis_h=-VZ, axis_d=None, axis_w=None,
pos_h=0, pos_d=0, pos_w=0,
pos=pos + FreeCAD.Vector(w * 0.1, d * 0.1, h))
self.shp_placa_con_tornillos = self.shp_placa_con_tornillos.fuse(self.shp)
shp_clss.ShpBolt.__init__(self, shank_r=bolt_dict['d'] / 2.,
shank_l=shank_l,
head_r=bolt_dict['head_r'],
head_l=bolt_dict['head_l'],
thread_l=thread_l,
head_type=0, # cylindrical. 1: hexagonal
socket_l=bolt_dict['head_l'],
socket_2ap=bolt_dict['ap2'],
shank_out=0,
head_out=1,
axis_h=-VZ, axis_d=None, axis_w=None,
pos_h=0, pos_d=0, pos_w=0,
pos=pos + FreeCAD.Vector(w * 0.1, d * 0.9, h))
self.shp_placa_con_tornillos = self.shp_placa_con_tornillos.fuse(self.shp)
shp_clss.ShpBolt.__init__(self, shank_r=bolt_dict['d'] / 2.,
shank_l=shank_l,
head_r=bolt_dict['head_r'],
head_l=bolt_dict['head_l'],
thread_l=thread_l,
head_type=0, # cylindrical. 1: hexagonal
socket_l=bolt_dict['head_l'],
socket_2ap=bolt_dict['ap2'],
shank_out=0,
head_out=1,
axis_h=-VZ, axis_d=None, axis_w=None,
pos_h=0, pos_d=0, pos_w=0,
pos=pos + FreeCAD.Vector(w * 0.9, d * 0.9, h))
self.shp_placa_con_tornillos = self.shp_placa_con_tornillos.fuse(self.shp)
shp_clss.ShpBolt.__init__(self, shank_r=bolt_dict['d'] / 2.,
shank_l=shank_l,
head_r=bolt_dict['head_r'],
head_l=bolt_dict['head_l'],
thread_l=thread_l,
head_type=0, # cylindrical. 1: hexagonal
socket_l=bolt_dict['head_l'],
socket_2ap=bolt_dict['ap2'],
shank_out=0,
head_out=1,
axis_h=-VZ, axis_d=None, axis_w=None,
pos_h=0, pos_d=0, pos_w=0,
pos=pos + FreeCAD.Vector(w * 0.9, d * 0.1, h))
self.shp_placa_con_tornillos = self.shp_placa_con_tornillos.fuse(self.shp)
fco.Shape = self.shp_placa_con_tornillos
def Prisma_hueco():
# generamos una caja de 100x100x100 como base de este ejemplo
shp_caja = fcfun.shp_box_dir_xtr(100, 100, 100, fc_axis_h=VZ, fc_axis_d=VY, fc_axis_w=V0, cw=0, cd=0, ch=0, pos=V0)
# generamos una segunda forma que será una segunda caja de 100x80x80
shp_caja_2 = fcfun.shp_box_dir_xtr(100, 80, 80, fc_axis_h=VZ, fc_axis_d=VY, fc_axis_w=V0, cw=0, cd=0, ch=0,
pos=V0 + FreeCAD.Vector(0, 10, 10))
# restamos a shp_caja shp_caja_2 para realizar un prisma hueco por una cara
shp_caja = shp_caja.cut(shp_caja_2)
# PRUEBA DE LA GENERACIÓN DEL SHAPE POR FASES
# form1 = FreeCAD.ActiveDocument.addObject("Part::Feature","Prisma hueco 1")
# form1.Shape = shp_caja
# generamos una tercera forma que será una tercera caja de 80x100x80
shp_caja_3 = fcfun.shp_box_dir_xtr(80, 100, 80, fc_axis_h=VZ, fc_axis_d=VY, fc_axis_w=V0, cw=0, cd=0, ch=0,
pos=V0 + FreeCAD.Vector(10, 0, 10))
# restamos a shp_form shp_caja_3 para realizar un prisma hueco por dos caras
shp_caja = shp_caja.cut(shp_caja_3)
# PRUEBA DE LA GENERACIÓN DEL SHAPE POR FASES
# form2 = FreeCAD.ActiveDocument.addObject("Part::Feature","Prisma hueco 2")
# form2.Shape = shp_caja
# generamos una cuarta forma que será una cuarta caja de 80x80x100
shp_caja_4 = fcfun.shp_box_dir_xtr(80, 80, 100, fc_axis_h=VZ, fc_axis_d=VY, fc_axis_w=V0, cw=0, cd=0, ch=0,
pos=V0 + FreeCAD.Vector(10, 10, 0))
# restamos a shp_form shp_caja_4 para realizar un prisma hueco por dos caras
shp_caja = shp_caja.cut(shp_caja_4)
form = FreeCAD.ActiveDocument.addObject("Part::Feature", "Prisma hueco")
form.Shape = shp_caja.removeSplitter()
def silla_fun():
# vamos a generar una silla sencilla con primas
# Primero hacemos el asiento
shp_silla = fcfun.shp_box_dir_xtr(box_w=450, box_d=450, box_h=25, fc_axis_h=VZ, fc_axis_d=VY, fc_axis_w=V0, cw=0,
cd=0, ch=0, pos=V0)
# hacemos el respaldo
shp_respaldo = fcfun.shp_box_dir_xtr(box_w=450, box_d=25, box_h=600, fc_axis_h=VZ, fc_axis_d=VY, fc_axis_w=V0, cw=0,
cd=0, ch=0, pos=V0 + FreeCAD.Vector(0, 425, 0))
shp_silla = shp_silla.fuse(shp_respaldo)
shp_pata_1 = fcfun.shp_box_dir_xtr(box_w=25, box_d=25, box_h=400, fc_axis_h=VZ, fc_axis_d=VY, fc_axis_w=V0, cw=0,
cd=0, ch=0, pos=V0 + FreeCAD.Vector(0, 425, -400))
shp_silla = shp_silla.fuse(shp_pata_1)
shp_pata_2 = fcfun.shp_box_dir_xtr(box_w=25, box_d=25, box_h=400, fc_axis_h=VZ, fc_axis_d=VY, fc_axis_w=V0, cw=0,
cd=0, ch=0, pos=V0 + FreeCAD.Vector(425, 425, -400))
shp_silla = shp_silla.fuse(shp_pata_2)
shp_pata_3 = fcfun.shp_box_dir_xtr(box_w=25, box_d=25, box_h=400, fc_axis_h=VZ, fc_axis_d=VY, fc_axis_w=V0, cw=0,
cd=0, ch=0, pos=V0 + FreeCAD.Vector(425, 0, -400))
shp_silla = shp_silla.fuse(shp_pata_3)
shp_pata_4 = fcfun.shp_box_dir_xtr(box_w=25, box_d=25, box_h=400, fc_axis_h=VZ, fc_axis_d=VY, fc_axis_w=V0, cw=0,
cd=0, ch=0, pos=V0 + FreeCAD.Vector(0, 0, -400))
shp_silla = shp_silla.fuse(shp_pata_4)
silla = FreeCAD.ActiveDocument.addObject("Part::Feature", "Silla")
silla.Shape = shp_silla.removeSplitter()
class pata(shp_clss.Obj3D):
""" pata de la silla
w_0 w_1
. .
.____. _ _ _ h_2
/___/|
| ||
| ||
| ||
| || _ _ _ h_1
| ||
| ||
| ||
|___|/ _ _ _ h_0
prisma rectangular
"""
def __init__(self, w, d, h, pos):
shp_clss.Obj3D.__init__(self, axis_d=VY, axis_w=V0, axis_h=VZ)
self.shp_pata = fcfun.shp_box_dir_xtr(box_w=w, box_d=d, box_h=h, fc_axis_h=VZ, fc_axis_d=VY, fc_axis_w=V0, cw=0,
cd=0, ch=0, pos=pos)
self.shp_pata.h_0 = pos
self.shp_pata.h_1 = pos + h / 2
self.shp_pata.h_2 = pos + h
self.shp_pata.w_0 = pos
self.shp_pata.w_1 = pos + w / 2
self.shp_pata.w_2 = pos + w
self.shp_pata.d_0 = pos
self.shp_pata.d_1 = pos + d / 2
self.shp_pata.d_2 = pos + d
"""def shp_pata_fun(w, d, h, pos):
shp_pata = fcfun.shp_box_dir_xtr(box_w=w, box_d=d, box_h=h, fc_axis_h=VZ, fc_axis_d=VY, fc_axis_w=V0, cw=0, cd=0, ch=0, pos=pos)
return (shp_pata)"""
class respaldo(shp_clss.Obj3D):
""" respaldo de la silla
w_0 w_1 w_2
. . .
. . .
____________________________ _ _ _ h_2
/___________________________/|
| ||
| ||
| ||
| ||
| || _ _ _ h_1
| ||
| ||
| ||
| ||
| ||
| || _ _ _ h_0
|___________________________|/
"""
def __init__(self, w, d, h, pos):
shp_clss.Obj3D.__init__(self, axis_d=VY, axis_w=V0, axis_h=VZ)
self.shp_respaldo = fcfun.shp_box_dir_xtr(box_w=w, box_d=d, box_h=h, fc_axis_h=VZ, fc_axis_d=VY, fc_axis_w=V0,
cw=0, cd=0, ch=0, pos=pos)
self.shp_respaldo.h_0 = pos
self.shp_respaldo.h_1 = pos + h / 2
self.shp_respaldo.h_2 = pos + h
self.shp_respaldo.w_0 = pos
self.shp_respaldo.w_1 = pos + w / 2
self.shp_respaldo.w_2 = pos + w
self.shp_respaldo.d_0 = pos
self.shp_respaldo.d_1 = pos + d / 2
self.shp_respaldo.d_2 = pos + d
"""def shp_respando_fun(w, d, h, pos):
shp_respaldo = fcfun.shp_box_dir_xtr(box_w=w, box_d=d, box_h=h, fc_axis_h=VZ, fc_axis_d=VY, fc_axis_w=V0, cw=0, cd=0, ch=0, pos=pos)
return (shp_respaldo)"""
class asiento(shp_clss.Obj3D):
""" asiento de la silla
w_0 w_1 w_2
. . .
. . .
_____________________ _ _ _ h_1
/ /| _ _ _ d_2 h_0
/ / /
/ / / _ _ _ d_1
/____________________/ /
|____________________|/ _ _ _ d_0
"""
def __init__(self, w, d, h, pos):
shp_clss.Obj3D.__init__(self, axis_d=VY, axis_w=V0, axis_h=VZ)
self.shp_asiento = fcfun.shp_box_dir_xtr(box_w=w, box_d=d, box_h=h, fc_axis_h=VZ, fc_axis_d=VY, fc_axis_w=V0,
cw=0, cd=0, ch=0, pos=pos)
self.shp_asiento.h_0 = pos
self.shp_asiento.h_1 = pos + h / 2
self.shp_asiento.h_2 = pos + h
self.shp_asiento.w_0 = pos
self.shp_asiento.w_1 = pos + w / 2
self.shp_asiento.w_2 = pos + w
self.shp_asiento.d_0 = pos
self.shp_asiento.d_1 = pos + d / 2
self.shp_asiento.d_2 = pos + d
"""def shp_asiento_fun(w, d, h, pos):
shp_asiento = fcfun.shp_box_dir_xtr(box_w=w, box_d=d, box_h=h, fc_axis_h=VZ, fc_axis_d=VY, fc_axis_w=V0, cw=0, cd=0, ch=0, pos=pos)
return (shp_asiento)"""
"""class silla(shp_clss.Obj3D): #Funciona
def __init__(self,w,d,h,h_resp,pos):
shp_clss.Obj3D.__init__(self,axis_d = VY, axis_w=V0, axis_h=VZ)
shp_asiento = shp_asiento_fun(w,d,25,pos+FreeCAD.Vector(0,0,h-h_resp))
shp_silla = shp_asiento.removeSplitter()
# Tenemos asiento
shp_respaldo = shp_respando_fun(w,25,h_resp,pos+FreeCAD.Vector(0,w-25,h-h_resp))
shp_silla = shp_silla.fuse(shp_respaldo)
# Asiento con resplado
shp_silla = shp_silla.fuse(shp_pata_fun(25,25,h-h_resp,pos+FreeCAD.Vector(0,0,0)))
shp_silla = shp_silla.fuse(shp_pata_fun(25,25,h-h_resp,pos+FreeCAD.Vector(w-25,0,0)))
shp_silla = shp_silla.fuse(shp_pata_fun(25,25,h-h_resp,pos+FreeCAD.Vector(w-25,d-25,0)))
shp_silla = shp_silla.fuse(shp_pata_fun(25,25,h-h_resp,pos+FreeCAD.Vector(0,d-25,0)))
# Asiento con respaldo y patas
self.shp = shp_silla.removeSplitter()"""
class silla(asiento, respaldo, pata):
def __init__(self, w, d, h, h_resp, pos):
asiento.__init__(self, w, d, 25, pos + FreeCAD.Vector(0, 0, h - h_resp)) # return self.shp_asiento
shp_silla = self.shp_asiento
# Tenemos asiento
respaldo.__init__(self, w, 25, h_resp, pos + FreeCAD.Vector(0, w - 25, h - h_resp)) # return self.shp_respaldo
shp_silla = shp_silla.fuse(self.shp_respaldo)
# Tenemos asiento con respaldo
""" Como hacemos para tener distintos shape con el mismo nombre?
self.shp_silla.d_0 es distinto para cada pata pero no podremos distinguierlo como está ahora mismo"""
pata.__init__(self, 25, 25, h - h_resp, pos + FreeCAD.Vector(0, 0, 0)) # return self.shp_pata
shp_silla = shp_silla.fuse(self.shp_pata)
# Tenemos una pata
pata.__init__(self, 25, 25, h - h_resp, pos + FreeCAD.Vector(w - 25, 0, 0)) # return self.shp_pata
shp_silla = shp_silla.fuse(self.shp_pata)
# Tenemos dos patas
pata.__init__(self, 25, 25, h - h_resp, pos + FreeCAD.Vector(w - 25, d - 25, 0)) # return self.shp_pata
shp_silla = shp_silla.fuse(self.shp_pata)
# Tenemos tres patas
pata.__init__(self, 25, 25, h - h_resp, pos + FreeCAD.Vector(0, d - 25, 0)) # return self.shp_pata
shp_silla = shp_silla.fuse(self.shp_pata)
# Tenemos la silla entera
self.shp = shp_silla.removeSplitter()
class fco_silla(silla):
def __init__(self, w, d, h, h_resp, pos):
fco = FreeCAD.ActiveDocument.addObject("Part::Feature", "Silla")
silla.__init__(self, w, d, h, h_resp, pos) # return self.shp
fco.Shape = self.shp