import sand3d as s3d
def rolling_frame():
root = s3d.at(frame_01(), x=-12.5, y=28.5, z=90)
a = s3d.at(w_base_02(), x=-235, y=-622.5, z=27)
b = s3d.at(w_base_03(), x=-235, y=603, z=27)
c = s3d.at(w_base_01(), x=243, y=-628, z=27)
d = s3d.at(w_base_04(), x=243, y=608.5, z=27)
s3d.joint(&class="tok-comment">#39;joint_wBase_02_joint_00class="tok-string">39;, a, on=s3d.local(root, x=-236.5, y=-653.5, z=1), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
s3d.joint(&class="tok-comment">#39;joint_wBase_03_joint_00class="tok-string">39;, b, on=s3d.local(root, x=-236.5, y=574.5, z=1), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
s3d.joint(&class="tok-comment">#39;joint_wBase_01_joint_00class="tok-string">39;, c, on=s3d.local(root, x=241.5, y=-653.5, z=1), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
s3d.joint(&class="tok-comment">#39;joint_wBase_04_joint_00class="tok-string">39;, d, on=s3d.local(root, x=241.5, y=579.5, z=1), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
return s3d.assembly(&class="tok-comment">#39;rolling_frame39;, root, a, b, c, d)
def frame_01(w=561, h=630, short_h=507, t=35, depth=30, span=1231, rail_d=26):
a = s3d.at(end_strip(w=w, h=h, t=t, depth=depth), y=span/2-38)
b = s3d.at(end_strip(w=w, h=short_h, t=t, depth=depth), y=-span/2-38)
rails = []
for x, z in [(-139.5,22), (148.5,22), (-262.5,391)]:
rod = s3d.at(s3d.cylinder(&class="tok-comment">#39;rail39;, d=rail_d, h=span), x=x, y=span/2-38, z=z, rx=90)
s3d.material(rod, &class="tok-comment">#39;chromeclass="tok-string">39;, color=39;#a5a8aa39;)
rails.append(rod)
handle = s3d.wire(&class="tok-comment">#39;return39;, path=[(-262.5,577.5,452),(-262.5,665.5,452),(137.5,665.5,452),(137.5,577.5,452)], d=20, fillet=30)
s3d.material(handle, &class="tok-comment">#39;chromeclass="tok-string">39;, color=39;#a5a8aa39;)
return s3d.group(&class="tok-comment">#39;frame_0139;, a, b, rails, handle)
def end_strip(w, h, t, depth):
p = s3d.poly([(-w/2,2), (w/2,2), (139,h-123), s3d.spline([(139,h-123),(100,h-48),(30,h-4),(-20,h)]), (-w/2,h)])
ob = s3d.extrude(&class="tok-comment">#39;end_frame39;, p, h=depth)
tool = s3d.extrude(&class="tok-comment">#39;opening39;, s3d.offset(p, t=-t), h=depth*2)
ob = s3d.cut(ob, tool)
ob = s3d.at(ob, rx=90, y=depth/2)
s3d.material(ob, &class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#55595b39;)
return ob
def w_base_02(w=72, d=49, h=64):
solid = caster_fork(w=w, d=d, h=h)
wheel = s3d.at(wheel_02(), x=9, y=-2.5, z=-26)
part = s3d.group(&class="tok-comment">#39;w_base_0239;, solid, wheel)
s3d.joint(&class="tok-comment">#39;joint_wheel_02_joint_00class="tok-string">39;, wheel, on=s3d.local(part, x=9, y=-2.5, z=8), kind=39;continuousclass="tok-string">39;, axis=39;+Y39;)
return part
def wheel_02(w=69, d=24):
return s3d.group(&class="tok-comment">#39;wheel_0239;, caster_wheel(w=w, d=d))
def w_base_03(w=72, d=50, h=64):
solid = caster_fork(w=w, d=d, h=h)
wheel = s3d.at(wheel_03(), x=9, y=3, z=-26)
part = s3d.group(&class="tok-comment">#39;w_base_0339;, solid, wheel)
s3d.joint(&class="tok-comment">#39;joint_wheel_03_joint_00class="tok-string">39;, wheel, on=s3d.local(part, x=9, y=3, z=8), kind=39;continuousclass="tok-string">39;, axis=39;+Y39;)
return part
def wheel_03(w=69, d=24):
return s3d.group(&class="tok-comment">#39;wheel_0339;, caster_wheel(w=w, d=d))
def w_base_01(w=72, d=50, h=64):
solid = caster_fork(w=w, d=d, h=h)
wheel = s3d.at(wheel_01(), x=8, y=3, z=-26)
part = s3d.group(&class="tok-comment">#39;w_base_0139;, solid, wheel)
s3d.joint(&class="tok-comment">#39;joint_wheel_01_joint_00class="tok-string">39;, wheel, on=s3d.local(part, x=8, y=3, z=8), kind=39;continuousclass="tok-string">39;, axis=39;+Y39;)
return part
def wheel_01(w=69, d=24):
return s3d.group(&class="tok-comment">#39;wheel_0139;, caster_wheel(w=w, d=d))
def w_base_04(w=72, d=49, h=64):
solid = caster_fork(w=w, d=d, h=h)
wheel = s3d.at(wheel_04(), x=8, y=-2.5, z=-26)
part = s3d.group(&class="tok-comment">#39;w_base_0439;, solid, wheel)
s3d.joint(&class="tok-comment">#39;joint_wheel_04_joint_00class="tok-string">39;, wheel, on=s3d.local(part, x=8, y=-2.5, z=8), kind=39;continuousclass="tok-string">39;, axis=39;+Y39;)
return part
def wheel_04(w=69, d=24):
return s3d.group(&class="tok-comment">#39;wheel_0439;, caster_wheel(w=w, d=d))
def caster_fork(w, d, h):
top = s3d.at(s3d.cylinder(&class="tok-comment">#39;swivel39;, d=d, h=h/6), x=-w/5, z=h*5/6)
cheek = s3d.extrude(&class="tok-comment">#39;fork39;, s3d.poly([(-w/2,h/3),(-w/2,h*5/6),(w/3,h*5/6),(w/2,h/2),(w/3,0),(0,0)]), h=d/10)
cheek = s3d.at(cheek, rx=90, y=d/2)
other = s3d.at(s3d.copy(cheek), y=-d/2+d/10)
bridge = s3d.at(s3d.box(&class="tok-comment">#39;bridge39;, w=w*5/6, d=d, h=h/12), x=-w/12, z=h*3/4)
ob = s3d.join(top, cheek, other, bridge)
s3d.material(ob, &class="tok-comment">#39;steelclass="tok-string">39;, color=39;#969c9e39;)
return ob
def caster_wheel(w, d):
tire = s3d.at(s3d.cylinder(&class="tok-comment">#39;tire39;, d=w, h=d), rx=90, y=d/2, z=w/2)
s3d.fillet(tire, r=d/8)
hub = s3d.at(s3d.cylinder(&class="tok-comment">#39;hub39;, d=w/2, h=d+d/6), rx=90, y=d*7/12, z=w/2)
s3d.material(tire, &class="tok-comment">#39;rubberclass="tok-string">39;, color=39;#30333639;)
s3d.material(hub, &class="tok-comment">#39;steelclass="tok-string">39;, color=39;#9da2a439;)
return s3d.merge(tire, hub)