mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-06 02:30:55 -08:00
Completing Joints docs
This commit is contained in:
parent
03197a9b73
commit
bdaf863e71
7 changed files with 164 additions and 7 deletions
53
docs/rod_end.py
Normal file
53
docs/rod_end.py
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
from build123d import *
|
||||
from bd_warehouse.thread import IsoThread
|
||||
from ocp_vscode import *
|
||||
|
||||
# Create the thread so the min radius is available below
|
||||
thread = IsoThread(
|
||||
major_diameter=8, pitch=1.25, length=20, end_finishes=("fade", "raw")
|
||||
)
|
||||
|
||||
with BuildPart() as rod_end:
|
||||
# Create the outer shape
|
||||
with BuildSketch():
|
||||
Circle(22.25 / 2)
|
||||
with Locations((0, -12)):
|
||||
Rectangle(8, 1)
|
||||
make_hull()
|
||||
split(bisect_by=Plane.YZ)
|
||||
revolve(axis=Axis.Y)
|
||||
# Refine the shape
|
||||
with BuildSketch(Plane.YZ) as s2:
|
||||
Rectangle(25, 8, align=(Align.MIN, Align.CENTER))
|
||||
Rectangle(9, 10, align=(Align.MIN, Align.CENTER))
|
||||
chamfer(s2.vertices(), 0.5)
|
||||
revolve(axis=Axis.Z, mode=Mode.INTERSECT)
|
||||
# Add the screw shaft
|
||||
Cylinder(
|
||||
thread.min_radius,
|
||||
30,
|
||||
rotation=(90, 0, 0),
|
||||
align=(Align.CENTER, Align.CENTER, Align.MIN),
|
||||
)
|
||||
# Cutout the ball socket
|
||||
Sphere(15.89 / 2, mode=Mode.SUBTRACT) # Add thread
|
||||
with Locations((0, -30, 0)):
|
||||
add(thread, rotation=(-90, 0, 0))
|
||||
# Create the ball joint
|
||||
BallJoint(
|
||||
"socket",
|
||||
rod_end.part,
|
||||
joint_location=Location(),
|
||||
angular_range=((-14, 14), (-14, 14), (0, 360)),
|
||||
)
|
||||
|
||||
with BuildPart() as ball:
|
||||
Sphere(15.88 / 2)
|
||||
Box(50, 50, 13, mode=Mode.INTERSECT)
|
||||
Hole(4)
|
||||
ball.part.color = Color("aliceblue")
|
||||
RigidJoint("ball", ball.part, joint_location=Location())
|
||||
|
||||
rod_end.part.joints["socket"].connect_to(ball.part.joints["ball"], angles=(5, 10, 0))
|
||||
|
||||
show(rod_end.part, ball.part)
|
||||
Loading…
Add table
Add a link
Reference in a new issue