* update all kcl-samples * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * Update kcl-samples simulation test output --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com> Co-authored-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
		
			
				
	
	
		
			50 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
// Cycloidal Gear
 | 
						|
// A cycloidal gear is a gear with a continuous, curved tooth profile. They are used in watchmaking and high precision robotics actuation
 | 
						|
 | 
						|
// Set units
 | 
						|
@settings(defaultLengthUnit = in)
 | 
						|
 | 
						|
// Create a function for the cycloidal gear
 | 
						|
fn cycloidalGear(gearPitch, gearHeight, holeDiameter, helixAngle) {
 | 
						|
  // 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
 | 
						|
    gearProfile = startSketchOn(offsetPlane(XY, offset = gHeight))
 | 
						|
      |> startProfileAt([
 | 
						|
           gearPitch * 1.55 * cos(toRadians(helixAngleP)) + gearPitch * sin(toRadians(-helixAngleP)),
 | 
						|
           gearPitch * 1.55 * sin(toRadians(helixAngleP)) + gearPitch * cos(toRadians(-helixAngleP))
 | 
						|
         ], %)
 | 
						|
      |> arc({
 | 
						|
           angleStart = 90 + helixAngleP,
 | 
						|
           angleEnd = -90 + helixAngleP,
 | 
						|
           radius = gearPitch
 | 
						|
         }, %)
 | 
						|
      |> tangentialArc({
 | 
						|
           radius = gearPitch * 1.67,
 | 
						|
           offset = 60
 | 
						|
         }, %)
 | 
						|
      |> tangentialArc({ radius = gearPitch, offset = -180 }, %)
 | 
						|
      |> tangentialArc({
 | 
						|
           radius = gearPitch * 1.67,
 | 
						|
           offset = 60
 | 
						|
         }, %)
 | 
						|
      |> tangentialArc({ radius = gearPitch, offset = -180 }, %)
 | 
						|
      |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
 | 
						|
      |> close(%)
 | 
						|
      |> hole(circle(center = [0, 0], radius = holeDiameter / 2), %)
 | 
						|
    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
 | 
						|
}
 | 
						|
 | 
						|
// Call the cycloidal gear function
 | 
						|
cycloidalGear(.3, 1.5, 0.297, -80)
 |