import sand3d as s3d
def trolley():
root = s3d.at(body_01(), x=3, y=9, z=113)
a = s3d.at(wheel_02(), x=-267, y=-405.5, z=21)
b = s3d.at(wheel_02(tire_name=class="tok-string">"01"), x=272, y=-405.5, z=21)
c = s3d.at(wheel_04(), x=-267, y=514.5, z=21)
d = s3d.at(wheel_04(tire_name=class="tok-string">"03"), x=272, y=514.5, z=21)
s3d.joint(class="tok-string">"joint_wheel_02_joint_00", a, s3d.local(root, x=-270, y=-460, z=-3), kind=class="tok-string">"continuous", axis=class="tok-string">"+Z")
s3d.joint(class="tok-string">"joint_wheel_01_joint_00", b, s3d.local(root, x=269, y=-460, z=-3), kind=class="tok-string">"continuous", axis=class="tok-string">"+Z")
s3d.joint(class="tok-string">"joint_wheel_04_joint_00", c, s3d.local(root, x=-270, y=460, z=-3), kind=class="tok-string">"continuous", axis=class="tok-string">"+Z")
s3d.joint(class="tok-string">"joint_wheel_03_joint_00", d, s3d.local(root, x=269, y=460, z=-3), kind=class="tok-string">"continuous", axis=class="tok-string">"+Z")
return s3d.assembly(class="tok-string">"trolley", root, a, b, c, d)
def body_01(w=540, d=920, tube=22, top=637, low=129, sheet=5, rim=10, apron=22, handle=765, bend=55):
solids = []
for z in (low, top):
plate = s3d.at(s3d.box(class="tok-string">"shelf", w, d, sheet), z=z-sheet/2)
solids.append(plate)
for x in (-w/2, w/2):
solids.append(s3d.at(s3d.box(class="tok-string">"long_fold", sheet, d, apron), x=x, z=z-apron/2))
solids.append(s3d.at(s3d.cylinder(class="tok-string">"long_rim", rim, d), x=x, y=d/2, z=z+rim/2, rx=90))
for y in (-d/2, d/2):
solids.append(s3d.at(s3d.box(class="tok-string">"end_fold", w, sheet, apron), y=y, z=z-apron/2))
solids.append(s3d.at(s3d.cylinder(class="tok-string">"end_rim", rim, w), x=-w/2, y=y, z=z+rim/2, ry=90))
for x in (-w/2, w/2):
solids.append(s3d.at(s3d.cylinder(class="tok-string">"post", tube, top+apron), x=x, y=d/2))
path = [(-w/2,-d/2,0),(-w/2,-d/2,handle), (w/2,-d/2,handle),(w/2,-d/2,0)]
solids.append(s3d.wire(class="tok-string">"handle", path=path, d=tube, fillet=bend))
for ob in solids:
s3d.material(ob, class="tok-string">"brushed_steel")
return s3d.group(class="tok-string">"body_01", solids)
def wheel_02(w=38, d=135, h=92, wall=5, collar=40, tire_name=class="tok-string">"02"):
cap = s3d.at(s3d.cylinder(class="tok-string">"swivel", d=collar, h=8), y=-45.5, z=h-8)
profile = s3d.poly([(-62, h-7),(-27,h-7),(9,40),s3d.arc(center=(-15,26),r=25,start=30,end=-145),(-58,48)])
cheek = s3d.at(s3d.extrude(class="tok-string">"fork", profile, h=wall), x=-w/2, rx=90, rz=90)
twin = s3d.transform(s3d.copy(cheek), x=w-wall)
tab = s3d.at(s3d.box(class="tok-string">"brake", w-7, 62, 6), y=d/2-31, z=62)
metal = s3d.group(class="tok-string">"forks", cap, cheek, twin, tab)
s3d.material(metal,class="tok-string">"steel")
tire = s3d.at(tire_02(), x=-0.5, y=-15, z=-21)
s3d.joint(class="tok-string">"joint_tire_"+tire_name+class="tok-string">"_joint_00", tire, s3d.local(metal, x=4, y=-15, z=26), kind=class="tok-string">"continuous", axis=class="tok-string">"+X")
return s3d.group(class="tok-string">"wheel_02", metal, tire)
def tire_02(w=23, d=93):
wheel = s3d.at(s3d.cylinder(class="tok-string">"tire", d=d, h=w), x=-w/2, z=d/2, ry=90)
s3d.fillet(wheel, r=4)
s3d.material(wheel,class="tok-string">"rubber",color=class="tok-string">"class="tok-comment">#333333")
return s3d.group(class="tok-string">"tire_02",wheel)
def wheel_04(w=38, d=135, h=92, wall=5, collar=40, tire_name=class="tok-string">"04"):
cap = s3d.at(s3d.cylinder(class="tok-string">"swivel", d=collar, h=8), y=-45.5, z=h-8)
profile = s3d.poly([(-62, h-7),(-27,h-7),(9,40),s3d.arc(center=(-15,26),r=25,start=30,end=-145),(-58,48)])
cheek = s3d.at(s3d.extrude(class="tok-string">"fork", profile, h=wall), x=-w/2, rx=90, rz=90)
twin = s3d.transform(s3d.copy(cheek), x=w-wall)
tab = s3d.at(s3d.box(class="tok-string">"brake", w-7, 62, 6), y=d/2-31, z=62)
metal = s3d.group(class="tok-string">"forks", cap, cheek, twin, tab)
s3d.material(metal,class="tok-string">"steel")
tire = s3d.at(tire_04(), x=-0.5, y=-15, z=-21)
s3d.joint(class="tok-string">"joint_tire_"+tire_name+class="tok-string">"_joint_00", tire, s3d.local(metal, x=4, y=-15, z=26), kind=class="tok-string">"continuous", axis=class="tok-string">"+X")
return s3d.group(class="tok-string">"wheel_04", metal, tire)
def tire_04(w=23, d=93):
wheel = s3d.at(s3d.cylinder(class="tok-string">"tire", d=d, h=w), x=-w/2, z=d/2, ry=90)
s3d.fillet(wheel, r=4)
s3d.material(wheel,class="tok-string">"rubber",color=class="tok-string">"class="tok-comment">#333333")
return s3d.group(class="tok-string">"tire_04",wheel)