import sand3d as s3d
def breaker_bar():
shaft = s3d.at(body_01(), x=11.55, y=12, z=2)
handle = s3d.at(handle_01(), x=11.55, y=170.5, z=0)
head = s3d.at(top_01(), x=11.55, y=-130, z=3.5)
s3d.joint(class="tok-string">"joint_handle_01_joint_00", handle, on=s3d.local(shaft, x=0, y=113, z=8), kind=class="tok-string">"revolute", axis=class="tok-string">"+X", range=(-90, 90))
s3d.joint(class="tok-string">"joint_top_01_joint_00", head, on=s3d.local(shaft, x=0, y=-113, z=8), kind=class="tok-string">"revolute", axis=class="tok-string">"+X", range=(-90, 90))
return s3d.assembly(class="tok-string">"breaker_bar", shaft, handle, head)
def body_01(d=15, length=238):
shaft = s3d.at(s3d.cylinder(class="tok-string">"shaft", d=d, h=length), y=-length/2, z=d/2, rx=-90)
s3d.material(shaft, class="tok-string">"chrome", color=class="tok-string">"class="tok-comment">#aaaeb0", roughness=0.28)
return s3d.group(class="tok-string">"body_01", shaft)
def handle_01(w=19, length=103, socket=38, flat=7, zc=9.5):
collar = s3d.at(s3d.cylinder(class="tok-string">"socket", d=w, h=socket), y=-length/2, z=zc, rx=-90)
strip = s3d.at(s3d.box(class="tok-string">"flat_grip", w=w, d=length-socket+2, h=flat), y=socket/2, z=zc-flat/2)
grip = s3d.join(collar, strip)
s3d.material(grip, class="tok-string">"chrome", color=class="tok-string">"class="tok-comment">#aaaeb0", roughness=0.3)
return s3d.group(class="tok-string">"handle_01", grip)
def top_01(w=44.16, thick=13, radius=22.08, shoulder=20, fork=28, end=34, post=10, post_h=13.87, recess=38):
outline = s3d.poly([(-radius,-12), s3d.arc(center=(0,-12), r=radius, start=180, end=360), (shoulder,18), (fork/2,20), (fork/2,end), (-fork/2,end), (-fork/2,20), (-shoulder,18)])
head = s3d.extrude(class="tok-string">"head", outline, h=thick)
head = s3d.fillet(head, r=4, edges=class="tok-string">"top bottom")
notch = s3d.at(s3d.box(class="tok-string">"fork_gap", w=15.5, d=23, h=thick+2), y=end-5, z=-1)
head = s3d.cut(head, notch)
head = s3d.hole(head, d=recess, depth=0.6, on=head.face(class="tok-string">"top").move(y=-12))
head = s3d.pocket(head, s3d.rect(w=10, d=5, r=1), on=head.face(class="tok-string">"top").move(y=9))
drive = s3d.at(s3d.box(class="tok-string">"square_drive", w=post, d=post, h=post_h), y=-12, z=thick-0.2)
drive = s3d.chamfer(drive, d=0.7, edges=class="tok-string">"top")
head = s3d.join(head, drive)
s3d.material(head, class="tok-string">"chrome", color=class="tok-string">"class="tok-comment">#aaaeb0", roughness=0.3)
screw = s3d.at(screw_01(), y=-12, z=-3.5)
s3d.joint(class="tok-string">"joint_screw_01_joint_00", screw, on=s3d.local(head, x=0, y=-12, z=0), kind=class="tok-string">"continuous", axis=class="tok-string">"+Z")
return s3d.group(class="tok-string">"top_01", head, screw)
def screw_01(d=20, h=7):
screw = s3d.cylinder(class="tok-string">"retainer", d=d, h=h)
screw = s3d.fillet(screw, r=2, edges=class="tok-string">"bottom")
s3d.material(screw, class="tok-string">"chrome", color=class="tok-string">"class="tok-comment">#969b9e", roughness=0.35)
return s3d.group(class="tok-string">"screw_01", screw)