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)`
This commit is contained in:
@ -9,15 +9,9 @@ import basePlateRadius, basePlateThickness, baseChamfer, baseHeight from "global
|
||||
// Base Plate
|
||||
sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-basePlateRadius, -basePlateRadius], %)
|
||||
|> angledLine([0, 2 * basePlateRadius], %, $rectangleSegmentA001)
|
||||
|> angledLine([
|
||||
segAng(rectangleSegmentA001) + 90,
|
||||
2 * basePlateRadius
|
||||
], %, $rectangleSegmentB001)
|
||||
|> angledLine([
|
||||
segAng(rectangleSegmentA001),
|
||||
-segLen(rectangleSegmentA001)
|
||||
], %, $rectangleSegmentC001)
|
||||
|> angledLine(angle = 0, length = 2 * basePlateRadius, tag = $rectangleSegmentA001)
|
||||
|> angledLine(angle = segAng(rectangleSegmentA001) + 90, length = 2 * basePlateRadius, tag = $rectangleSegmentB001)
|
||||
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $rectangleSegmentC001)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $rectangleSegmentD001)
|
||||
|> close()
|
||||
extrude001 = extrude(sketch001, length = basePlateThickness)
|
||||
|
||||
@ -16,10 +16,7 @@ sketch011 = startSketchOn(plane003)
|
||||
angleEnd = 270 + axisJ2,
|
||||
radius = axisJ2ArmWidth / 2
|
||||
}, %)
|
||||
|> angledLine({
|
||||
angle = axisJ2,
|
||||
length = axisJ2ArmLength
|
||||
}, %)
|
||||
|> angledLine(angle = axisJ2, length = axisJ2ArmLength)
|
||||
|> arc({
|
||||
angleStart = -90 + axisJ2,
|
||||
angleEnd = 90 + axisJ2,
|
||||
|
||||
@ -16,10 +16,7 @@ sketch017 = startSketchOn(plane002)
|
||||
angleEnd = 270 + axisJ3C,
|
||||
radius = axisJ3CArmWidth / 2
|
||||
}, %)
|
||||
|> angledLine({
|
||||
angle = axisJ3C,
|
||||
length = axisJ3CArmLength
|
||||
}, %)
|
||||
|> angledLine(angle = axisJ3C, length = axisJ3CArmLength)
|
||||
|> arc({
|
||||
angleStart = 270 + axisJ3C,
|
||||
angleEnd = 90 + axisJ3C,
|
||||
@ -99,31 +96,16 @@ sketch023 = startSketchOn(extrude022, 'START')
|
||||
1.75 + axisJ2ArmLength * cos(toRadians(axisJ2)) + axisJ3CArmLength * cos(toRadians(axisJ3C)),
|
||||
8 + axisJ2ArmLength * sin(toRadians(axisJ2)) + axisJ3CArmLength * sin(toRadians(axisJ3C))
|
||||
], %)
|
||||
|> angledLine({
|
||||
angle = axisJ3C + axisJ4 / 2,
|
||||
length = grabberLength / 4
|
||||
}, %)
|
||||
|> angledLine(angle = axisJ3C + axisJ4 / 2, length = grabberLength / 4)
|
||||
|> arc({
|
||||
angleStart = 150 + axisJ3C + axisJ4 / 2,
|
||||
angleEnd = 30 + axisJ3C + axisJ4 / 2,
|
||||
radius = grabberLength / 3
|
||||
}, %)
|
||||
|> angledLine({
|
||||
angle = axisJ3C + axisJ4 / 2,
|
||||
length = grabberLength / 6
|
||||
}, %)
|
||||
|> angledLine({
|
||||
angle = axisJ3C + axisJ4 / 2 + 132,
|
||||
length = grabberLength / 3.5
|
||||
}, %)
|
||||
|> angledLine({
|
||||
angle = axisJ3C + axisJ4 / 2 + 160,
|
||||
length = grabberLength / 3.5
|
||||
}, %)
|
||||
|> angledLine({
|
||||
angle = axisJ3C + axisJ4 / 2 + 200,
|
||||
length = grabberLength / 3
|
||||
}, %)
|
||||
|> angledLine(angle = axisJ3C + axisJ4 / 2, length = grabberLength / 6)
|
||||
|> angledLine(angle = axisJ3C + axisJ4 / 2 + 132, length = grabberLength / 3.5)
|
||||
|> angledLine(angle = axisJ3C + axisJ4 / 2 + 160, length = grabberLength / 3.5)
|
||||
|> angledLine(angle = axisJ3C + axisJ4 / 2 + 200, length = grabberLength / 3)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
|
||||
@ -135,31 +117,16 @@ sketch024 = startSketchOn(extrude022, 'START')
|
||||
1.75 + axisJ2ArmLength * cos(toRadians(axisJ2)) + axisJ3CArmLength * cos(toRadians(axisJ3C)),
|
||||
8 + axisJ2ArmLength * sin(toRadians(axisJ2)) + axisJ3CArmLength * sin(toRadians(axisJ3C))
|
||||
], %)
|
||||
|> angledLine({
|
||||
angle = axisJ3C - (axisJ4 / 2),
|
||||
length = grabberLength / 4
|
||||
}, %)
|
||||
|> angledLine(angle = axisJ3C - (axisJ4 / 2), length = grabberLength / 4)
|
||||
|> arc({
|
||||
angleStart = 210 + axisJ3C - (axisJ4 / 2),
|
||||
angleEnd = 330 + axisJ3C - (axisJ4 / 2),
|
||||
radius = grabberLength / 3
|
||||
}, %)
|
||||
|> angledLine({
|
||||
angle = axisJ3C - (axisJ4 / 2),
|
||||
length = grabberLength / 6
|
||||
}, %)
|
||||
|> angledLine({
|
||||
angle = axisJ3C - (axisJ4 / 2) - 132,
|
||||
length = grabberLength / 3.5
|
||||
}, %)
|
||||
|> angledLine({
|
||||
angle = axisJ3C - (axisJ4 / 2) - 160,
|
||||
length = grabberLength / 3.5
|
||||
}, %)
|
||||
|> angledLine({
|
||||
angle = axisJ3C - (axisJ4 / 2) - 200,
|
||||
length = grabberLength / 3
|
||||
}, %)
|
||||
|> angledLine(angle = axisJ3C - (axisJ4 / 2), length = grabberLength / 6)
|
||||
|> angledLine(angle = axisJ3C - (axisJ4 / 2) - 132, length = grabberLength / 3.5)
|
||||
|> angledLine(angle = axisJ3C - (axisJ4 / 2) - 160, length = grabberLength / 3.5)
|
||||
|> angledLine(angle = axisJ3C - (axisJ4 / 2) - 200, length = grabberLength / 3)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
|
||||
|
||||
@ -14,13 +14,13 @@ extrude005 = extrude(sketch005, length = 1.5 - 0.1)
|
||||
|
||||
sketch006 = startSketchOn(plane002)
|
||||
|> startProfileAt([3.5, baseHeight], %)
|
||||
|> angledLine({ angle = 60, length = 1.75 }, %)
|
||||
|> angledLine(angle = 60, length = 1.75)
|
||||
|> arc({
|
||||
angleStart = -30,
|
||||
angleEnd = -30 + 180,
|
||||
radius = 3
|
||||
}, %)
|
||||
|> angledLineToY({ angle = 60, to = baseHeight }, %)
|
||||
|> angledLine(angle = 60, endAbsoluteY = baseHeight)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user