No longer needs to be a function

This commit is contained in:
Adam Chalmers
2025-06-18 09:21:19 -05:00
parent a76e18dd2c
commit e982eb36dd

View File

@ -34,8 +34,6 @@ fn helicalGear(nTeeth, module, pressureAngle, helixAngle, gearHeight) {
|> close() |> close()
|> extrude(length = gearHeight) |> extrude(length = gearHeight)
// Define a function to create a rotated gear sketch on an offset plane
fn helicalGearSketch() {
// Using the gear parameters, sketch an involute tooth spanning from the base diameter to the tip diameter // Using the gear parameters, sketch an involute tooth spanning from the base diameter to the tip diameter
helicalGearSketch = startSketchOn(XY) helicalGearSketch = startSketchOn(XY)
|> startProfile(at = polar(angle = 0, length = baseDiameter / 2)) |> startProfile(at = polar(angle = 0, length = baseDiameter / 2))
@ -59,11 +57,9 @@ fn helicalGear(nTeeth, module, pressureAngle, helixAngle, gearHeight) {
// Pattern the sketch about the center by the specified number of teeth, then close the sketch // Pattern the sketch about the center by the specified number of teeth, then close the sketch
|> patternCircular2d(%, instances = nTeeth, center = [0, 0]) |> patternCircular2d(%, instances = nTeeth, center = [0, 0])
|> close() |> close()
return helicalGearSketch
}
// Draw a gear sketch on the base plane // Draw a gear sketch on the base plane
return helicalGearSketch() return helicalGearSketch
|> extrude(length = gearHeight, twistAngle = helixAngle) |> extrude(length = gearHeight, twistAngle = helixAngle)
|> subtract([%], tools = [holeWithKeyway]) |> subtract([%], tools = [holeWithKeyway])
} }
@ -76,3 +72,4 @@ helicalGear(
helixAngle = 35, helixAngle = 35,
gearHeight, gearHeight,
) )