import sand3d as s3d
def rolling_frame():
frame = s3d.at(tubular_frame(), x=15.5, y=19, z=69)
a = s3d.at(locking_caster_fork(tag=&class="tok-comment">#39;0239;, side=1), x=255, y=-580.5, z=20)
b = s3d.at(locking_caster_fork(tag=&class="tok-comment">#39;0139;, side=-1), x=-224, y=-580.5, z=20)
c = s3d.at(swivel_caster_fork(tag=&class="tok-comment">#39;0439;, side=1), x=255, y=610.5, z=20)
d = s3d.at(swivel_caster_fork(tag=&class="tok-comment">#39;0339;, side=-1), x=-224, y=610.5, z=20)
s3d.joint(&class="tok-comment">#39;joint_stand_02_joint_00class="tok-string">39;, a, on=s3d.local(frame, x=239.5, y=-595, z=10), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
s3d.joint(&class="tok-comment">#39;joint_stand_01_joint_00class="tok-string">39;, b, on=s3d.local(frame, x=-239.5, y=-595, z=10), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
s3d.joint(&class="tok-comment">#39;joint_stand_04_joint_00class="tok-string">39;, c, on=s3d.local(frame, x=239.5, y=595, z=10), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
s3d.joint(&class="tok-comment">#39;joint_stand_03_joint_00class="tok-string">39;, d, on=s3d.local(frame, x=-239.5, y=595, z=10), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
return s3d.assembly(&class="tok-comment">#39;rolling_frame39;, frame, a, b, c, d)
def tubular_frame(span=479, length=1190, height=1186, tube=29, bend=100, rail=19, low=138, high=722, cross_low=57, cross_high=642, thin_low=251, thin_high=464, thin=4):
ends = []
for y in (-length/2, length/2):
end = s3d.wire(&class="tok-comment">#39;rounded_end39;, path=[(-span/2,y,0),(-span/2,y,height),(span/2,y,height),(span/2,y,0)], d=tube, fillet=bend)
ends.append(end)
for z in (cross_low,cross_high):
ends.append(s3d.wire(&class="tok-comment">#39;end_crossbar39;, path=[(-span/2,y,z),(span/2,y,z)], d=rail))
for z in (thin_low,thin_high):
ends.append(s3d.wire(&class="tok-comment">#39;thin_end_bar39;, path=[(-span/2,y,z),(span/2,y,z)], d=thin))
for x in (-span/2,span/2):
for z in (low,high):
ends.append(s3d.wire(&class="tok-comment">#39;long_rail39;, path=[(x,-length/2,z),(x,length/2,z)], d=rail))
for ob in ends:
s3d.material(ob, &class="tok-comment">#39;chromeclass="tok-string">39;, color=39;#a1a4a539;)
return s3d.group(&class="tok-comment">#39;tubular_frame39;, ends)
def locking_caster_fork(w=53, d=59, h=60, t=5, plate=9, neck=28, tag=&class="tok-comment">#39;0239;, side=1):
solid = s3d.at(s3d.cylinder(&class="tok-comment">#39;swivel_bearing39;, d=neck, h=plate), y=d/2-neck/2, z=h-plate)
cap = s3d.at(s3d.box(&class="tok-comment">#39;fork_bridge39;, w=w, d=d, h=plate), z=h-plate*2)
s3d.join(solid,cap)
for x in (-(w-t)/2,(w-t)/2):
leg = s3d.at(s3d.box(&class="tok-comment">#39;fork_leg39;, w=t, d=d-plate, h=h-plate), x=x)
s3d.join(solid,leg)
s3d.material(solid,&class="tok-comment">#39;steelclass="tok-string">39;,color=39;#999c9d39;)
wheel = s3d.at(locking_caster_wheel(), y=-18.5, z=-20)
brake = s3d.at(brake_pedal(), y=-30, z=30)
fork = s3d.group(&class="tok-comment">#39;locking_caster_fork39;,solid,wheel,brake)
s3d.joint(&class="tok-comment">#39;joint_tire_class="tok-string">39;+tag+39;_joint_00class="tok-string">39;, wheel, on=s3d.local(fork, x=side*26, y=-18.5, z=11), kind=39;continuousclass="tok-string">39;, axis=39;+X39;)
s3d.joint(&class="tok-comment">#39;joint_brake_class="tok-string">39;+tag+39;_joint_00class="tok-string">39;, brake, on=s3d.local(fork, x=side*26, y=1.5, z=40), kind=39;revoluteclass="tok-string">39;, axis=39;+X39;, range=(0,12))
return fork
def locking_caster_wheel(w=37, d=63):
wheel = s3d.at(s3d.cylinder(&class="tok-comment">#39;wheel39;, d=d, h=w), x=-w/2, z=d/2, ry=90)
s3d.material(wheel,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#44474a39;)
return s3d.group(&class="tok-comment">#39;locking_caster_wheel39;,wheel)
def brake_pedal(w=49, d=75, h=18, t=5):
pedal = s3d.extrude(&class="tok-comment">#39;brake39;, s3d.rect(w=w,d=d,r=t), h=t)
s3d.material(pedal,&class="tok-comment">#39;steelclass="tok-string">39;,color=39;#96999b39;)
return s3d.group(&class="tok-comment">#39;brake_pedal39;,pedal)
def swivel_caster_fork(w=53, d=59, h=60, t=5, plate=9, neck=28, tag=&class="tok-comment">#39;0439;, side=1):
solid = s3d.at(s3d.cylinder(&class="tok-comment">#39;swivel_bearing39;, d=neck, h=plate), y=d/2-neck/2, z=h-plate)
cap = s3d.at(s3d.box(&class="tok-comment">#39;fork_bridge39;, w=w, d=d, h=plate), z=h-plate*2)
s3d.join(solid,cap)
for x in (-(w-t)/2,(w-t)/2):
leg = s3d.at(s3d.box(&class="tok-comment">#39;fork_leg39;, w=t, d=d-plate, h=h-plate), x=x)
s3d.join(solid,leg)
s3d.material(solid,&class="tok-comment">#39;steelclass="tok-string">39;,color=39;#999c9d39;)
wheel = s3d.at(swivel_caster_wheel(), y=-18.5, z=-20)
fork = s3d.group(&class="tok-comment">#39;swivel_caster_fork39;,solid,wheel)
s3d.joint(&class="tok-comment">#39;joint_tire_class="tok-string">39;+tag+39;_joint_00class="tok-string">39;, wheel, on=s3d.local(fork, x=side*26, y=-18.5, z=11), kind=39;continuousclass="tok-string">39;, axis=39;+X39;)
return fork
def swivel_caster_wheel(w=37, d=63):
wheel = s3d.at(s3d.cylinder(&class="tok-comment">#39;wheel39;, d=d, h=w), x=-w/2, z=d/2, ry=90)
s3d.material(wheel,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#44474a39;)
return s3d.group(&class="tok-comment">#39;swivel_caster_wheel39;,wheel)