Skip to content

Commit

Permalink
Update repetitions to instances
Browse files Browse the repository at this point in the history
  • Loading branch information
jgomez720 committed Oct 16, 2024
1 parent 34e67d2 commit 57e375e
Show file tree
Hide file tree
Showing 21 changed files with 166 additions and 166 deletions.
24 changes: 12 additions & 12 deletions ball-bearing/ball-bearing.kcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
// A ball bearing is a type of rolling-element bearing that uses balls to maintain the separation between the bearing races. The primary purpose of a ball bearing is to reduce rotational friction and support radial and axial loads.

// Define constants like ball diameter, inside diamter, overhange length, and thickness
outsideDiameter = 1.625 // inches
sphereDia = 0.25 // inches
shaftDia = 0.75 // inches
overallThickness = 0.313 // inches
wallThickness = 0.100 // inches
overHangLength = .3 // inches
outsideDiameter = 1.625
sphereDia = 0.25
shaftDia = 0.75
overallThickness = 0.313
wallThickness = 0.100
overHangLength = .3
nBalls = 10
chainWidth = sphereDia/2 // inches
chainThickness = sphereDia/8 // inches
linkDiameter = sphereDia/4 // inches
chainWidth = sphereDia/2
chainThickness = sphereDia/8
linkDiameter = sphereDia/4

