Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 4 additions & 12 deletions content/pages/docs/kcl-samples/gallows-bracket/main.kcl
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,8 @@ verticalEndMiterRegion = region(segments = [
verticalEndMiterSketch.verticalEndRightEdge
])
verticalEndMiterTool = extrude(verticalEndMiterRegion, length = -(ironWidth + csgFriendlyOffset * 2))
|> translate(
x = 0,
y = 0,
z = csgFriendlyOffset,
global = true,
)
|> scale(x = -1)
|> flipSurface()
hide(verticalEndMiterSketch)

verticalMitered = subtract(verticalBlank, tools = verticalEndMiterTool, legacyMethod = true)
Expand Down Expand Up @@ -411,12 +407,8 @@ horizontalStartMiterRegion = region(segments = [
horizontalStartMiterSketch.horizontalStartRightEdge
])
horizontalStartMiterTool = extrude(horizontalStartMiterRegion, length = -(ironWidth + csgFriendlyOffset * 2))
|> translate(
x = 0,
y = 0,
z = csgFriendlyOffset,
global = true,
)
|> scale(x = -1)
|> flipSurface()
hide(horizontalStartMiterSketch)

horizontalMitered = subtract(horizontalBlank, tools = horizontalStartMiterTool, legacyMethod = true)
Expand Down
10 changes: 1 addition & 9 deletions content/pages/docs/kcl-samples/hammer/main.kcl
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,7 @@ hidden004 = hide(sketch004)
rightSideCut = extrude(region004, length = -14)

// Subtract the top profiles from the side profile to create a CSG hammer shape
firstProfiles = subtract(
[headSideProfile],
tools = [
union([
leftSideCut,
union([rearCut, rightSideCut])
])
],
)
firstProfiles = subtract(headSideProfile, tools = [leftSideCut, rearCut, rightSideCut])

// Extrude a polygon through the center of the hammer head to create the mounting hole for the handle
sketch005 = sketch(on = XY) {
Expand Down
34 changes: 23 additions & 11 deletions content/pages/docs/kcl-samples/snowman/main.kcl
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ noseSketch = sketch(on = XZ) {
horizontal(line2)
}
region001 = region(segments = [noseSketch.line1, noseSketch.line2])
hide(noseSketch)
nose = revolve(region001, axis = X)
|> translate(x = rHead * 0.98, y = 0, z = zHeadC)
|> appearance(color = "#ff7f00", roughness = 40, metalness = 0)
Expand All @@ -106,12 +107,14 @@ sketch001 = sketch(on = hatBrimPlane) {
circle1 = circle(start = [var 26mm, var 0mm], center = [var 0mm, var 0mm])
}
region002 = region(segments = [sketch001.circle1])
hide(sketch001)
hatBrim = extrude(region002, length = hatBrimThk)

sketch002 = sketch(on = startSketchOn(hatBrim, face = END)) {
circle1 = circle(start = [var 18mm, var 0mm], center = [var 0mm, var 0mm])
}
region003 = region(segments = [sketch002.circle1])
hide(sketch002)
hat = extrude(region003, length = hatTopH)
|> appearance(color = "#111111", metalness = 10, roughness = 40)

Expand All @@ -122,6 +125,7 @@ armCircleR = sketch(on = armSketchR) {
circle1 = circle(start = [var 2.5mm, var 0mm], center = [var 0mm, var 0mm])
}
region004 = region(segments = [armCircleR.circle1])
hide(armCircleR)
rightArm = extrude(region004, length = armLen)
|> translate(
x = 0,
Expand All @@ -137,6 +141,7 @@ armCircleL = sketch(on = armSketchL) {
circle1 = circle(start = [var 2.5mm, var 0mm], center = [var 0mm, var 0mm])
}
region005 = region(segments = [armCircleL.circle1])
hide(armCircleL)
leftArm = extrude(region005, length = armLen)
|> translate(
x = 0,
Expand All @@ -153,17 +158,24 @@ sketch003 = sketch(on = XY) {
circle1 = circle(start = [var 71.8mm, var 0mm], center = [var 0mm, var 0mm])
}
region006 = region(segments = [sketch003.circle1])
hide(sketch003)
baseDisk = extrude(region006, length = -baseThk)
|> appearance(color = baseColor, roughness = 70, metalness = 0)

bottomWithBase = union([bottom, baseDisk])
|> appearance(color = "#ffffff", roughness = 20, metalness = 0)

// Collect parts into a flat array
parts0 = concat([bottomWithBase, middle, head], items = buttons)
parts1 = concat(parts0, items = eyes)
snowmanParts = concat(parts1, items = [nose, hat])
limbs = [rightArm, leftArm]
|> appearance(
color = baseColor,
roughness = 70,
metalness = 0,
opacity = 60,
)

concat(snowmanParts, items = limbs)
// Collect parts into a flat array to be rotated
[
middle,
head,
buttons,
eyes,
nose,
hat,
rightArm,
leftArm
]
|> rotate(axis = Z, angle = -90deg, global = true)
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ hide(bitCut02Sketch)
bitCut02 = extrude(bitCut02Region, length = -100)

// Cut the bracket
handle = subtract([bracket], tools = union([bitCut01, bitCut02]))
handle = subtract(bracket, tools = [bitCut01, bitCut02])

// Model the support for the first drill bit
bitSupport01Sketch = sketch(on = offsetPlane(XZ, offset = firstBitAxisOffset - 3)) {
Expand Down
Loading