-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbed_08_beams.py
57 lines (45 loc) · 2.19 KB
/
bed_08_beams.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
import cadquery as cq
import sys
import copy
import beam
from beam import *
filename_base = "gridbeam_bed_07"
spacing = default_beam_args.half_unit / 4
stride = spacing + default_beam_args.unit
base = stride + stride / 2 #spacing /+ default_beam_args.unit
step = [int(0)]
y = [int(0)]
def post(i):
old = i[0]
i[0] += 1
return old * stride
result = build_grid_beam_capped_x(default_beam_args, 40,1, 1).translate([0, stride / 2, 0])
#result += build_grid_beam_capped_x(default_beam_args, 30,1, 1).translate([0, base + post(step), 0])
#result += build_grid_beam_capped_x(default_beam_args, 30,1, 1).translate([0, base + post(step), 0])
#result += build_grid_beam_capped_x(default_beam_args, 30,1, 1).translate([0, base + post(step), 0])
result += build_grid_beam_capped_x(default_beam_args, 30,1, 1).translate([0, base + post(step), 0])
result += build_grid_beam_capped_x(default_beam_args, 20,1, 1).translate([0, base + post(step), 0])
result += build_grid_beam_capped_x(default_beam_args, 20,1, 1).translate([0, base + post(step), 0])
result += build_grid_beam_capped_x(default_beam_args, 20,1, 1).translate([0, base + post(step), 0])
result += build_grid_beam_capped_x(default_beam_args, 20,1, 1).translate([0, base + post(step), 0])
#post(step)
#post(step)
#result += build_grid_beam_only_vertical(default_beam_args, 4,4, 1).translate([0, base + post(step), 0])
result = result.rotate([0,0,0], [0,0,1],45)
singles = cq.Workplane("XY" )
for h in range(1, 9):
y[0] += 1
step[0] = 0
for i in range(2):
#result += build_grid_beam_spacer(default_beam_args, h).translate([post(step), y[0] * stride, h/2])
singles += build_grid_beam_only_vertical(default_beam_args, 1, 1, 1).translate([default_beam_args.half_unit + spacing + post(step), y[0] * stride, 0])
singles = singles.rotate([0,0,0], [0,0,1],-45)
result += singles
#result += result.rotate([0,0,0], [0,0,1], 180)
#result += result.rotate([0,0,0], [0,0,1], 90)
#result = result.clean()
cq.exporters.export(result, filename_base+".3mf")
# Visualise with the bed attached:
bed = cq.Workplane("XY" ).box(300, 300, 1).translate([0, 0, -default_beam_args.half_unit - spacing])
result += bed
cq.exporters.export(result, filename_base+".svg")