customPlane = {
plane: {
Expand Down Expand Up @@ -54,7 +54,7 @@ balls = revolve({
arcDegrees: 360,
axis: [0, 0, 1],
center: [0, 0, 0],
repetitions: nBalls-1,
repetitions: nBalls,
rotateDuplicates: true
}, %)

Expand All @@ -78,7 +78,7 @@ chainHead = revolve({
arcDegrees: 360,
axis: [0, 0, 1],
center: [0, 0, 0],
repetitions: nBalls-1,
repetitions: nBalls,
rotateDuplicates: true,
}, %)

Expand All @@ -98,7 +98,7 @@ linkRevolve = revolve({
arcDegrees: 360,
axis: [0, 0, 1],
center: [0, 0, 0],
repetitions: nBalls-1,
repetitions: nBalls,
rotateDuplicates: true,
}, %)

Expand Down
12 changes: 6 additions & 6 deletions bracket/bracket.kcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@

// Define constants
sigmaAllow = 35000 // psi (6061-T6 aluminum)
width = 6 // inch
width = 6
p = 300 // Force on shelf - lbs
factorOfSafety = 1.2 // FOS of 1.2
shelfMountL = 5 // inches
wallMountL = 2 // inches
shelfMountL = 5
wallMountL = 2
shelfDepth = 12 // Shelf is 12 inches in depth from the wall
moment = shelfDepth * p // assume the force is applied at the end of the shelf to be conservative (lb-in)

filletRadius = .375 // inches
extFilletRadius = .25 // inches
mountingHoleDiameter = 0.5 // inches
filletRadius = .375
extFilletRadius = .25
mountingHoleDiameter = 0.5

// Calculate required thickness of bracket
thickness = sqrt(moment * factorOfSafety * 6 / (sigmaAllow * width)) // this is the calculation of two brackets holding up the shelf (inches)
Expand Down
16 changes: 8 additions & 8 deletions brake-caliper/brake-caliper.kcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// Brake calipers are used to squeeze the brake pads against the rotor, causing larger and larger amounts of friction depending on how hard the brakes are pressed.

// Define constants
rotorDiameter = 12 // inches
rotorInnerDiameterThickness = 12.6 // mm
rotorTotalThickness = 25.4 // mm
caliperTolerance = 5 // mm
caliperPadLength = 40 // mm
caliperThickness = 10 // mm
caliperOuterEdgeRadius = 10 // mm
caliperInnerEdgeRadius = 3 // mm
rotorDiameter = 12
rotorInnerDiameterThickness = 12.6
rotorTotalThickness = 25.4
caliperTolerance = 5
caliperPadLength = 40
caliperThickness = 10
caliperOuterEdgeRadius = 10
caliperInnerEdgeRadius = 3

// Create the plane for the brake caliper. This is so it can match up with the rotor model.
brakeCaliperPlane = {
Expand Down
72 changes: 36 additions & 36 deletions car-wheel-assembly/car-wheel-assembly.kcl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

// Define constants
lugCount = 5
lugSpacing = 114.3 // mm
offset = -35 // mm
backSpacing = 6.38 // inches
wheelWidth = 9.5 // inches
wheelDiameter = 19 // inches
lugSpacing = 114.3
offset = -35
backSpacing = 6.38
wheelWidth = 9.5
wheelDiameter = 19


// Create the circular pattern for the lug holes
Expand All @@ -20,7 +20,7 @@ circles = startSketchOn('XZ')
|> patternCircular2d({
arcDegrees: 360,
center: [0, 0],
repetitions: lugCount - 1,
instances: lugCount,
rotateDuplicates: true
}, %)

Expand Down Expand Up @@ -65,7 +65,7 @@ sketch005 = startSketchOn(sketch002, 'END')
|> patternCircular2d({
arcDegrees: 360,
center: [0, 0],
repetitions: lugCount - 1,
instances: lugCount,
rotateDuplicates: true
}, %)

Expand Down Expand Up @@ -162,7 +162,7 @@ sketch009 = extrude(20, sketch007)
|> patternCircular3d({
axis: [0, 1, 0],
center: [0, -2000, 0],
repetitions: 5,
instances: 6,
arcDegrees: 360,
rotateDuplicates: true
}, %)
Expand All @@ -171,7 +171,7 @@ sketch0010 = extrude(-20, sketch008)
|> patternCircular3d({
axis: [0, 1, 0],
center: [0, -2000, 0],
repetitions: 5,
instances: 6,
arcDegrees: 360,
rotateDuplicates: true
}, %)
Expand Down Expand Up @@ -206,18 +206,18 @@ sketch0011 = startSketchOn('XY')
|> revolve({ axis: 'y' }, %)


rotorDiameter = 12 // inches
rotorInnerDiameter = 6 // inches
rotorSinglePlateThickness = 6.3 // mm
rotorInnerDiameterThickness = 12.6 // mm
lugHolePatternDia = 3 // inches
yAxisOffset = 10 // mm
rotorTotalThickness = 25.4 // mm
spacerPatternDiameter = 11 // inches
spacerDiameter = 6.3 // mm
rotorDiameter = 12
rotorInnerDiameter = 6
rotorSinglePlateThickness = 6.3
rotorInnerDiameterThickness = 12.6
lugHolePatternDia = 3
yAxisOffset = 10
rotorTotalThickness = 25.4
spacerPatternDiameter = 11
spacerDiameter = 6.3
spacerLength = rotorTotalThickness - 2*rotorSinglePlateThickness
spacerCount = 16
wheeldiameter = 19 // inches
wheeldiameter = 19

rotorPlane = {
plane: {
Expand All @@ -233,7 +233,7 @@ fn lugPattern = (plane) => {
|> patternCircular2d({
arcDegrees: 360,
center: [0, 0],
repetitions: lugCount - 1,
instances: lugCount,
rotateDuplicates: true,
}, %)
return lugHolePattern
Expand Down Expand Up @@ -271,7 +271,7 @@ spacerSketch = startSketchOn(rotorSecondaryPlatePlane)
|> patternCircular2d({
arcDegrees: 360,
center: [0, 0],
repetitions: spacerCount,
instances: spacerCount + 1,
rotateDuplicates: true,
}, %)

Expand All @@ -282,8 +282,8 @@ spacers = extrude(-spacerLength, spacerSketch)


// Define constants
lugDiameter = 24 // mm
lugHeadLength = lugDiameter * .5 // mm
lugDiameter = 24
lugHeadLength = lugDiameter * .5
lugThreadDiameter = lugDiameter/2 * .85 //mm
lugLength = 30 //mm
lugThreadDepth = lugLength - 12.7 //mm
Expand Down Expand Up @@ -329,7 +329,7 @@ lug(customPlane, lugLength, lugDiameter)
arcDegrees: 360,
axis: [0, 1, 0],
center: [0, 0, 0],
repetitions: 4,
instances: 5,
rotateDuplicates: false,
}, %)

Expand All @@ -338,13 +338,13 @@ lug(customPlane, lugLength, lugDiameter)


// Define constants
tireInnerDiameter = 19 * 25.4 // mm
tireOuterDiameter = 26 * 25.4 // mm
tireDepth = 280 // mm
bendRadius = 40 // mm
tireTreadWidth = 10 // mm
tireTreadDepth = 10 // mm
tireTreadOffset = 80 // mm
tireInnerDiameter = 19 * 25.4
tireOuterDiameter = 26 * 25.4
tireDepth = 280
bendRadius = 40
tireTreadWidth = 10
tireTreadDepth = 10
tireTreadOffset = 80

// Create the sketch of the tire
tireSketch = startSketchOn("XY")
Expand Down Expand Up @@ -376,11 +376,11 @@ tire = revolve({ axis: "Y" }, tireSketch)
// Brake calipers are used to squeeze the brake pads against the rotor, causing larger and larger amounts of friction depending on how hard the brakes are pressed.

// Define constants
caliperTolerance = 5 // mm
caliperPadLength = 40 // mm
caliperThickness = 10 // mm
caliperOuterEdgeRadius = 10 // mm
caliperInnerEdgeRadius = 3 // mm
caliperTolerance = 5
caliperPadLength = 40
caliperThickness = 10
caliperOuterEdgeRadius = 10
caliperInnerEdgeRadius = 3

// Create the plane for the brake caliper. This is so it can match up with the rotor model.
brakeCaliperPlane = {
Expand Down
6 changes: 3 additions & 3 deletions car-wheel/car-wheel.kcl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ lugClearance = startSketchOn(lugExtrusion, 'END')
|> patternCircular2d({
arcDegrees: 360,
center: [0, 0],
repetitions: lugCount - 1,
instances: lugCount,
rotateDuplicates: true
}, %)
|> extrude(-wheelWidth / 10, %)
Expand All @@ -62,7 +62,7 @@ lugHoles = startSketchOn(lugBase, 'END')
|> patternCircular2d({
arcDegrees: 360,
center: [0, 0],
repetitions: lugCount - 1,
instances: lugCount,
rotateDuplicates: true
}, %)
|> extrude(-wheelWidth / 20, %)
Expand Down Expand Up @@ -146,7 +146,7 @@ fn spoke = (spokeGap, spokeAngle, spokeThickness) => {
|> patternCircular3d({
axis: [0, 1, 0],
center: [0, -2000, 0],
repetitions: 5,
instances: 6,
arcDegrees: 360,
rotateDuplicates: true
}, %)
Expand Down
24 changes: 12 additions & 12 deletions flange-with-patterns/flange-with-patterns.kcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
// A flange is a flat rim, collar, or rib, typically forged or cast, that is used to strengthen an object, guide it, or attach it to another object. Flanges are known for their use in various applications, including piping, plumbing, and mechanical engineering, among others.

// Define constants
mountingHoleDia = .625 // inches
baseDia = 4.625 // inches
pipeDia = 1.25 // inches
thickness = .625 // inches
totalThickness = 0.813 // inches
topTotalDiameter = 2.313 // inches
bottomThickness = 0.06 // inches
bottomTotalDiameter = 2.5 // inches
mountingHolePlacementDiameter = 3.5 // inches
baseThickness = .625 // inches
topTotalThickness = totalThickness - (bottomThickness+baseThickness) // inches
mountingHoleDia = .625
baseDia = 4.625
pipeDia = 1.25
thickness = .625
totalThickness = 0.813
topTotalDiameter = 2.313
bottomThickness = 0.06
bottomTotalDiameter = 2.5
mountingHolePlacementDiameter = 3.5
baseThickness = .625
topTotalThickness = totalThickness - (bottomThickness+baseThickness)
holeLocator = baseDia - 8
nHoles = 4

Expand All @@ -25,7 +25,7 @@ circles = startSketchOn('XY')
|> patternCircular2d({
arcDegrees: 360,
center: [0, 0],
repetitions: nHoles - 1,
instances: nHoles,
rotateDuplicates: true
}, %)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ tabsR = startSketchOn(tabPlane)
}, %)
|> patternLinear3d({
axis: [0, -1, 0],
repetitions: 1,
instances: 2,
distance: length + 2 * thk - (tabLength * 4 / 3)
}, %)

Expand All @@ -123,7 +123,7 @@ tabsL = startSketchOn(tabPlane)
}, %)
|> patternLinear3d({
axis: [0, -1, 0],
repetitions: 1,
instances: 2,
distance: length + 2 * thk - (tabLength * 4 / 3)
}, %)

Expand Down
8 changes: 4 additions & 4 deletions french-press/french-press.kcl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ sketch002 = startSketchOn(plane001)
|> patternCircular3d({
axis: [0, 0, 1],
center: [0, 0, 0],
repetitions: 3,
instances: 4,
arcDegrees: 360,
rotateDuplicates: true
}, %)
Expand All @@ -112,7 +112,7 @@ sketch004 = startSketchOn(extrude001, 'END')
|> close(%)
|> patternCircular2d({
center: [0, 0],
repetitions: 2,
instances: 3,
arcDegrees: 360,
rotateDuplicates: true
}, %)
Expand Down Expand Up @@ -162,7 +162,7 @@ sketch008 = startSketchOn(extrude003, 'END')
|> circle({ center: [1.4, 0], radius: .3 }, %)
|> patternCircular2d({
center: [0, 0],
repetitions: 7,
instances: 8,
arcDegrees: 360,
rotateDuplicates: true
}, %)
Expand All @@ -174,7 +174,7 @@ sketch009 = startSketchOn(extrude003, 'END')
|> circle({ center: [0.6, 0], radius: .2 }, %)
|> patternCircular2d({
center: [0, 0],
repetitions: 3,
instances: 4,
arcDegrees: 360,
rotateDuplicates: true
}, %)
Expand Down
Loading

0 comments on commit 57e375e

Please sign in to comment.