import sand3d as s3d
def workstation():
root = s3d.at(workstation_root(), x=939, y=-128)
a = s3d.at(screen_outer(), x=783, y=170.5, z=1115)
b = s3d.at(screen_middle(), x=135.5, y=348.5, z=1117)
c = s3d.at(wheel_front(), x=-683.5, y=9.5, z=5)
d = s3d.at(wheel_opposite_front(), x=958.5, y=9.5, z=5)
e = s3d.at(screen_return(), x=-508, y=170.5, z=1115)
f = s3d.at(wheel_rear(), x=-683.5, y=309.5, z=5)
g = s3d.at(wheel_opposite_rear(), x=958.5, y=309.5, z=5)
s3d.joint(&class="tok-comment">#39;joint_screen_03_joint_00class="tok-string">39;, a, s3d.local(root, x=-157, y=299, z=1229, rx=-34, ry=-90), axis=39;normal39;, range=(-5,5))
s3d.joint(&class="tok-comment">#39;joint_screen_02_joint_00class="tok-string">39;, b, s3d.local(root, x=-802, y=483, z=1216), axis=39;+X39;, range=(-5,5))
s3d.joint(&class="tok-comment">#39;joint_screen_01_joint_00class="tok-string">39;, e, s3d.local(root, x=-1456, y=308, z=1229, rx=-35, ry=90), axis=39;normal39;, range=(-5,5))
s3d.joint(&class="tok-comment">#39;joint_wheel_01_joint_00class="tok-string">39;, c, s3d.local(root, x=-1623, y=137, z=38), kind=39;continuousclass="tok-string">39;, axis=39;+X39;)
s3d.joint(&class="tok-comment">#39;joint_wheel_04_joint_00class="tok-string">39;, d, s3d.local(root, x=20, y=137, z=38), kind=39;continuousclass="tok-string">39;, axis=39;+X39;)
s3d.joint(&class="tok-comment">#39;joint_wheel_02_joint_00class="tok-string">39;, f, s3d.local(root, x=-1623, y=437, z=38), kind=39;continuousclass="tok-string">39;, axis=39;+X39;)
s3d.joint(&class="tok-comment">#39;joint_wheel_03_joint_00class="tok-string">39;, g, s3d.local(root, x=20, y=437, z=38), kind=39;continuousclass="tok-string">39;, axis=39;+X39;)
return s3d.assembly(&class="tok-comment">#39;workstation39;, root,a,b,c,d,e,f,g)
def workstation_root(cx=137, mat_w=1971, mat_d=1558, mat_y=-188, mat_t=5, desk_w=2021, desk_d=929, desk_y=82.5, desk_z=1055, desk_t=10, corner=90, frame_w=1658, frame_y=380, frame_d=135, foot_w=284, foot_d=576, foot_y=160, foot_h=105, post_h=945, strip_w=1515, strip_d=238, strip_x=1993, strip_y=542):
mat = s3d.at(s3d.extrude(&class="tok-comment">#39;floor_mat39;, s3d.rect(w=mat_w,d=mat_d,r=corner), h=mat_t), x=cx,y=mat_y)
desk = s3d.at(s3d.extrude(&class="tok-comment">#39;desktop39;,s3d.rect(w=desk_w,d=desk_d,r=corner),h=desk_t),x=cx,y=desk_y,z=desk_z)
scoop = s3d.at(s3d.extrude(&class="tok-comment">#39;scoop39;,s3d.poly([(-desk_w/3,-desk_d/2),(-desk_w/5,-desk_d/2+desk_d/3),(desk_w/5,-desk_d/2+desk_d/3),(desk_w/3,-desk_d/2)]),h=desk_t*3),x=cx,y=desk_y,z=desk_z-desk_t)
desk = s3d.cut(desk,scoop)
feet = s3d.at(s3d.extrude(&class="tok-comment">#39;feet39;,s3d.rect(w=foot_w,d=foot_d,r=corner/3),h=foot_h),on=s3d.grid(nx=2,px=frame_w-foot_w),x=cx,y=foot_y,z=mat_t)
panel = s3d.at(s3d.box(&class="tok-comment">#39;inset_panel39;,w=frame_w-foot_w/2,d=frame_d,h=post_h),x=cx,y=frame_y,z=foot_h)
bulge = s3d.at(s3d.extrude(&class="tok-comment">#39;rounded_inset39;,s3d.rect(w=frame_w*2/3,d=post_h/2,r=frame_d),h=frame_d/2),x=cx,y=frame_y+frame_d-corner/5,z=desk_z-post_h/4,rx=90)
panel = s3d.join(panel,bulge)
posts = s3d.at(s3d.extrude(&class="tok-comment">#39;rounded_posts39;,s3d.rect(w=foot_w/3,d=frame_d,r=foot_w/6-1),h=post_h),on=s3d.grid(nx=2,px=frame_w-foot_w/3),x=cx,y=frame_y,z=foot_h)
bar = s3d.at(s3d.box(&class="tok-comment">#39;bottom_bar39;,w=frame_w,d=frame_d,h=foot_h/2),x=cx,y=frame_y,z=foot_h)
strip = s3d.at(s3d.box(&class="tok-comment">#39;separate_strip39;,w=strip_w,d=strip_d,h=desk_t),x=strip_x,y=strip_y)
key = s3d.at(s3d.box(&class="tok-comment">#39;keyboard39;,w=corner*5,d=corner*2,h=desk_t),x=cx,y=desk_t*2,z=desk_z+desk_t)
mouse = s3d.at(s3d.dome(&class="tok-comment">#39;mouse39;,d=corner-mat_t,h=foot_h/3),x=cx+corner*5,y=foot_h/3,z=desk_z+desk_t)
support = s3d.at(s3d.box(&class="tok-comment">#39;monitor_stem39;,w=foot_w*2/3,d=desk_t*3,h=foot_h*2),x=cx,y=frame_y+desk_t,z=desk_z)
path=s3d.spline([(-frame_w*2/5,-frame_d),(0,0),(frame_w*2/5,-frame_d)])
rail=s3d.at(s3d.extrude(&class="tok-comment">#39;curved_monitor_support39;,s3d.stroke(path,t=desk_t*2),h=frame_d/2),x=cx,y=frame_y+desk_t*3,z=desk_z+foot_h)
result = s3d.group(&class="tok-comment">#39;root39;,mat,desk,feet,panel,posts,bar,strip,key,mouse,support,rail)
s3d.material(result,&class="tok-comment">#39;painted_metalclass="tok-string">39;,color=39;#55595c39;)
return s3d.group(&class="tok-comment">#39;root_frame39;,s3d.transform(result,x=-939,y=128))
def screen_outer(w=637,t=28,h=380,lean=-10,angle=-34):
panel=s3d.at(s3d.box(&class="tok-comment">#39;screen39;,w=w,d=t,h=h),rx=lean,rz=angle,x=-18.5,y=-27.5)
s3d.material(panel,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#25272a39;)
return s3d.group(&class="tok-comment">#39;screen_outer39;,panel)
def screen_middle(w=637,t=28,h=380,lean=-10):
panel=s3d.at(s3d.box(&class="tok-comment">#39;screen39;,w=w,d=t,h=h),rx=lean,y=-33)
s3d.material(panel,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#25272a39;)
return s3d.group(&class="tok-comment">#39;screen_middle39;,panel)
def wheel_front(w=17,d=67):
wheel=s3d.at(s3d.cylinder(&class="tok-comment">#39;wheel39;,d=d,h=w),ry=90,x=-w/2,z=d/2)
s3d.material(wheel,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#25252539;)
return s3d.group(&class="tok-comment">#39;wheel_front39;,wheel)
def wheel_opposite_front(w=15,d=67):
wheel=s3d.at(s3d.cylinder(&class="tok-comment">#39;wheel39;,d=d,h=w),ry=90,x=-w/2,z=d/2)
s3d.material(wheel,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#25252539;)
return s3d.group(&class="tok-comment">#39;wheel_opposite_front39;,wheel)
def screen_return(w=637,t=28,h=380,lean=-10,angle=34):
panel=s3d.at(s3d.box(&class="tok-comment">#39;screen39;,w=w,d=t,h=h),rx=lean,rz=angle,x=18.5,y=-27.5)
s3d.material(panel,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#25272a39;)
return s3d.group(&class="tok-comment">#39;screen_return39;,panel)
def wheel_rear(w=17,d=67):
wheel=s3d.at(s3d.cylinder(&class="tok-comment">#39;wheel39;,d=d,h=w),ry=90,x=-w/2,z=d/2)
s3d.material(wheel,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#25252539;)
return s3d.group(&class="tok-comment">#39;wheel_rear39;,wheel)
def wheel_opposite_rear(w=17,d=67):
wheel=s3d.at(s3d.cylinder(&class="tok-comment">#39;wheel39;,d=d,h=w),ry=90,x=-w/2,z=d/2)
s3d.material(wheel,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#25252539;)
return s3d.group(&class="tok-comment">#39;wheel_opposite_rear39;,wheel)