Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
3e83158
Add files via upload
nicboone8 Apr 8, 2025
bc1ca45
Update and rename globals.kcl to parameters.kcl
nicboone8 Apr 8, 2025
b04141d
Update fan-housing.kcl
nicboone8 Apr 9, 2025
ab5ca14
Update fan-housing.kcl
nicboone8 Apr 9, 2025
32888f3
Update fan.kcl
nicboone8 Apr 9, 2025
cac09ed
Update motor.kcl
nicboone8 Apr 9, 2025
f945501
Update parameters.kcl
nicboone8 Apr 9, 2025
b60c0fa
Merge branch 'main' into nicboone8-patch-1
nicboone8 Apr 9, 2025
bde4a1a
Update kcl-samples simulation test output
github-actions[bot] Apr 9, 2025
3ef8d67
Update main.kcl
nicboone8 Apr 9, 2025
b42d69f
Update kcl-samples simulation test output
github-actions[bot] Apr 9, 2025
0372af4
remove functions
jgomez720 Apr 9, 2025
73205e9
Merge branch 'main' into nicboone8-patch-1
jgomez720 Apr 9, 2025
0aae527
Merge branch 'main' into nicboone8-patch-1
nicboone8 Apr 10, 2025
93066c5
Merge branch 'main' into nicboone8-patch-1
jgomez720 Apr 11, 2025
d071a40
angledLine kwargs
nicboone8 Apr 11, 2025
36b1122
Merge branch 'main' into nicboone8-patch-1
nicboone8 Apr 11, 2025
aa74fee
tangentalArc kwargs
nicboone8 Apr 12, 2025
07b62ab
Update kcl-samples simulation test output
github-actions[bot] Apr 12, 2025
9c1cd8b
Update housing middle
nicboone8 Apr 12, 2025
5a68ec5
Update kcl-samples simulation test output
github-actions[bot] Apr 12, 2025
6e7d9e0
Update kcl-samples simulation test output
github-actions[bot] Apr 12, 2025
1e7854c
Merge branch 'main' into nicboone8-patch-1
nicboone8 Apr 14, 2025
8edff89
Merge branch 'main' into nicboone8-patch-1
nicboone8 Apr 14, 2025
8b72145
Merge branch 'main' into nicboone8-patch-1
nicboone8 Apr 14, 2025
f95b50a
Merge branch 'main' into nicboone8-patch-1
nicboone8 Apr 14, 2025
329339f
Merge branch 'main' into nicboone8-patch-1
nicboone8 Apr 14, 2025
1cf2df5
startSketchOn kwargs and fan blade alignment
nicboone8 Apr 15, 2025
7f4202a
Merge branch 'nicboone8-patch-1' of github.com:KittyCAD/modeling-app …
nicboone8 Apr 15, 2025
60b6b23
bottle kwargs
nicboone8 Apr 15, 2025
ee27fb8
Update kcl-samples simulation test output
github-actions[bot] Apr 15, 2025
e236e60
Update kcl-samples simulation test output
github-actions[bot] Apr 15, 2025
0fc2b02
Merge branch 'main' into nicboone8-patch-1
nicboone8 Apr 15, 2025
f38b1ed
Merge branch 'main' into nicboone8-patch-1
nicboone8 Apr 17, 2025
4ef89d7
Merge branch 'main' into nicboone8-patch-1
jtran Apr 17, 2025
066ca56
Update kcl-samples simulation test output
github-actions[bot] Apr 17, 2025
928246e
Merge branch 'main' into nicboone8-patch-1
nicboone8 Apr 17, 2025
c7977b5
Merge branch 'main' into nicboone8-patch-1
nicboone8 Apr 17, 2025
3bf060c
Formatting
nicboone8 Apr 17, 2025
4c7d2ab
Merge branch 'main' into nicboone8-patch-1
nicboone8 Apr 18, 2025
4c3609a
Merge branch 'main' into nicboone8-patch-1
nicboone8 Apr 29, 2025
8faa368
Delete public/kcl-samples/axial-fan directory
nicboone8 Apr 29, 2025
5d78746
Delete public/kcl-samples/parametric-bearing-pillow-block directory
nicboone8 Apr 29, 2025
d43ba59
Add files via upload
nicboone8 Apr 29, 2025
90ac63d
Update car-wheel.kcl
nicboone8 Apr 29, 2025
d30f727
Update parameters.kcl
nicboone8 Apr 29, 2025
5f172c3
Delete public/kcl-samples/CPU Cooler directory
nicboone8 Apr 29, 2025
2146130
Add files via upload
nicboone8 Apr 29, 2025
a824828
Update kcl-samples simulation test output
github-actions[bot] Apr 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions public/kcl-samples/axial-fan/main.kcl

