2025-03-06 18:01:24 -05:00
|
|
|
// J2 Axis for Robot Arm
|
|
|
|
|
|
|
|
// Set Units
|
2025-05-06 08:44:03 +12:00
|
|
|
@settings(defaultLengthUnit = in, kclVersion = 1.0)
|
2025-03-06 18:01:24 -05:00
|
|
|
|
|
|
|
import axisJ1, axisJ2, axisJ2ArmWidth, axisJ2ArmLength, axisJ2ArmThickness, plane003 from "globals.kcl"
|
|
|
|
|
|
|
|
// Create Body of J2 Robot Arm
|
|
|
|
sketch011 = startSketchOn(plane003)
|
2025-04-25 16:01:35 -05:00
|
|
|
|> startProfile(at = [
|
2025-04-30 11:07:05 -04:00
|
|
|
1.75 - (axisJ2ArmWidth / 2 * sin(axisJ2)),
|
|
|
|
8 + axisJ2ArmWidth / 2 * cos(axisJ2)
|
2025-04-25 16:01:35 -05:00
|
|
|
])
|
2025-04-18 17:40:44 -05:00
|
|
|
|> arc(angleStart = 90 + axisJ2, angleEnd = 270 + axisJ2, radius = axisJ2ArmWidth / 2)
|
KCL: Angled line should use keyword args (#5803)
We continue migrating KCL stdlib functions to use keyword arguments. Next up is the `angledLine` family of functions (except `angledLineThatIntersects, which will be a quick follow-up).
Before vs. after:
`angledLine({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, length = 3, tag = $edge)`
`angledLineOfXLength({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, lengthX = 3, tag = $edge)`
`angledLineOfYLength({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, lengthY = 3, tag = $edge)`
`angledLineToX({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, endAbsoluteX = 3, tag = $edge)`
`angledLineToY({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, endAbsoluteY = 3, tag = $edge)`
2025-04-09 14:55:15 -05:00
|
|
|
|> angledLine(angle = axisJ2, length = axisJ2ArmLength)
|
2025-04-18 17:40:44 -05:00
|
|
|
|> arc(angleStart = -90 + axisJ2, angleEnd = 90 + axisJ2, radius = axisJ2ArmWidth / 2)
|
2025-03-06 18:01:24 -05:00
|
|
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|
|
|
|> close()
|
|
|
|
extrude011 = extrude(sketch011, length = -axisJ2ArmThickness)
|
|
|
|
|
2025-04-14 05:58:19 -04:00
|
|
|
sketch012 = startSketchOn(extrude011, face = START)
|
2025-03-06 18:01:24 -05:00
|
|
|
|> circle(center = [-1.75, 8], radius = 1.9, tag = $referenceEdge4)
|
|
|
|
|
|
|
|
extrude012 = extrude(sketch012, length = 0.15)
|
2025-03-26 08:53:34 -07:00
|
|
|
|> fillet(radius = 0.1, tags = [getOppositeEdge(referenceEdge4)])
|
2025-04-14 05:58:19 -04:00
|
|
|
sketch013 = startSketchOn(extrude011, face = START)
|
2025-03-06 18:01:24 -05:00
|
|
|
|> circle(
|
2025-03-26 08:53:34 -07:00
|
|
|
center = [
|
2025-04-30 11:07:05 -04:00
|
|
|
-1.75 - (axisJ2ArmLength * cos(axisJ2)),
|
|
|
|
8 + axisJ2ArmLength * sin(axisJ2)
|
2025-03-06 18:01:24 -05:00
|
|
|
],
|
2025-03-26 08:53:34 -07:00
|
|
|
radius = 1.9,
|
|
|
|
tag = $referenceEdge5,
|
|
|
|
)
|
2025-03-06 18:01:24 -05:00
|
|
|
|
|
|
|
extrude013 = extrude(sketch013, length = 1)
|
2025-03-26 08:53:34 -07:00
|
|
|
|> fillet(radius = 0.1, tags = [getOppositeEdge(referenceEdge5)])
|
2025-03-06 18:01:24 -05:00
|
|
|
|
|
|
|
// Draw Bolt Patterns on J2 Robot Arm
|
2025-04-14 05:58:19 -04:00
|
|
|
sketch014 = startSketchOn(extrude012, face = END)
|
2025-03-06 18:01:24 -05:00
|
|
|
|> circle(center = [-1.75, 6.75], radius = 0.2)
|
|
|
|
|> patternCircular2d(
|
|
|
|
center = [-1.75, 8],
|
|
|
|
instances = 8,
|
|
|
|
arcDegrees = 360,
|
2025-03-26 08:53:34 -07:00
|
|
|
rotateDuplicates = true,
|
2025-03-06 18:01:24 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
extrude014 = extrude(sketch014, length = 0.15)
|
|
|
|
|
2025-04-14 05:58:19 -04:00
|
|
|
sketch015 = startSketchOn(extrude013, face = END)
|
2025-03-06 18:01:24 -05:00
|
|
|
|> circle(
|
|
|
|
center = [
|
2025-04-30 11:07:05 -04:00
|
|
|
-1.75 - ((axisJ2ArmLength - 1) * cos(axisJ2)),
|
|
|
|
8 + (axisJ2ArmLength - 1.5) * sin(axisJ2)
|
2025-03-06 18:01:24 -05:00
|
|
|
],
|
2025-03-26 08:53:34 -07:00
|
|
|
radius = 0.2,
|
2025-03-06 18:01:24 -05:00
|
|
|
)
|
|
|
|
|> patternCircular2d(
|
|
|
|
center = [
|
2025-04-30 11:07:05 -04:00
|
|
|
-1.75 - (axisJ2ArmLength * cos(axisJ2)),
|
|
|
|
8 + axisJ2ArmLength * sin(axisJ2)
|
2025-03-06 18:01:24 -05:00
|
|
|
],
|
|
|
|
instances = 4,
|
|
|
|
arcDegrees = 360,
|
2025-03-26 08:53:34 -07:00
|
|
|
rotateDuplicates = true,
|
2025-03-06 18:01:24 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
extrude015 = extrude(sketch015, length = 0.15)
|
|
|
|
|
2025-04-14 05:58:19 -04:00
|
|
|
sketch016 = startSketchOn(extrude011, face = END)
|
2025-03-06 18:01:24 -05:00
|
|
|
|> circle(
|
|
|
|
center = [
|
2025-04-30 11:07:05 -04:00
|
|
|
1.75 + axisJ2ArmLength * cos(axisJ2),
|
|
|
|
8 + axisJ2ArmLength * sin(axisJ2)
|
2025-03-06 18:01:24 -05:00
|
|
|
],
|
2025-03-26 08:53:34 -07:00
|
|
|
radius = 0.3,
|
2025-03-06 18:01:24 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
extrude(sketch016, length = 1)
|
|
|
|
|> appearance(color = "#454545", metalness = 90, roughness = 90)
|