2025-03-06 18:01:24 -05:00
// Cycloidal Gear
// A cycloidal gear is a gear with a continuous, curved tooth profile. They are used in watchmaking and high precision robotics actuation
2025-04-04 11:03:13 -07:00
// Set units
2025-03-06 18:01:24 -05:00
@settings(defaultLengthUnit = in)
2025-04-04 11:03:13 -07:00
// Create a function for the cycloidal gear
2025-04-29 08:41:31 +12:00
fn cycloidalGear(gearPitch, gearHeight, holeDiameter, helixAngle: number(deg)) {
2025-03-06 18:01:24 -05:00
// Create a function to draw the gear profile as a sketch. Rotate each profile about the gear's axis by an helix angle proportional to the total gear height
fn gearSketch(gHeight) {
helixAngleP = helixAngle * gHeight / gearHeight
2025-03-26 08:53:34 -07:00
gearProfile = startSketchOn(offsetPlane(XY, offset = gHeight))
2025-04-25 16:01:35 -05:00
|> startProfile(at = [
2025-04-30 12:40:11 +12:00
gearPitch * 1.55 * math::cos(helixAngleP) + gearPitch * math::sin(-helixAngleP),
gearPitch * 1.55 * math::sin(helixAngleP) + gearPitch * math::cos(-helixAngleP)
2025-04-25 16:01:35 -05:00
])
2025-04-18 17:40:44 -05:00
|> arc(angleStart = 90 + helixAngleP, angleEnd = -90 + helixAngleP, radius = gearPitch)
2025-04-11 14:17:20 -04:00
|> tangentialArc(radius = gearPitch * 1.67, angle = 60)
|> tangentialArc(radius = gearPitch, angle = -180)
|> tangentialArc(radius = gearPitch * 1.67, angle = 60)
|> tangentialArc(radius = gearPitch, angle = -180)
|> tangentialArc(endAbsolute = [profileStartX(%), profileStartY(%)])
2025-03-06 18:01:24 -05:00
|> close(%)
2025-04-26 15:31:51 -05:00
|> subtract2d(tool = circle(center = [0, 0], radius = holeDiameter / 2))
2025-03-06 18:01:24 -05:00
return gearProfile
}
// Draw sketches of the gear profile along the gear height and loft them together
gearLoft = loft([
gearSketch(0),
gearSketch(gearHeight / 2),
gearSketch(gearHeight)
])
return gearLoft
}
2025-04-04 11:03:13 -07:00
// Call the cycloidal gear function
2025-03-06 18:01:24 -05:00
cycloidalGear(.3, 1.5, 0.297, -80)