This file was deleted.

11 changes: 5 additions & 6 deletions public/kcl-samples/car-wheel-assembly/car-wheel.kcl
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ lugBase = startSketchOn(XZ)
|> subtract2d(tool = circle(center = [0, 0], radius = (lugSpacing - 1.5) / 2))
|> extrude(length = wheelWidth / 20)

// Extend the wheel center and bore holes to accomidate the lug heads
// Extend the wheel center and bore holes to accommodate the lug heads
lugExtrusion = startSketchOn(lugBase, face = END)
|> circle(center = [0, 0], radius = (lugSpacing + 1.5) / 2)
|> subtract2d(tool = circle(center = [0, 0], radius = (lugSpacing - 1.5) / 2))
|> extrude(length = wheelWidth / 10)

// Create the circular pattern for the lugs
// Counterbore a hole for each lug, then circular pattern the counterbore to each lug position
lugClearance = startSketchOn(lugExtrusion, face = END)
|> circle(center = [lugSpacing / 2, 0], radius = 1.2 / 2)
|> patternCircular2d(
Expand All @@ -30,7 +30,7 @@ lugClearance = startSketchOn(lugExtrusion, face = END)
)
|> extrude(length = -wheelWidth / 10)

// Create the circular pattern for the lug holes
// Add a through hole in the counterbore for each lug
lugHoles = startSketchOn(lugBase, face = END)
|> circle(center = [lugSpacing / 2, 0], radius = 16mm / 2)
|> patternCircular2d(
Expand Down Expand Up @@ -65,12 +65,11 @@ wheelCenterOuter = startSketchOn(XY)

// Write a function that defines the spoke geometry, patterns and extrudes it
fn spoke(spokeGap, spokeAngle, spokeThickness) {
// Seperating the spoke base planes
// Separating the spoke base planes
plane001 = {
origin = [0.0, 0.0, spokeGap / 2],
xAxis = [1.0, 0.0, spokeAngle],
yAxis = [0.0, 1.0, 0.0],
zAxis = [0.0, 0.0, 1.0]
yAxis = [0.0, 1.0, 0.0]
}

// Spoke cross sections
Expand Down
120 changes: 120 additions & 0 deletions public/kcl-samples/counterdrilled-weldment/main.kcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
// Counterdrilled Weldment
// A metal weldment consisting of a counterdrilled plate, a centrally mounted housing tube, and four structural support fins.

// Set units
@settings(defaultLengthUnit = in)

// Define parameters
boltSpacingX = 5
boltSpacingY = 3
boltDiameter = 1 / 4
counterdrillDiameter = 7 / 16
counterdrillDepth = 3 / 16
tubeInnerDiameter = 1 + 1 / 4
tubeThickness = 0.115
tubeHeight = 2
stockThickness = .5

// Calculate the dimensions of the block using the specified bolt spacing. The size of the block can be defined by adding a multiple of the counterdrill diameter to the bolt spacing
blockLength = boltSpacingX + boltDiameter * 6
blockWidth = boltSpacingY + boltDiameter * 6

// Draw the base plate
plateSketch = startSketchOn(XY)
|> startProfile(at = [-blockLength / 2, -blockWidth / 2])
|> angledLine(angle = 0, length = blockLength, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) + 90, length = blockWidth, tag = $rectangleSegmentB001)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $rectangleSegmentC001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $rectangleSegmentD001)
|> close()
|> subtract2d(tool = circle(center = [0, 0], radius = tubeInnerDiameter / 2))
plateBody = extrude(plateSketch, length = stockThickness)
|> chamfer(
length = boltDiameter * 2,
tags = [
getNextAdjacentEdge(rectangleSegmentB001),
getNextAdjacentEdge(rectangleSegmentA001),
getNextAdjacentEdge(rectangleSegmentC001),
getNextAdjacentEdge(rectangleSegmentD001)
],
)

