import sand3d as s3d
def mast_lift():
p=s3d.at(platform_01(),x=14,y=-6,z=14)
b=s3d.at(backwheel_01(),x=14,y=294.5,z=-3)
s3d.joint(&class="tok-comment">#39;joint_backwheel_01_joint_00class="tok-string">39;,b,s3d.local(p,x=0,y=301,z=19),kind=39;continuousclass="tok-string">39;,axis=39;-X39;)
h=s3d.at(handle_01(),x=8.5,y=166,z=8)
s3d.joint(&class="tok-comment">#39;joint_handle_01_joint_00class="tok-string">39;,h,s3d.local(p,x=0,y=228,z=8),kind=39;prismaticclass="tok-string">39;,axis=39;+Z39;,range=(0,778.1))
l=s3d.at(lever_01(),x=-56.5,y=13,z=950)
s3d.joint(&class="tok-comment">#39;joint_lever_01_joint_00class="tok-string">39;,l,s3d.local(p,x=-92,y=19,z=943),kind=39;prismaticclass="tok-string">39;,axis=39;+Z39;,range=(0,33.1))
c=s3d.at(wheelbody_01(),x=14,y=-344.5,z=23)
s3d.joint(&class="tok-comment">#39;joint_wheelbody_01_joint_00class="tok-string">39;,c,s3d.local(p,x=0,y=-327,z=74),kind=39;continuousclass="tok-string">39;,axis=39;+Z39;)
return s3d.assembly(&class="tok-comment">#39;mast_lift39;,p,b,h,l,c)
def platform_01(mw=63,md=67,mh=989,t=4,ax=218,ay=354,shoulder=-75,nose=-270,rail=30,rh=64,plate_w=193,plate_d=207,plate_t=23,motor_d=77,motor_h=116,mx=-5,my=46,bary=6,barz=917,barlen=329):
mast=s3d.at(s3d.shell(s3d.box(&class="tok-comment">#39;mastclass="tok-string">39;,w=mw,d=md,h=mh),t=t,open=39;top bottom +Y39;),x=mx,y=my)
lip=s3d.at(s3d.box(&class="tok-comment">#39;return_lip39;,w=t*2,d=t*3,h=mh),x=mx-mw/2+t*2,y=my+md/2-t*2)
lip2=s3d.at(s3d.copy(lip),x=mx+mw/2-t*2)
rod=s3d.at(s3d.cylinder(&class="tok-comment">#39;guide39;,d=21,h=mh),x=mx,y=my-t/4)
cap=s3d.at(s3d.box(&class="tok-comment">#39;cap39;,w=mw,d=md,h=t),x=mx,y=my,z=mh-t)
stud=s3d.at(s3d.cylinder(&class="tok-comment">#39;stud39;,d=t*4,h=t*5),x=mx,y=my,z=mh)
bar=s3d.at(s3d.cylinder(&class="tok-comment">#39;crossbar39;,d=t*5,h=barlen),x=mx-barlen/2,y=bary,z=barz,ry=90)
path=[(-ax,ay),(-ax,shoulder),(-rail*3,nose),(rail*3,nose),(ax,shoulder),(ax,ay)]
base=s3d.at(s3d.extrude(&class="tok-comment">#39;base39;,s3d.stroke(path,t=rail),h=rh),z=t*2-1)
cross=s3d.at(s3d.box(&class="tok-comment">#39;crossmember39;,w=ax*2,d=md,h=rh/2),y=my,z=rh/2+t*2-1)
plate=s3d.at(s3d.box(&class="tok-comment">#39;mounting_plate39;,w=plate_w,d=plate_d,h=plate_t),y=-my-1)
motor=s3d.at(s3d.cylinder(&class="tok-comment">#39;motor39;,d=motor_d,h=motor_h),x=mx-t*3.5,y=-my+t/2,z=plate_t)
ribs=s3d.at(s3d.box(&class="tok-comment">#39;rib39;,w=t,d=t*2,h=motor_h),on=s3d.ring(n=24,r=motor_d/2))
ribs=s3d.transform(ribs,x=mx-t*3.5,y=-my+t/2,z=plate_t)
lid=s3d.at(s3d.cylinder(&class="tok-comment">#39;motor_lid39;,d=motor_d+t*2,h=t*2),x=mx-t*3.5,y=-my+t/2,z=plate_t+motor_h)
block=s3d.at(s3d.box(&class="tok-comment">#39;motor_block39;,w=rh/2,d=rh/2,h=my-t/4),x=mw/2-t*1.5,y=-my+t/2,z=plate_t+t)
noseplate=s3d.at(s3d.box(&class="tok-comment">#39;caster_mount39;,w=plate_w,d=md+t*4,h=t*2),y=nose-md/2-t*2,z=rh+t*2-1)
result=s3d.group(&class="tok-comment">#39;platform_0139;,mast,lip,lip2,rod,cap,stud,bar,base,cross,plate,motor,ribs,lid,block,noseplate)
s3d.material(result,&class="tok-comment">#39;painted_metalclass="tok-string">39;,color=39;#47637839;)
return result
def backwheel_01(spacing=419,d=66,w=25):
wheel=s3d.at(s3d.cylinder(&class="tok-comment">#39;wheel39;,d=d,h=w),x=-spacing/2-w/2,z=d/2,ry=90)
twin=s3d.transform(s3d.copy(wheel),mirror=&class="tok-comment">#39;x39;)
result=s3d.group(&class="tok-comment">#39;backwheel_0139;,wheel,twin)
s3d.material(result,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#24262839;)
return result
def handle_01(w=301,far=141,h=146,t=27,near=-69,top=197,bw=38,bd=31,bh=90):
path=[(-w/2,far,t/2),(-w/2,near+40,t/2),(-w/2+10,near,t/2+20),(-35,near,h),(35,near,h),(w/2-10,near,t/2+20),(w/2,near+40,t/2),(w/2,far,t/2)]
tube=s3d.wire(&class="tok-comment">#39;handle_tube39;,path=path,d=t,fillet=t)
bracket=s3d.at(s3d.box(&class="tok-comment">#39;carriage39;,w=bw,d=bd,h=bh),y=-126,z=top-bh)
web=s3d.extrude(&class="tok-comment">#39;web39;,s3d.poly([(-bd/2,top-bh),(-bd/2,top-8),(bd/2,top-8),(57,h),(57,h-t)]),h=8)
web=s3d.at(web,x=-4,y=-126,rx=90,rz=90)
result=s3d.group(&class="tok-comment">#39;handle_0139;,tube,bracket,web)
s3d.material(result,&class="tok-comment">#39;painted_metalclass="tok-string">39;,color=39;#34485839;)
return result
def lever_01(w=89,d=8,h=14):
bar=s3d.at(s3d.cylinder(&class="tok-comment">#39;lever39;,d=d,h=w),x=-w/2,z=h/2,ry=90)
result=s3d.group(&class="tok-comment">#39;lever_0139;,bar)
s3d.material(result,&class="tok-comment">#39;steelclass="tok-string">39;,color=39;#55595c39;)
return result
def wheelbody_01(w=44,d=67,h=64,t=6):
boss=s3d.at(s3d.cylinder(&class="tok-comment">#39;swivel39;,d=w,h=t*2),y=11.5,z=h-t*2)
profile=s3d.poly([(-d/2,0),(-d/2,t*2),(0,h),(d/2,h),(d/2,h/2)])
fork=s3d.at(s3d.extrude(&class="tok-comment">#39;fork39;,profile,h=t),x=-w/2,rx=90,rz=90)
twin=s3d.transform(s3d.copy(fork),mirror=&class="tok-comment">#39;x39;)
front=s3d.at(frontwheel_01(),x=0.5,y=-26.5,z=-25)
result=s3d.group(&class="tok-comment">#39;wheelbody_0139;,boss,fork,twin,front)
s3d.material(boss,&class="tok-comment">#39;steelclass="tok-string">39;,color=39;#73787b39;)
s3d.material(fork,&class="tok-comment">#39;steelclass="tok-string">39;,color=39;#73787b39;)
s3d.material(twin,&class="tok-comment">#39;steelclass="tok-string">39;,color=39;#73787b39;)
s3d.joint(&class="tok-comment">#39;joint_frontwheel_01_joint_00class="tok-string">39;,front,s3d.local(result,x=0,y=-26,z=7),kind=39;continuousclass="tok-string">39;,axis=39;-X39;)
return result
def frontwheel_01(w=25,d=63):
wheel=s3d.at(s3d.cylinder(&class="tok-comment">#39;caster_wheel39;,d=d,h=w),x=-w/2,z=d/2,ry=90)
result=s3d.group(&class="tok-comment">#39;frontwheel_0139;,wheel)
s3d.material(result,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#24262839;)
return result