import sand3d as s3d
def part_a_assembly():
frame_ = frame_body()
bushing_carriage = carriage(frame_, class="tok-string">"bushing_carriage", x=3.82, y=-22.29, z=12.65, ry=90)
return s3d.assembly(class="tok-string">"part_a_assembly", frame_, bushing_carriage, frame=frame_, bushing_carriage=bushing_carriage)
def carriage(parent, name, x=0, y=0, z=0, rx=0, ry=0, rz=0):
frame = s3d.local(parent, x, y, z, rx, ry, rz)
bushing_carriage = s3d.at(bushing_carriage_body(fclass="tok-string">"{name}"), on=frame)
s3d.joint(fclass="tok-string">"{name}_slide", bushing_carriage, frame, kind=class="tok-string">"prismatic", range=(-54.3, 45.8))
return bushing_carriage
def frame_body():
end_plate_piece = s3d.transform(end_plate(class="tok-string">"end_plate"), y=50.73, z=12.65)
cross_rod_1 = s3d.transform(rod(class="tok-string">"cross_rod_1", d=1.27, length=83.82), y=1.2, z=12.65, rz=90)
side_rail_1 = s3d.transform(side_rail(class="tok-string">"side_rail_1"), x=-38.1, y=-1.28, z=12.65, rz=-90)
cross_rod_2 = s3d.transform(rod(class="tok-string">"cross_rod_2", d=1.27, length=83.82), y=24.7, z=12.65, rz=90)
guide_rod_piece = s3d.transform(rod(class="tok-string">"guide_rod", d=2.54, length=83.82), y=-45.79, z=12.65, rz=90)
side_rail_2 = s3d.transform(side_rail(class="tok-string">"side_rail_2"), x=38.1, y=-1.28, z=12.65, rz=-90)
cross_rod_3 = s3d.transform(rod(class="tok-string">"cross_rod_3", d=1.27, length=83.82), y=-22.29, z=12.65, rz=90)
return s3d.group(
class="tok-string">"frame", end_plate_piece, cross_rod_1, side_rail_1, cross_rod_2, guide_rod_piece, side_rail_2, cross_rod_3
)
def bushing_carriage_body(name):
piece = s3d.transform(sliding_bushing(fclass="tok-string">"{name}_piece"), z=0.46, rx=90)
return s3d.group(name, piece)
def end_plate(name, length=101.6, thickness=5.08, height=25.4, bore_d=2.54, bore_spacing=76.2):
plate = s3d.extrude(name, s3d.rect(length, height), thickness, both=True)
s3d.hole(plate, bore_d, on=s3d.grid(2, 1, bore_spacing, 0))
return s3d.at(plate, rx=90)
def rod(name, d, length):
return s3d.at(s3d.extrude(name, s3d.circle(d), length, both=True), rx=90)
def sliding_bushing(name, outer_d=2.5, bore_d=1.27, length=0.91, edge_r=0.3):
full_length = length + 2 * edge_r
sleeve = s3d.extrude(name, s3d.circle(outer_d), full_length, both=True)
s3d.hole(sleeve, bore_d)
s3d.fillet(sleeve, edge_r, edges=class="tok-string">"all")
return s3d.at(sleeve, rx=90)
def side_rail(name, length=104.03, depth=7.62, height=12.7):
radius = height / 2
end_center = length / 2 - radius
profile = s3d.poly(
[
(-length / 2, -radius),
(end_center, -radius),
s3d.arc(center=(end_center, 0), r=radius, start=270, end=450),
(end_center, radius),
(-length / 2, radius),
]
)
rail = s3d.at(s3d.extrude(name, profile, depth, both=True), rx=90)
s3d.hole(rail, 1.27, on=[(-25.98, 0), (-2.49, 0), (21.01, 0)])
s3d.hole(rail, 2.54, on=(44.5, 0))
return rail