// Define hole positions
holePositions = [
[-boltSpacingX / 2, -boltSpacingY / 2],
[-boltSpacingX / 2, boltSpacingY / 2],
[boltSpacingX / 2, -boltSpacingY / 2],
[boltSpacingX / 2, boltSpacingY / 2]
]

// Function to create a counterdrilled hole
fn counterdrill(holePosition) {
cbdrill = startSketchOn(plateBody, face = END)
|> circle(center = holePosition, radius = counterdrillDiameter / 2)
|> extrude(length = -counterdrillDepth)
cbBolt = startSketchOn(cbdrill, face = START)
|> circle(center = holePosition, radius = boltDiameter / 2, tag = $hole01)
|> extrude(length = -stockThickness + counterdrillDepth)
// Use a chamfer to create a 90-degree counterdrill edge
|> chamfer(length = (counterdrillDiameter - boltDiameter) / 2 * sqrt(2), tags = [hole01])
return { }
}

// Place a counterdrilled hole at each bolt hole position
map(holePositions, f = counterdrill)

// Drill a small pin hole in the side of the tube
pinhole = startSketchOn(YZ)
|> circle(center = [0, 2.2], radius = 0.125)
|> extrude(length = -10)

// Model the central tube and subtract the pin hole
centralTube = startSketchOn(offsetPlane(XY, offset = stockThickness))
|> circle(center = [0, 0], radius = tubeInnerDiameter / 2 + tubeThickness)
|> subtract2d(tool = circle(center = [0, 0], radius = tubeInnerDiameter / 2))
|> extrude(length = tubeHeight)
|> subtract(tools = [pinhole])

// Create a function to create a fin which spans from the central tube to the bolt hole
fn fin(i) {
diagPlane = {
origin = [0.0, 0.0, 0.0],
xAxis = [
boltSpacingX / 2 * i,
boltSpacingY / 2,
0.0
],
yAxis = [0.0, 0.0, 1.0]
}

finSketch = startSketchOn(diagPlane)
|> startProfile(at = [
tubeInnerDiameter / 2 + tubeThickness,
stockThickness
])
|> xLine(endAbsolute = sqrt((boltSpacingX / 2) ^ 2 + (boltSpacingY / 2) ^ 2) - counterdrillDiameter)
|> yLine(length = 0.15)
|> line(endAbsolute = [
profileStartX(%) + 0.15,
stockThickness + tubeHeight * .8
])
|> xLine(length = -0.15)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
|> extrude(length = tubeThickness, symmetric = true)

// Use a circular pattern to create an identical fin on the opposite side
otherFin = patternCircular3d(
finSketch,
instances = 2,
axis = [0, 0, 1],
center = [0, 0, 0],
arcDegrees = 360,
rotateDuplicates = true,
)
return { }
}

// Place a pair of support fins along each diagonal axis of the bolt pattern
fin(1)
fin(-1)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions public/kcl-samples/countersunk-plate/main.kcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Plate with countersunk holes
// A small mounting plate with a countersunk hole at each end

// Set units
@settings(defaultLengthUnit = in)

// Define parameters
boltSpacing = 5
boltDiameter = 1 / 4
centerHoleDiameter = 1 + 3 / 4
plateThickness = 0.375

// Check that the plate is thick enough to countersink a hole
//assertGreaterThan(plateThickness, boltDiameter, "This plate is not thick enough for the necessary countersink dimensions")

// A bit of math to calculate the tangent line between the two diameters
r1 = centerHoleDiameter / 2 * 1.5 + .35
r2 = boltDiameter * 2 + .25
d = boltSpacing / 2
tangentAngle = (asin((r1 - r2) / d))
tangentLength = (r1 - r2) / tan((tangentAngle))

