From 38a245f2fccd0efd295969f27383d7d8c006b68a Mon Sep 17 00:00:00 2001 From: max Date: Tue, 20 May 2025 07:47:33 +0200 Subject: [PATCH] fix typos in the kcl samples (#7078) typos --- public/kcl-samples/pdu-faceplate/main.kcl | 16 +++--- .../spinning-highrise-tower/main.kcl | 4 +- .../tests/kcl_samples/pdu-faceplate/ast.snap | 16 +++--- .../pdu-faceplate/program_memory.snap | 54 +++++++++---------- .../artifact_graph_flowchart.snap.md | 36 ++++++------- .../spinning-highrise-tower/ast.snap | 4 +- .../program_memory.snap | 26 ++++----- 7 files changed, 78 insertions(+), 78 deletions(-) diff --git a/public/kcl-samples/pdu-faceplate/main.kcl b/public/kcl-samples/pdu-faceplate/main.kcl index c441c41fb..9a04fba01 100644 --- a/public/kcl-samples/pdu-faceplate/main.kcl +++ b/public/kcl-samples/pdu-faceplate/main.kcl @@ -72,25 +72,25 @@ leftSpacerShape = boxModuleFn(width = leftSpacerWidth) // Module for power switch including front plate and red rocker button switchPosition = leftSpacerPosition + leftSpacerWidth / 2 + moduleWidth / 2 -swtichWidth = moduleWidth +switchWidth = moduleWidth // Switch Body switchBody = boxModuleFn(width = moduleWidth) // Switch Plate -swtichPlateWidth = 20 +switchPlateWidth = 20 switchPlateHeight = 30 switchPlateThickness = 3 switchPlateShape = startSketchOn(switchBody, face = END) |> startProfile( %, at = [ - -swtichPlateWidth / 2, + -switchPlateWidth / 2, -switchPlateHeight / 2 ], ) |> yLine(length = switchPlateHeight) - |> xLine(length = swtichPlateWidth) + |> xLine(length = switchPlateWidth) |> yLine(length = -switchPlateHeight) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() @@ -104,8 +104,8 @@ switchPlateBody = extrude(switchPlateShape, length = switchPlateThickness) // Switch Button switchButtonHeight = 26 -swtichButtonWidth = 15 -switchButtonShape = startSketchOn(offsetPlane(-YZ, offset = -swtichButtonWidth / 2)) +switchButtonWidth = 15 +switchButtonShape = startSketchOn(offsetPlane(-YZ, offset = -switchButtonWidth / 2)) |> startProfile( %, at = [ @@ -121,7 +121,7 @@ switchButtonShape = startSketchOn(offsetPlane(-YZ, offset = -swtichButtonWidth / ]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() -switchButtonBody = extrude(switchButtonShape, length = swtichButtonWidth) +switchButtonBody = extrude(switchButtonShape, length = switchButtonWidth) |> translate( %, x = switchPosition, @@ -132,7 +132,7 @@ switchButtonBody = extrude(switchButtonShape, length = swtichButtonWidth) // Spacer between switch and plug modules for layout alignment secondSpacerWidth = moduleWidth / 2 -secondSpacerPosition = switchPosition + swtichWidth / 2 + secondSpacerWidth / 2 +secondSpacerPosition = switchPosition + switchWidth / 2 + secondSpacerWidth / 2 secondSpacerBody = boxModuleFn(width = secondSpacerWidth) |> translate( %, diff --git a/public/kcl-samples/spinning-highrise-tower/main.kcl b/public/kcl-samples/spinning-highrise-tower/main.kcl index f548cd074..023e01c17 100644 --- a/public/kcl-samples/spinning-highrise-tower/main.kcl +++ b/public/kcl-samples/spinning-highrise-tower/main.kcl @@ -53,8 +53,8 @@ baseSlab = boxFn(plane = XY, width = slabWidth, height = -baseThickness) |> appearance(%, color = "#dbd7d2") // Create ground platform beneath the base -goundSize = 50 -groundBody = boxFn(plane = offsetPlane(XY, offset = -baseThickness), width = goundSize, height = -5) +groundSize = 50 +groundBody = boxFn(plane = offsetPlane(XY, offset = -baseThickness), width = groundSize, height = -5) |> appearance(%, color = "#3a3631") // Create a single slab with handrail height to be reused with pattern diff --git a/rust/kcl-lib/tests/kcl_samples/pdu-faceplate/ast.snap b/rust/kcl-lib/tests/kcl_samples/pdu-faceplate/ast.snap index 0dff157e8..00fc02f83 100644 --- a/rust/kcl-lib/tests/kcl_samples/pdu-faceplate/ast.snap +++ b/rust/kcl-lib/tests/kcl_samples/pdu-faceplate/ast.snap @@ -3271,7 +3271,7 @@ description: Result of parsing pdu-faceplate.kcl "id": { "commentStart": 0, "end": 0, - "name": "swtichWidth", + "name": "switchWidth", "start": 0, "type": "Identifier" }, @@ -3385,7 +3385,7 @@ description: Result of parsing pdu-faceplate.kcl "id": { "commentStart": 0, "end": 0, - "name": "swtichPlateWidth", + "name": "switchPlateWidth", "start": 0, "type": "Identifier" }, @@ -3586,7 +3586,7 @@ description: Result of parsing pdu-faceplate.kcl "name": { "commentStart": 0, "end": 0, - "name": "swtichPlateWidth", + "name": "switchPlateWidth", "start": 0, "type": "Identifier" }, @@ -3768,7 +3768,7 @@ description: Result of parsing pdu-faceplate.kcl "name": { "commentStart": 0, "end": 0, - "name": "swtichPlateWidth", + "name": "switchPlateWidth", "start": 0, "type": "Identifier" }, @@ -4257,7 +4257,7 @@ description: Result of parsing pdu-faceplate.kcl "id": { "commentStart": 0, "end": 0, - "name": "swtichButtonWidth", + "name": "switchButtonWidth", "start": 0, "type": "Identifier" }, @@ -4339,7 +4339,7 @@ description: Result of parsing pdu-faceplate.kcl "name": { "commentStart": 0, "end": 0, - "name": "swtichButtonWidth", + "name": "switchButtonWidth", "start": 0, "type": "Identifier" }, @@ -4994,7 +4994,7 @@ description: Result of parsing pdu-faceplate.kcl "name": { "commentStart": 0, "end": 0, - "name": "swtichButtonWidth", + "name": "switchButtonWidth", "start": 0, "type": "Identifier" }, @@ -5329,7 +5329,7 @@ description: Result of parsing pdu-faceplate.kcl "name": { "commentStart": 0, "end": 0, - "name": "swtichWidth", + "name": "switchWidth", "start": 0, "type": "Identifier" }, diff --git a/rust/kcl-lib/tests/kcl_samples/pdu-faceplate/program_memory.snap b/rust/kcl-lib/tests/kcl_samples/pdu-faceplate/program_memory.snap index cca7dee93..3e9d3d3b5 100644 --- a/rust/kcl-lib/tests/kcl_samples/pdu-faceplate/program_memory.snap +++ b/rust/kcl-lib/tests/kcl_samples/pdu-faceplate/program_memory.snap @@ -17406,6 +17406,19 @@ description: Variables in memory after executing pdu-faceplate.kcl } } }, + "switchButtonWidth": { + "type": "Number", + "value": 15.0, + "ty": { + "type": "Default", + "len": { + "type": "Mm" + }, + "angle": { + "type": "Degrees" + } + } + }, "switchPlateBody": { "type": "Solid", "value": { @@ -18170,6 +18183,19 @@ description: Variables in memory after executing pdu-faceplate.kcl } } }, + "switchPlateWidth": { + "type": "Number", + "value": 20.0, + "ty": { + "type": "Default", + "len": { + "type": "Mm" + }, + "angle": { + "type": "Degrees" + } + } + }, "switchPosition": { "type": "Number", "value": -158.4, @@ -18183,33 +18209,7 @@ description: Variables in memory after executing pdu-faceplate.kcl } } }, - "swtichButtonWidth": { - "type": "Number", - "value": 15.0, - "ty": { - "type": "Default", - "len": { - "type": "Mm" - }, - "angle": { - "type": "Degrees" - } - } - }, - "swtichPlateWidth": { - "type": "Number", - "value": 20.0, - "ty": { - "type": "Default", - "len": { - "type": "Mm" - }, - "angle": { - "type": "Degrees" - } - } - }, - "swtichWidth": { + "switchWidth": { "type": "Number", "value": 40.45, "ty": { diff --git a/rust/kcl-lib/tests/kcl_samples/spinning-highrise-tower/artifact_graph_flowchart.snap.md b/rust/kcl-lib/tests/kcl_samples/spinning-highrise-tower/artifact_graph_flowchart.snap.md index f6665ddfe..4b541e0aa 100644 --- a/rust/kcl-lib/tests/kcl_samples/spinning-highrise-tower/artifact_graph_flowchart.snap.md +++ b/rust/kcl-lib/tests/kcl_samples/spinning-highrise-tower/artifact_graph_flowchart.snap.md @@ -61,32 +61,32 @@ flowchart LR 50[Solid2d] end subgraph path13 [Path] - 13["Path
[2227, 2279, 0]"] + 13["Path
[2229, 2281, 0]"] %% [ProgramBodyItem { index: 25 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }] - 35["Segment
[2285, 2318, 0]"] + 35["Segment
[2287, 2320, 0]"] %% [ProgramBodyItem { index: 25 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }] - 36["Segment
[2324, 2357, 0]"] + 36["Segment
[2326, 2359, 0]"] %% [ProgramBodyItem { index: 25 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }] - 37["Segment
[2363, 2397, 0]"] + 37["Segment
[2365, 2399, 0]"] %% [ProgramBodyItem { index: 25 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }] - 38["Segment
[2403, 2459, 0]"] + 38["Segment
[2405, 2461, 0]"] %% [ProgramBodyItem { index: 25 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }] - 39["Segment
[2465, 2473, 0]"] + 39["Segment
[2467, 2475, 0]"] %% [ProgramBodyItem { index: 25 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }] 49[Solid2d] end subgraph path14 [Path] - 14["Path
[2803, 2858, 0]"] + 14["Path
[2805, 2860, 0]"] %% [ProgramBodyItem { index: 29 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }] - 40["Segment
[2864, 2893, 0]"] + 40["Segment
[2866, 2895, 0]"] %% [ProgramBodyItem { index: 29 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }] - 41["Segment
[2899, 2929, 0]"] + 41["Segment
[2901, 2931, 0]"] %% [ProgramBodyItem { index: 29 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }] - 42["Segment
[2935, 2969, 0]"] + 42["Segment
[2937, 2971, 0]"] %% [ProgramBodyItem { index: 29 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }] - 43["Segment
[2975, 3031, 0]"] + 43["Segment
[2977, 3033, 0]"] %% [ProgramBodyItem { index: 29 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }] - 44["Segment
[3037, 3045, 0]"] + 44["Segment
[3039, 3047, 0]"] %% [ProgramBodyItem { index: 29 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }] 45[Solid2d] end @@ -94,17 +94,17 @@ flowchart LR %% [ProgramBodyItem { index: 16 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }] 2["Plane
[945, 965, 0]"] %% [ProgramBodyItem { index: 16 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }] - 3["Plane
[1713, 1753, 0]"] + 3["Plane
[1714, 1754, 0]"] %% [ProgramBodyItem { index: 21 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }, CallKwArg { index: 0 }] - 4["Plane
[1937, 1990, 0]"] + 4["Plane
[1939, 1992, 0]"] %% [ProgramBodyItem { index: 22 }, VariableDeclarationDeclaration, VariableDeclarationInit, CallKwArg { index: 0 }] - 5["Plane
[2780, 2797, 0]"] + 5["Plane
[2782, 2799, 0]"] %% [ProgramBodyItem { index: 29 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }] 6["StartSketchOnPlane
[945, 965, 0]"] %% [ProgramBodyItem { index: 16 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }] 7["StartSketchOnPlane
[945, 965, 0]"] %% [ProgramBodyItem { index: 16 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }] - 8["StartSketchOnFace
[2171, 2221, 0]"] + 8["StartSketchOnFace
[2173, 2223, 0]"] %% [ProgramBodyItem { index: 25 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }] 51["Sweep Extrusion
[1209, 1240, 0]"] %% [ProgramBodyItem { index: 16 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit] @@ -114,9 +114,9 @@ flowchart LR %% [ProgramBodyItem { index: 16 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit] 54["Sweep Extrusion
[1209, 1240, 0]"] %% [ProgramBodyItem { index: 16 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit] - 55["Sweep Extrusion
[2545, 2593, 0]"] + 55["Sweep Extrusion
[2547, 2595, 0]"] %% [ProgramBodyItem { index: 26 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }] - 56["Sweep Extrusion
[3051, 3082, 0]"] + 56["Sweep Extrusion
[3053, 3084, 0]"] %% [ProgramBodyItem { index: 29 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 7 }] 57[Wall] %% face_code_ref=Missing NodePath diff --git a/rust/kcl-lib/tests/kcl_samples/spinning-highrise-tower/ast.snap b/rust/kcl-lib/tests/kcl_samples/spinning-highrise-tower/ast.snap index 454cbefdf..90290b4ae 100644 --- a/rust/kcl-lib/tests/kcl_samples/spinning-highrise-tower/ast.snap +++ b/rust/kcl-lib/tests/kcl_samples/spinning-highrise-tower/ast.snap @@ -1997,7 +1997,7 @@ description: Result of parsing spinning-highrise-tower.kcl "id": { "commentStart": 0, "end": 0, - "name": "goundSize", + "name": "groundSize", "start": 0, "type": "Identifier" }, @@ -2138,7 +2138,7 @@ description: Result of parsing spinning-highrise-tower.kcl "name": { "commentStart": 0, "end": 0, - "name": "goundSize", + "name": "groundSize", "start": 0, "type": "Identifier" }, diff --git a/rust/kcl-lib/tests/kcl_samples/spinning-highrise-tower/program_memory.snap b/rust/kcl-lib/tests/kcl_samples/spinning-highrise-tower/program_memory.snap index 77a116038..56df690ed 100644 --- a/rust/kcl-lib/tests/kcl_samples/spinning-highrise-tower/program_memory.snap +++ b/rust/kcl-lib/tests/kcl_samples/spinning-highrise-tower/program_memory.snap @@ -3936,19 +3936,6 @@ description: Variables in memory after executing spinning-highrise-tower.kcl } } }, - "goundSize": { - "type": "Number", - "value": 50.0, - "ty": { - "type": "Default", - "len": { - "type": "M" - }, - "angle": { - "type": "Degrees" - } - } - }, "groundBody": { "type": "Solid", "value": { @@ -4148,6 +4135,19 @@ description: Variables in memory after executing spinning-highrise-tower.kcl "sectional": false } }, + "groundSize": { + "type": "Number", + "value": 50.0, + "ty": { + "type": "Default", + "len": { + "type": "M" + }, + "angle": { + "type": "Degrees" + } + } + }, "handrailHeight": { "type": "Number", "value": 1.2,