Deprecated to_axis Issue #155
Some checks are pending
benchmarks / benchmarks (macos-13, 3.12) (push) Waiting to run
benchmarks / benchmarks (macos-14, 3.12) (push) Waiting to run
benchmarks / benchmarks (ubuntu-latest, 3.12) (push) Waiting to run
benchmarks / benchmarks (windows-latest, 3.12) (push) Waiting to run
Upload coverage reports to Codecov / run (push) Waiting to run
pylint / lint (3.10) (push) Waiting to run
Run type checker / typecheck (3.10) (push) Waiting to run
Run type checker / typecheck (3.13) (push) Waiting to run
Wheel building and publishing / Build wheel on ubuntu-latest (push) Waiting to run
Wheel building and publishing / upload_pypi (push) Blocked by required conditions
tests / tests (macos-13, 3.10) (push) Waiting to run
tests / tests (macos-13, 3.13) (push) Waiting to run
tests / tests (macos-14, 3.10) (push) Waiting to run
tests / tests (macos-14, 3.13) (push) Waiting to run
tests / tests (ubuntu-latest, 3.10) (push) Waiting to run
tests / tests (ubuntu-latest, 3.13) (push) Waiting to run
tests / tests (windows-latest, 3.10) (push) Waiting to run
tests / tests (windows-latest, 3.13) (push) Waiting to run

This commit is contained in:
gumyr 2025-05-18 10:18:08 -04:00
parent 67115111e2
commit 2efd21ff58
8 changed files with 94 additions and 59 deletions

View file

@ -1,6 +1,7 @@
"""
Experimental Joint development file
"""
from build123d import *
from ocp_vscode import *
@ -72,9 +73,9 @@ swing_arm_hinge_edge: Edge = (
.sort_by(Axis.X)[-2:]
.sort_by(Axis.Y)[0]
)
swing_arm_hinge_axis = swing_arm_hinge_edge.to_axis()
swing_arm_hinge_axis = Axis(swing_arm_hinge_edge)
base_corner_edge = base.edges().sort_by(Axis((0, 0, 0), (1, 1, 0)))[-1]
base_hinge_axis = base_corner_edge.to_axis()
base_hinge_axis = Axis(base_corner_edge)
j3 = RevoluteJoint("hinge", base, axis=base_hinge_axis, angular_range=(0, 180))
j4 = RigidJoint("corner", hinge_arm, swing_arm_hinge_axis.location)
base.joints["hinge"].connect_to(hinge_arm.joints["corner"], angle=90)
@ -86,7 +87,7 @@ slider_arm = JointBox(4, 1, 2, 0.2)
s1 = LinearJoint(
"slide",
base,
axis=Edge.make_mid_way(*base_top_edges, 0.67).to_axis(),
axis=Axis(Edge.make_mid_way(*base_top_edges, 0.67)),
linear_range=(0, base_top_edges[0].length),
)
s2 = RigidJoint("slide", slider_arm, Location(Vector(0, 0, 0)))
@ -111,7 +112,7 @@ j5.connect_to(j6, position=-1, angle=90)
j7 = LinearJoint(
"slot",
base,
axis=Edge.make_mid_way(*base_top_edges, 0.33).to_axis(),
axis=Axis(Edge.make_mid_way(*base_top_edges, 0.33)),
linear_range=(0, base_top_edges[0].length),
)
pin_arm = JointBox(2, 1, 2)