plateBody = startSketchOn(XY)
// Use polar coordinates to start the sketch at the tangent point of the larger radius
|> startProfile(at = polar(angle = 90 - tangentAngle, length = r1))
|> angledLine(angle = -tangentAngle, length = tangentLength)
|> tangentialArc(radius = r2, angle = (tangentAngle - 90) * 2)
|> angledLine(angle = tangentAngle, length = -tangentLength)
|> tangentialArc(radius = r1, angle = -tangentAngle * 2)
|> angledLine(angle = -tangentAngle, length = -tangentLength)
|> tangentialArc(radius = r2, angle = (tangentAngle - 90) * 2)
|> angledLine(angle = tangentAngle, length = tangentLength)
|> tangentialArc(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
|> subtract2d(tool = circle(center = [0, 0], radius = centerHoleDiameter / 2 * 1.5))
|> extrude(%, length = plateThickness)

// Function to create a countersunk hole
fn countersink(holePosition) {
startSketchOn(plateBody, face = END)
|> circle(center = [holePosition, 0], radius = boltDiameter / 2, tag = $hole01)
|> extrude(length = -plateThickness)
// Use a chamfer to create a 90-degree countersink
|> chamfer(length = boltDiameter, tags = [hole01])
return { }
}

// Place a countersunk hole at each bolt hole position
countersink(-boltSpacing / 2)
countersink(boltSpacing / 2)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * from "parameters.kcl"

// Model the housing which holds the motor, the fan, and the mounting provisions
// Bottom mounting face
bottomFaceSketch = startSketchOn(XY)
bottomFaceSketch = startSketchOn(YZ)
|> startProfile(at = [-fanSize / 2, -fanSize / 2])
|> angledLine(angle = 0, length = fanSize, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) + 90, length = fanSize, tag = $rectangleSegmentB001)
Expand Down Expand Up @@ -150,4 +150,4 @@ startSketchOn(motorHousing, face = END)
getNextAdjacentEdge(rectangleSegmentC002),
getNextAdjacentEdge(rectangleSegmentD002)
],
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,25 @@
import * from "parameters.kcl"

// Model the center of the fan
fanCenter = startSketchOn(XZ)
|> startProfile(at = [-0.0001, fanHeight])
|> xLine(endAbsolute = -15 + 1.5)
|> tangentialArc(radius = 1.5, angle = 90)
|> yLine(endAbsolute = 4.5)
|> xLine(endAbsolute = -13)
|> yLine(endAbsolute = profileStartY(%) - 5)
|> tangentialArc(radius = 1, angle = -90)
|> xLine(endAbsolute = -1)
|> yLine(length = 2)
|> xLine(length = -0.15)
|> line(endAbsolute = [
profileStartX(%) - 1,
profileStartY(%) - 1.4
])
|> xLine(endAbsolute = profileStartX(%))
|> yLine(endAbsolute = profileStartY(%))
fanCenter = startSketchOn(XY)
|> startProfile(at = [fanHeight, -0.0001])
|> yLine(endAbsolute = -15 + 1.5)
|> tangentialArc(radius = 1.5, angle = -90)
|> xLine(endAbsolute = 4.5)
|> yLine(endAbsolute = -13)
|> xLine(endAbsolute = profileStartX(%) - 5)
|> tangentialArc(radius = 1, angle = 90)
|> yLine(endAbsolute = -1)
|> xLine(length = 2)
|> close()
|> revolve(axis = {
direction = [0.0, 1.0],
direction = [1.0, 0.0],
origin = [0.0, 0.0]
})
|> appearance(color = "#f3e2d8")

// Create a function for a lofted fan blade cross section that rotates about the center hub of the fan
fn fanBlade(offsetHeight, startAngle: number(deg)) {
fanBlade = startSketchOn(offsetPlane(XY, offset = offsetHeight))
fn fanBlade(offsetHeight, startAngle) {
fanBlade = startSketchOn(offsetPlane(YZ, offset = offsetHeight))
|> startProfile(at = [
15 * cos(startAngle),
15 * sin(startAngle)
Expand Down Expand Up @@ -72,17 +64,19 @@ fn fanBlade(offsetHeight, startAngle: number(deg)) {
}

// Loft the fan blade cross sections into a single blade, then pattern them about the fan center
loft([
fanBlade(4.5, 50),
fanBlade((fanHeight - 2 - 4) / 2, 30),
fanBlade(fanHeight - 2, 0)
fanBlades = loft([
fanBlade(4.5, 50deg),
fanBlade((fanHeight - 2 - 4) / 2, 30deg),
fanBlade(fanHeight - 2, 0deg)
])
|> appearance(color = "#f3e2d8")
|> patternCircular3d(
%,
instances = 9,
axis = [0, 0, 1],
axis = [1, 0, 0],
center = [0, 0, 0],
arcDegrees = 360,
rotateDuplicates = true,
)
[fanCenter, fanBlades]
|> appearance(color = "#110803")
Loading
Loading