import sand3d as s3d
def pedestal_fan():
base = s3d.at(base_01(), x=78.5, y=79)
neck = s3d.at(mid_base_01(), x=81, y=79.5, z=905)
s3d.joint(&class="tok-comment">#39;joint_mid_base_01_joint_00class="tok-string">39;, neck, s3d.local(base, x=0, y=0, z=905), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
return s3d.assembly(&class="tok-comment">#39;pedestal_fan39;, base, neck)
def base_01(d=452.8, edge=18, crown=38, post_d=49, post_h=565, sleeve_d=72, sleeve_z=620, h=900):
base = s3d.revolve(&class="tok-comment">#39;base39;, profile=s3d.poly([(0,0),(d/2,0),(d/2,edge),(d/2-8,edge+8),(post_d/2,crown),(0,crown)]))
stem = s3d.at(s3d.cylinder(&class="tok-comment">#39;post39;, d=post_d, h=post_h-crown+1), z=crown-1)
collar = s3d.at(s3d.cone(&class="tok-comment">#39;collar39;, d=post_d, d2=sleeve_d, h=sleeve_z-post_h+1), z=post_h-1)
sleeve = s3d.at(s3d.cylinder(&class="tok-comment">#39;upper_post39;, d=sleeve_d, h=h-sleeve_z), z=sleeve_z)
solid = s3d.join(base, stem, collar, sleeve)
s3d.material(solid, kind=&class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#b9b9b539;)
return s3d.group(&class="tok-comment">#39;base_0139;, solid)
def mid_base_01(d=71, h=183, slot_w=24, slot_z=140, bore=12, shoulder=145, top_w=44):
solid = s3d.cylinder(&class="tok-comment">#39;neck39;, d=d, h=h)
contour = s3d.poly([(-d/2,0),(d/2,0),(d/2,shoulder),(top_w/2,h-3),(0,h),(-top_w/2,h-3),(-d/2,shoulder)])
limit = s3d.at(s3d.extrude(&class="tok-comment">#39;shoulder_shape39;, profile=contour, h=d+2, both=True), rx=90, rz=90)
solid = s3d.intersect(solid, limit)
slot = s3d.at(s3d.box(&class="tok-comment">#39;fork_slot39;, w=slot_w, d=d+2, h=h-slot_z+1), z=slot_z)
solid = s3d.cut(solid, slot)
solid = s3d.hole(solid, d=bore, on=s3d.local(solid, x=-d/2, y=0, z=171, ry=-90))
s3d.material(solid, kind=&class="tok-comment">#39;plasticclass="tok-string">39;, color=39;#bcbcb839;)
frame = s3d.at(frame_01(), x=-2.5, y=-62, z=-20)
s3d.joint(&class="tok-comment">#39;joint_frame_01_joint_00class="tok-string">39;, frame, s3d.local(solid, x=-2, y=0, z=171), kind=39;revoluteclass="tok-string">39;, axis=39;+X39;, range=(-6.9,3.5))
return s3d.group(&class="tok-comment">#39;mid_base_0139;, solid, frame)
def frame_01(d=430, depth=147, wall=4, axis_z=215, front=-141.5, rear=9.5, motor_d=110, motor_len=210, motor_y=-72.5, cap_d=85, wire_d=2, cap_h=18):
rim = s3d.at(s3d.tube(&class="tok-comment">#39;surround39;, d=d, d_in=d-2*wall, h=depth), rx=90, y=rear, z=axis_z)
motor = s3d.at(s3d.cylinder(&class="tok-comment">#39;motor39;, d=motor_d, h=motor_len), rx=-90, y=motor_y, z=axis_z)
cap = s3d.at(s3d.cone(&class="tok-comment">#39;rear_cap39;, d=motor_d, d2=cap_d, h=cap_h), rx=-90, y=motor_y+motor_len-1, z=axis_z)
motor = s3d.join(motor, cap)
guards = []
for y,n in ((front,48),(rear,8)):
spoke = s3d.wire(&class="tok-comment">#39;guard_spoke39;, path=[(motor_d/3,0,0),(d/2-wall,0,0)], d=wire_d)
spokes = s3d.at(spoke, on=s3d.ring(n=n, r=0))
disc = s3d.at(s3d.group(&class="tok-comment">#39;guard39;, spokes), rx=90, y=y, z=axis_z)
guards.append(disc)
handle = s3d.wire(&class="tok-comment">#39;carry_handle39;, path=[(0,40,axis_z+motor_d/2),(0,85,axis_z+95),(0,140,axis_z+95),(0,145,axis_z+motor_d/2)], d=5, fillet=8)
for ob in [rim,motor,handle]+guards:
s3d.material(ob, kind=&class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#bdbdb939;)
blade = s3d.at(blade_01(), x=-18, y=-99.5, z=37)
result = s3d.group(&class="tok-comment">#39;frame_0139;, rim, motor, handle, guards, blade)
s3d.joint(&class="tok-comment">#39;joint_blade_01_joint_00class="tok-string">39;, blade, s3d.local(result, x=0, y=-100, z=215), kind=39;continuousclass="tok-string">39;, axis=39;-Y39;)
return result
def blade_01(hub_d=74, hub_depth=40, thickness=3, cx=17.5, cz=178, pitch=14, rake=11):
outline = s3d.spline([(0,0),(-16,80),(-40,141),(-9,172),(53,179),(111,145),(134,95),(110,53),(53,13)], closed=True)
vane = s3d.extrude(&class="tok-comment">#39;vane39;, profile=outline, h=thickness, both=True)
vane = s3d.at(vane, rx=rake, ry=pitch)
vanes = s3d.at(vane, on=s3d.ring(n=3, r=0))
rotor = s3d.group(&class="tok-comment">#39;rotor39;, vanes)
rotor = s3d.at(rotor, rx=90, x=cx, z=cz)
hub = s3d.at(s3d.cylinder(&class="tok-comment">#39;hub39;, d=hub_d, h=hub_depth), rx=90, x=cx, y=hub_depth/2, z=cz)
s3d.material(rotor, kind=&class="tok-comment">#39;plasticclass="tok-string">39;, color=39;#93968e39;)
s3d.material(hub, kind=&class="tok-comment">#39;plasticclass="tok-string">39;, color=39;#b6b7b039;)
return s3d.group(&class="tok-comment">#39;blade_0139;, rotor, hub)