Skip to content

Commit 441c699

Browse files
authored
Update KCL (#1265)
Use KCL 67
1 parent e04f15d commit 441c699

File tree

12 files changed

+161
-92
lines changed

12 files changed

+161
-92
lines changed

Cargo.lock

Lines changed: 73 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ git_rev = "0.1.0"
2222
heck = "0.5.0"
2323
http = "1"
2424
itertools = "0.12.1"
25-
kcl-lib = { version = "0.2.65", features = ["disable-println"] }
25+
kcl-lib = { version = "0.2.67", features = ["disable-println"] }
2626
#kcl-lib = { path = "../modeling-app/src/wasm-lib/kcl" }
27-
kcl-test-server = "0.1.65"
27+
kcl-test-server = "0.1.67"
2828
kittycad = { version = "0.3.34", features = ["clap", "tabled", "requests", "retry"] }
29-
kittycad-modeling-cmds = { version = "0.2.107", features = ["websocket", "convert_client_crate", "tabled"] }
29+
kittycad-modeling-cmds = { version = "0.2.118", features = ["websocket", "convert_client_crate", "tabled"] }
3030
log = "0.4.27"
3131
miette = { version = "7.5.0", features = ["fancy"] }
3232
nu-ansi-term = "0.50.1"

src/cmd_kcl.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use std::{net::SocketAddr, str::FromStr};
22

33
use anyhow::Result;
44
use clap::Parser;
5+
use kcl_lib::TypedPath;
56
use kcmc::format::OutputFormat3d as OutputFormat;
67
use kittycad::types as kt;
78
use kittycad_modeling_cmds as kcmc;
@@ -1040,7 +1041,8 @@ fn print_trace_link(io: &mut IoStreams, session_data: &Option<kittycad::types::M
10401041
fn get_modeling_settings_from_project_toml(input: &std::path::Path) -> Result<kcl_lib::ExecutorSettings> {
10411042
// Create the default settings from the src unit if given.
10421043
let mut default_settings: kcl_lib::ExecutorSettings = Default::default();
1043-
default_settings.with_current_file(input.into());
1044+
let typed_path = TypedPath::from(input.display().to_string().as_str());
1045+
default_settings.with_current_file(typed_path);
10441046

10451047
// Check if the path was stdin.
10461048
if input.to_str() == Some("-") {
@@ -1069,7 +1071,8 @@ fn get_modeling_settings_from_project_toml(input: &std::path::Path) -> Result<kc
10691071
let project_toml = std::fs::read_to_string(&project_toml)?;
10701072
let project_toml: kcl_lib::ProjectConfiguration = toml::from_str(&project_toml)?;
10711073
let mut settings: kcl_lib::ExecutorSettings = project_toml.into();
1072-
settings.with_current_file(input.into());
1074+
let typed_path = TypedPath::from(input.display().to_string().as_str());
1075+
settings.with_current_file(typed_path);
10731076
Ok(settings)
10741077
} else {
10751078
Ok(default_settings)

tests/parse_error.kcl

Lines changed: 67 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,67 @@
1-
part001 = startSketchAt([0.0000000000, 5.0000000000])
2-
|> line([0.4900857016, -0.0240763666], %)
3-
|> line([0.6804562304, 0.9087880491], %)
4-
|> line([0.5711661314, -0.1430696680], %)
5-
|> line([0.1717090983, -1.1222443518], %)
6-
|> line([0.4435665223, -0.2097913408], %)
7-
|> line([0.9764377140, 0.5792113521], %)
8-
|> line([0.4729383069, -0.3507549536], %)
9-
|> line([-0.2708257990, -1.1025288142], %)
10-
|> line([0.3295183609, -0.3635674851], %)
11-
|> line([1.1237654070, 0.1614549773], %)
12-
|> line([0.3027099123, -0.5050409772], %)
13-
|> line([-0.6721299235, -0.9149632591], %)
14-
|> line([0.1653040161, -0.4619937756], %)
15-
|> line([1.1000100038, -0.2808814542], %)
16-
|> line([0.0863966776, -0.5824390901], %)
17-
|> line([-0.9711083600, -0.5881028420], %)
18-
|> line([-0.0240763666, -0.4900857016], %)
19-
|> line([0.9087880491, -0.6804562304], %)
20-
|> line([-0.1430696680, -0.5711661314], %)
21-
|> line([-1.1222443518, -0.1717090983], %)
22-
|> line([-0.2097913408, -0.4435665223], %)
23-
|> line([0.5792113521, -0.9764377140], %)
24-
|> line([-0.3507549536, -0.4729383069], %)
25-
|> line([-1.1025288142, 0.2708257990], %)
26-
|> line([-0.3635674851, -0.3295183609], %)
27-
|> line([0.1614549773, -1.1237654070], %)
28-
|> line([-0.5050409772, -0.3027099123], %)
29-
|> line([-0.9149632591, 0.6721299235], %)
30-
|> line([-0.4619937756, -0.1653040161], %)
31-
|> line([-0.2808814542, -1.1000100038], %)
32-
|> line([-0.5824390901, -0.0863966776], %)
33-
|> line([-0.5881028420, 0.9711083600], %)
34-
|> line([-0.4900857016, 0.0240763666], %)
35-
|> line([-0.6804562304, -0.9087880491], %)
36-
|> line([-0.5711661314, 0.1430696680], %)
37-
|> line([-0.1717090983, 1.1222443518], %)
38-
|> line([-0.4435665223, 0.2097913408], %)
39-
|> line([-0.9764377140, -0.5792113521], %)
40-
|> line([-0.4729383069, 0.3507549536], %)
41-
|> line([0.2708257990, 1.1025288142], %)
42-
|> line([-0.3295183609, 0.3635674851], %)
43-
|> line([-1.1237654070, -0.1614549773], %)
44-
|> line([-0.3027099123, 0.5050409772], %)
45-
|> line([0.6721299235, 0.9149632591], %)
46-
|> line([-0.1653040161, 0.4619937756], %)
47-
|> line([-1.1000100038, 0.2808814542], %)
48-
|> line([-0.0863966776, 0.5824390901], %)
49-
|> line([0.9711083600, 0.5881028420], %)
50-
|> line([0.0240763666, 0.4900857016], %)
51-
|> line([-0.9087880491, 0.6804562304], %)
52-
|> line([0.1430696680, 0.5711661314], %)
53-
|> line([1.1222443518, 0.1717090983], %)
54-
|> line([0.2097913408, 0.4435665223], %)
55-
|> line([-0.5792113521, 0.9764377140], %)
56-
|> line([0.3507549536, 0.4729383069], %)
57-
|> line([1.1025288142, -0.2708257990], %)
58-
|> line([0.3635674851, 0.3295183609], %)
59-
|> line([-0.1614549773, 1.1237654070], %)
60-
|> line([0.5050409772, 0.3027099123], %)
61-
|> line([0.9149632591, -0.6721299235], %)
62-
|> line([0.4619937756, 0.1653040161], %)
63-
|> line(["things", 1.1000100038], %)
64-
|> line([0.5824390901, 0.0863966776], %)
65-
|> close(%)
66-
|> extrude(1, %)"things"
1+
part001 = startSketchOn(XZ)
2+
|> startProfile(at = [0, 5])
3+
|> line(end = [0.4900857016, -0.0240763666])
4+
|> line(end = [0.6804562304, 0.9087880491])
5+
|> line(end = [0.5711661314, -0.1430696680])
6+
|> line(end = [0.1717090983, -1.1222443518])
7+
|> line(end = [0.4435665223, -0.2097913408])
8+
|> line(end = [0.9764377140, 0.5792113521])
9+
|> line(end = [0.4729383069, -0.3507549536])
10+
|> line(end = [-0.2708257990, -1.1025288142])
11+
|> line(end = [0.3295183609, -0.3635674851])
12+
|> line(end = [1.1237654070, 0.1614549773])
13+
|> line(end = [0.3027099123, -0.5050409772])
14+
|> line(end = [-0.6721299235, -0.9149632591])
15+
|> line(end = [0.1653040161, -0.4619937756])
16+
|> line(end = [1.1000100038, -0.2808814542])
17+
|> line(end = [0.0863966776, -0.5824390901])
18+
|> line(end = [-0.9711083600, -0.5881028420])
19+
|> line(end = [-0.0240763666, -0.4900857016])
20+
|> line(end = [0.9087880491, -0.6804562304])
21+
|> line(end = [-0.1430696680, -0.5711661314])
22+
|> line(end = [-1.1222443518, -0.1717090983])
23+
|> line(end = [-0.2097913408, -0.4435665223])
24+
|> line(end = [0.5792113521, -0.9764377140])
25+
|> line(end = [-0.3507549536, -0.4729383069])
26+
|> line(end = [-1.1025288142, 0.2708257990])
27+
|> line(end = [-0.3635674851, -0.3295183609])
28+
|> line(end = [0.1614549773, -1.1237654070])
29+
|> line(end = [-0.5050409772, -0.3027099123])
30+
|> line(end = [-0.9149632591, 0.6721299235])
31+
|> line(end = [-0.4619937756, -0.1653040161])
32+
|> line(end = [-0.2808814542, -1.1000100038])
33+
|> line(end = [-0.5824390901, -0.0863966776])
34+
|> line(end = [-0.5881028420, 0.9711083600])
35+
|> line(end = [-0.4900857016, 0.0240763666])
36+
|> line(end = [-0.6804562304, -0.9087880491])
37+
|> line(end = [-0.5711661314, 0.1430696680])
38+
|> line(end = [-0.1717090983, 1.1222443518])
39+
|> line(end = [-0.4435665223, 0.2097913408])
40+
|> line(end = [-0.9764377140, -0.5792113521])
41+
|> line(end = [-0.4729383069, 0.3507549536])
42+
|> line(end = [0.2708257990, 1.1025288142])
43+
|> line(end = [-0.3295183609, 0.3635674851])
44+
|> line(end = [-1.1237654070, -0.1614549773])
45+
|> line(end = [-0.3027099123, 0.5050409772])
46+
|> line(end = [0.6721299235, 0.9149632591])
47+
|> line(end = [-0.1653040161, 0.4619937756])
48+
|> line(end = [-1.1000100038, 0.2808814542])
49+
|> line(end = [-0.0863966776, 0.5824390901])
50+
|> line(end = [0.9711083600, 0.5881028420])
51+
|> line(end = [0.0240763666, 0.4900857016])
52+
|> line(end = [-0.9087880491, 0.6804562304])
53+
|> line(end = [0.1430696680, 0.5711661314])
54+
|> line(end = [1.1222443518, 0.1717090983])
55+
|> line(end = [0.2097913408, 0.4435665223])
56+
|> line(end = [-0.5792113521, 0.9764377140])
57+
|> line(end = [0.3507549536, 0.4729383069])
58+
|> line(end = [1.1025288142, -0.2708257990])
59+
|> line(end = [0.3635674851, 0.3295183609])
60+
|> line(end = [-0.1614549773, 1.1237654070])
61+
|> line(end = [0.5050409772, 0.3027099123])
62+
|> line(end = [0.9149632591, -0.6721299235])
63+
|> line(end = [0.4619937756, 0.1653040161])
64+
|> line(end = ["things", 1.1000100038])
65+
|> line(end = [0.5824390901, 0.0863966776])
66+
|> close()
67+
|> extruend = de(1)"things"

tests/walkie-talkie/antenna.kcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Antenna for the walkie talkie assembly
33

44
// Set units
5-
@settings(defaultLengthUnit = in)
5+
@settings(defaultLengthUnit = in, kclVersion = 1.0)
66

77
// Import parameters
88
import antennaLength, antennaBaseWidth, antennaBaseHeight, antennaTopWidth, antennaTopHeight from "parameters.kcl"

tests/walkie-talkie/body.kcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The main body of the walkie talkie assembly
33

44
// Set units
5-
@settings(defaultLengthUnit = in)
5+
@settings(defaultLengthUnit = in, kclVersion = 1.0)
66

77
// Import parameters
88
import height, width, thickness, chamferLength, offset, screenWidth, screenHeight, screenYPosition, screenDepth, speakerBoxWidth, speakerBoxHeight from "parameters.kcl"

tests/walkie-talkie/button.kcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Button for the walkie talkie
33

44
// Set units
5-
@settings(defaultLengthUnit = in)
5+
@settings(defaultLengthUnit = in, kclVersion = 1.0)
66

77
// Import parameters
88
import buttonWidth, buttonHeight, buttonThickness from "parameters.kcl"

tests/walkie-talkie/case.kcl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The plastic case for the front of the walkie talkie
33

44
// Set units
5-
@settings(defaultLengthUnit = in)
5+
@settings(defaultLengthUnit = in, kclVersion = 1.0)
66

77
// Import parameters and Zoo logo
88
import width, height, chamferLength, offset, screenWidth, screenHeight, screenYPosition, screenDepth, speakerBoxWidth, speakerBoxHeight, squareHoleSideLength, caseTolerance from "parameters.kcl"
@@ -62,10 +62,10 @@ case = startSketchOn(XZ)
6262
|> subtract2d(tool = squareHolePatternSketch)
6363

6464
// Create the Zoo logo
65-
|> subtract2d(tool = zLogo(startSketchOn(XZ), [-.30, -1.825], .20))
66-
|> subtract2d(tool = oLogo(startSketchOn(XZ), [-.075, -1.825], .20))
67-
|> subtract2d(tool = oLogo2(startSketchOn(XZ), [-.075, -1.825], .20))
68-
|> subtract2d(tool = oLogo(startSketchOn(XZ), [.175, -1.825], .20))
69-
|> subtract2d(tool = oLogo2(startSketchOn(XZ), [.175, -1.825], .20))
65+
|> subtract2d(tool = zLogo(surface = startSketchOn(XZ), origin = [-.30, -1.825], scale = .20))
66+
|> subtract2d(tool = oLogo(surface = startSketchOn(XZ), origin = [-.075, -1.825], scale = .20))
67+
|> subtract2d(tool = oLogo2(surface = startSketchOn(XZ), origin = [-.075, -1.825], scale = .20))
68+
|> subtract2d(tool = oLogo(surface = startSketchOn(XZ), origin = [.175, -1.825], scale = .20))
69+
|> subtract2d(tool = oLogo2(surface = startSketchOn(XZ), origin = [.175, -1.825], scale = .20))
7070
extrude(case, length = -0.0625)
7171
|> appearance(color = '#D0FF01', metalness = 0, roughness = 50)

tests/walkie-talkie/knob.kcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The frequency knob for the walkie talkie assembly
33

44
// Set units
5-
@settings(defaultLengthUnit = in)
5+
@settings(defaultLengthUnit = in, kclVersion = 1.0)
66

77
// Import parameters
88
import width, thickness, height, knobDiameter, knobHeight, knobRadius from "parameters.kcl"

0 commit comments

Comments
 (0)