* 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>
		
			
				
	
	
		
			90 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			90 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
// Wheel rotor
 | 
						|
// A component of a disc brake system. It provides a surface for brake pads to press against, generating the friction needed to slow or stop the vehicle.
 | 
						|
 | 
						|
// Set units
 | 
						|
@settings(defaultLengthUnit = in)
 | 
						|
 | 
						|
// Import parameters
 | 
						|
import rotorDiameter, rotorInnerDiameter, rotorSinglePlateThickness, rotorInnerDiameterThickness, lugHolePatternDia, lugSpacing, rotorTotalThickness, spacerPatternDiameter, spacerDiameter, spacerLength, spacerCount, wheelDiameter, lugCount, yAxisOffset, drillAndSlotCount from "parameters.kcl"
 | 
						|
 | 
						|
rotorSketch = startSketchOn(XZ)
 | 
						|
  |> circle(center = [0, 0], radius = rotorDiameter / 2)
 | 
						|
rotor = extrude(rotorSketch, length = rotorSinglePlateThickness)
 | 
						|
  |> appearance(color = "#dbcd70", roughness = 90, metalness = 90)
 | 
						|
 | 
						|
rotorBumpSketch = startSketchOn(rotor, 'end')
 | 
						|
  |> circle(center = [0, 0], radius = rotorInnerDiameter / 2)
 | 
						|
rotorBump = extrude(rotorBumpSketch, length = rotorInnerDiameterThickness)
 | 
						|
 | 
						|
lugHoles = startSketchOn(rotorBump, 'end')
 | 
						|
  |> circle(center = [-lugSpacing / 2, 0], radius = 0.315)
 | 
						|
  |> patternCircular2d(
 | 
						|
       arcDegrees = 360,
 | 
						|
       center = [0, 0],
 | 
						|
       instances = lugCount,
 | 
						|
       rotateDuplicates = true,
 | 
						|
     )
 | 
						|
  |> extrude(%, length = -(rotorInnerDiameterThickness + rotorSinglePlateThickness))
 | 
						|
  |> appearance(color = "#dbcd70", roughness = 90, metalness = 90)
 | 
						|
 | 
						|
// (update when boolean is available)
 | 
						|
centerSpacer = startSketchOn(rotor, 'start')
 | 
						|
  |> circle(%, center = [0, 0], radius = .25)
 | 
						|
  |> extrude(%, length = spacerLength)
 | 
						|
 | 
						|
secondaryRotorSketch = startSketchOn(centerSpacer, 'end')
 | 
						|
  |> circle(center = [0, 0], radius = rotorDiameter / 2)
 | 
						|
secondRotor = extrude(secondaryRotorSketch, length = rotorSinglePlateThickness)
 | 
						|
 | 
						|
lugHoles2 = startSketchOn(secondRotor, 'end')
 | 
						|
  |> circle(center = [-lugSpacing / 2, 0], radius = 0.315)
 | 
						|
  |> patternCircular2d(
 | 
						|
       arcDegrees = 360,
 | 
						|
       center = [0, 0],
 | 
						|
       instances = lugCount,
 | 
						|
       rotateDuplicates = true,
 | 
						|
     )
 | 
						|
  |> extrude(length = -rotorSinglePlateThickness)
 | 
						|
 | 
						|
spacerSketch = startSketchOn(rotor, 'start')
 | 
						|
  |> circle(center = [spacerPatternDiameter / 2, 0], radius = spacerDiameter)
 | 
						|
  |> patternCircular2d(
 | 
						|
       arcDegrees = 360,
 | 
						|
       center = [0, 0],
 | 
						|
       instances = spacerCount,
 | 
						|
       rotateDuplicates = true,
 | 
						|
     )
 | 
						|
spacers = extrude(spacerSketch, length = spacerLength)
 | 
						|
 | 
						|
rotorSlottedSketch = startSketchOn(rotor, 'START')
 | 
						|
  |> startProfileAt([2.17, 2.56], %)
 | 
						|
  |> xLine(length = 0.12)
 | 
						|
  |> yLine(length = 2.56)
 | 
						|
  |> xLine(length = -0.12)
 | 
						|
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
 | 
						|
  |> close()
 | 
						|
  |> patternCircular2d(
 | 
						|
       center = [0, 0],
 | 
						|
       instances = drillAndSlotCount,
 | 
						|
       arcDegrees = 360,
 | 
						|
       rotateDuplicates = true,
 | 
						|
     )
 | 
						|
rotorSlotted = extrude(rotorSlottedSketch, length = -rotorSinglePlateThickness / 2)
 | 
						|
 | 
						|
secondRotorSlottedSketch = startSketchOn(secondRotor, 'END')
 | 
						|
  |> startProfileAt([-2.17, 2.56], %)
 | 
						|
  |> xLine(length = -0.12)
 | 
						|
  |> yLine(length = 2.56)
 | 
						|
  |> xLine(length = 0.12)
 | 
						|
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
 | 
						|
  |> close()
 | 
						|
  |> patternCircular2d(
 | 
						|
       center = [0, 0],
 | 
						|
       instances = drillAndSlotCount,
 | 
						|
       arcDegrees = 360,
 | 
						|
       rotateDuplicates = true,
 | 
						|
     )
 | 
						|
 | 
						|
extrude(secondRotorSlottedSketch, length = -rotorSinglePlateThickness / 2)
 | 
						|
  |> appearance(color = "#dbcd70", roughness = 90, metalness = 90)
 |