import sand3d as s3d
def twin_bin_cart():
root = s3d.at(cradle(), z=91)
bins = s3d.at(bin(), x=141, z=108)
twin = s3d.transform(s3d.copy(bins), mirror=class="tok-string">"x")
a = s3d.at(caster_fork(), x=245.5, y=215, z=29)
b_source = s3d.at(caster_fork(wheel_joint=class="tok-string">"joint_sm_wheel1_a03_joint_00"), x=245.5, y=215, z=29)
b = s3d.transform(s3d.copy(b_source), mirror=class="tok-string">"x")
s3d.delete(b_source)
c = s3d.at(trailing_fork(), x=245.5, y=-247, z=29)
d_source = s3d.at(trailing_fork(wheel_joint=class="tok-string">"joint_sm_wheel2_a03_joint_00"), x=245.5, y=-247, z=29)
d = s3d.transform(s3d.copy(d_source), mirror=class="tok-string">"x")
s3d.delete(d_source)
s3d.joint(class="tok-string">"joint_sm_wheelbase4_a03_joint_00", a, s3d.local(root, x=241, y=232, z=0), kind=class="tok-string">"revolute", axis=class="tok-string">"+Z", range=(-3.1, 3.1))
s3d.joint(class="tok-string">"joint_sm_wheelbase1_a03_joint_00", b, s3d.local(root, x=-241, y=232, z=0), kind=class="tok-string">"revolute", axis=class="tok-string">"+Z", range=(-3.1, 3.1))
s3d.joint(class="tok-string">"joint_sm_wheelbase3_a03_joint_00", c, s3d.local(root, x=241, y=-230, z=0), kind=class="tok-string">"revolute", axis=class="tok-string">"+Z", range=(-3.1, 3.1))
s3d.joint(class="tok-string">"joint_sm_wheelbase2_a03_joint_00", d, s3d.local(root, x=-241, y=-230, z=0), kind=class="tok-string">"revolute", axis=class="tok-string">"+Z", range=(-3.1, 3.1))
return s3d.assembly(class="tok-string">"twin_bin_cart", root, bins, twin, a, b, c, d)
def cradle(w=514, d=492, h=139, rail=5, post=26, px=482, py=462):
low = s3d.wire(class="tok-string">"lower_rail", s3d.rect(w=w, d=d-68, r=20), d=rail)
low = s3d.at(low, z=21)
high = s3d.at(s3d.wire(class="tok-string">"upper_rail", s3d.rect(w=w, d=d, r=22), d=rail), z=126)
posts = s3d.at(s3d.cylinder(class="tok-string">"post", d=post, h=h), on=s3d.grid(nx=2, ny=2, px=px, py=py))
braces=[]
for x in [-194,-170,-110,-86,80,104,163,187]:
brace=s3d.wire(class="tok-string">"brace", [(x,-d/2,126),(x,-(d-68)/2,21),(x,(d-68)/2,21),(x,d/2,126)], d=3)
braces.append(brace)
bars=s3d.at(s3d.cylinder(class="tok-string">"crossbar", d=3, h=w), on=s3d.grid(nx=1, ny=4, py=85), x=-w/2, z=20, ry=90)
ob=s3d.group(class="tok-string">"cradle", low, high, posts, braces, bars)
s3d.material(ob, class="tok-string">"chrome", color=class="tok-string">"class="tok-comment">#9b9fa1")
return ob
def bin(w=250, d=480, h=769, bottom_w=210, bottom_d=430, t=4, rim_w=280, rim_d=511, rim_h=22, band_h=120, n=8):
body=s3d.loft(class="tok-string">"bin_body", s3d.station(z=0,w=bottom_w,d=bottom_d,n=n), s3d.station(z=h-rim_h,w=w,d=d,n=n))
inside=s3d.loft(class="tok-string">"interior", s3d.station(z=t,w=bottom_w-t*2,d=bottom_d-t*2,n=n), s3d.station(z=h,w=w-t*2,d=d-t*2,n=n))
body=s3d.cut(body, inside)
band=s3d.loft(class="tok-string">"band", s3d.station(z=h-band_h,w=w,d=d,n=n), s3d.station(z=h-rim_h+1,w=w+8,d=d+8,n=n))
band=s3d.shell(band,t=t,open=class="tok-string">"start end")
lip=s3d.extrude(class="tok-string">"lip", s3d.rect(w=rim_w,d=rim_d,r=40), h=rim_h)
lip=s3d.pocket(lip,s3d.superellipse(w=w-t*2,d=d-t*2,n=n))
lip=s3d.at(lip,z=h-rim_h)
ob=s3d.group(class="tok-string">"bin",body,band,lip)
s3d.material(ob,class="tok-string">"plastic",color=class="tok-string">"class="tok-comment">#555e60",roughness=0.62)
return ob
def caster_fork(w=43,d=68,h=63,t=5,wheel_joint=class="tok-string">"joint_sm_wheel4_a03_joint_00"):
plate=s3d.at(s3d.cylinder(class="tok-string">"swivel", d=42,h=t), x=-4.5,y=17,z=h-t)
cheek=s3d.extrude(class="tok-string">"fork_cheek",s3d.poly([(-d/2,12),(-d/2,4),(-15,0),(0,8),(d/2,40),(d/2,h-t),( -10,h-t),(-20,18)],fillet=3),h=t)
cheek=s3d.at(cheek,x=-w/2,rx=90,rz=90)
other=s3d.at(s3d.copy(cheek),x=w/2-t)
solid=s3d.group(class="tok-string">"fork",plate,cheek,other)
s3d.material(solid,class="tok-string">"steel",color=class="tok-string">"class="tok-comment">#9fa5a6")
caster_wheel_placed=s3d.at(caster_wheel(),x=-4,y=-4.5,z=-28)
s3d.joint(wheel_joint,caster_wheel_placed,s3d.local(solid,x=-4.5,y=-4,z=13),kind=class="tok-string">"revolute",axis=class="tok-string">"+X",range=(-62831.9,62831.9))
return s3d.group(class="tok-string">"caster_fork",solid,caster_wheel_placed)
def caster_wheel(w=27,d=82):
wheel=s3d.cylinder(class="tok-string">"wheel",d=d,h=w)
wheel=s3d.fillet(wheel,r=5)
wheel=s3d.at(wheel,x=-w/2,z=d/2,ry=90)
s3d.material(wheel,class="tok-string">"rubber",color=class="tok-string">"class="tok-comment">#333739")
return s3d.group(class="tok-string">"caster_wheel",wheel)
def trailing_fork(w=43,d=68,h=63,t=5,wheel_joint=class="tok-string">"joint_sm_wheel3_a03_joint_00"):
plate=s3d.at(s3d.cylinder(class="tok-string">"swivel",d=42,h=t),x=-4.5,y=17,z=h-t)
cheek=s3d.extrude(class="tok-string">"fork_cheek",s3d.poly([(-d/2,12),(-d/2,4),(-15,0),(0,8),(d/2,40),(d/2,h-t),(-10,h-t),(-20,18)],fillet=3),h=t)
cheek=s3d.at(cheek,x=-w/2,rx=90,rz=90)
other=s3d.at(s3d.copy(cheek),x=w/2-t)
solid=s3d.group(class="tok-string">"fork",plate,cheek,other)
s3d.material(solid,class="tok-string">"steel",color=class="tok-string">"class="tok-comment">#9fa5a6")
trailing_wheel_placed=s3d.at(trailing_wheel(),x=-4,y=-4.5,z=-28)
s3d.joint(wheel_joint,trailing_wheel_placed,s3d.local(solid,x=-4.5,y=-5,z=13),kind=class="tok-string">"revolute",axis=class="tok-string">"+X",range=(-62831.9,62831.9))
return s3d.group(class="tok-string">"trailing_fork",solid,trailing_wheel_placed)
def trailing_wheel(w=27,d=82):
wheel=s3d.cylinder(class="tok-string">"wheel",d=d,h=w)
wheel=s3d.fillet(wheel,r=5)
wheel=s3d.at(wheel,x=-w/2,z=d/2,ry=90)
s3d.material(wheel,class="tok-string">"rubber",color=class="tok-string">"class="tok-comment">#333739")
return s3d.group(class="tok-string">"trailing_wheel",wheel)