KCL: Make shell stdlib fn use keyword arguments (#5293)
Before: ``` shell({ faces = ['end'], thickness = caseThickness }, case) ``` After: ``` shell(case, faces = ['end'], thickness = caseThickness) ```
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4693
docs/kcl/std.json
4693
docs/kcl/std.json
File diff suppressed because it is too large
Load Diff
@ -1890,7 +1890,7 @@ chamfer04 = chamfer({ length = 5, tags = [getOppositeEdge(seg02)]}, extrude001
|
|||||||
const testPoint = { x: 575, y: 200 }
|
const testPoint = { x: 575, y: 200 }
|
||||||
const [clickOnCap] = scene.makeMouseHelpers(testPoint.x, testPoint.y)
|
const [clickOnCap] = scene.makeMouseHelpers(testPoint.x, testPoint.y)
|
||||||
const shellDeclaration =
|
const shellDeclaration =
|
||||||
"shell001 = shell({ faces = ['end'], thickness = 5 }, extrude001)"
|
"shell001 = shell(extrude001, faces = ['end'], thickness = 5)"
|
||||||
|
|
||||||
await test.step(`Look for the grey of the shape`, async () => {
|
await test.step(`Look for the grey of the shape`, async () => {
|
||||||
await scene.expectPixelColor([127, 127, 127], testPoint, 15)
|
await scene.expectPixelColor([127, 127, 127], testPoint, 15)
|
||||||
@ -1990,8 +1990,7 @@ extrude001 = extrude(sketch001, length = 40)
|
|||||||
const [clickOnWall] = scene.makeMouseHelpers(testPoint.x, testPoint.y + 70)
|
const [clickOnWall] = scene.makeMouseHelpers(testPoint.x, testPoint.y + 70)
|
||||||
const mutatedCode = 'xLine(-40, %, $seg01)'
|
const mutatedCode = 'xLine(-40, %, $seg01)'
|
||||||
const shellDeclaration =
|
const shellDeclaration =
|
||||||
"shell001 = shell({ faces = ['end', seg01], thickness = 5}, extrude001)"
|
"shell001 = shell(extrude001, faces = ['end', seg01], thickness = 5)"
|
||||||
const formattedOutLastLine = '}, extrude001)'
|
|
||||||
|
|
||||||
await test.step(`Look for the grey of the shape`, async () => {
|
await test.step(`Look for the grey of the shape`, async () => {
|
||||||
await scene.expectPixelColor([99, 99, 99], testPoint, 15)
|
await scene.expectPixelColor([99, 99, 99], testPoint, 15)
|
||||||
@ -2034,7 +2033,7 @@ extrude001 = extrude(sketch001, length = 40)
|
|||||||
await editor.expectEditor.toContain(shellDeclaration)
|
await editor.expectEditor.toContain(shellDeclaration)
|
||||||
await editor.expectState({
|
await editor.expectState({
|
||||||
diagnostics: [],
|
diagnostics: [],
|
||||||
activeLines: [formattedOutLastLine],
|
activeLines: [shellDeclaration],
|
||||||
highlightedCode: '',
|
highlightedCode: '',
|
||||||
})
|
})
|
||||||
await scene.expectPixelColor([49, 49, 49], testPoint, 15)
|
await scene.expectPixelColor([49, 49, 49], testPoint, 15)
|
||||||
@ -2088,9 +2087,8 @@ extrude002 = extrude(sketch002, length = 50)
|
|||||||
// One dumb hardcoded screen pixel value
|
// One dumb hardcoded screen pixel value
|
||||||
const testPoint = { x: 550, y: 295 }
|
const testPoint = { x: 550, y: 295 }
|
||||||
const [clickOnCap] = scene.makeMouseHelpers(testPoint.x, testPoint.y)
|
const [clickOnCap] = scene.makeMouseHelpers(testPoint.x, testPoint.y)
|
||||||
const shellDeclaration = `shell001 = shell({ faces = ['end'], thickness = 5 }, ${
|
const shellTarget = hasExtrudesInPipe ? 'sketch002' : 'extrude002'
|
||||||
hasExtrudesInPipe ? 'sketch002' : 'extrude002'
|
const shellDeclaration = `shell001 = shell(${shellTarget}, faces = ['end'], thickness = 5)`
|
||||||
})`
|
|
||||||
|
|
||||||
await test.step(`Look for the grey of the shape`, async () => {
|
await test.step(`Look for the grey of the shape`, async () => {
|
||||||
await toolbar.closePane('code')
|
await toolbar.closePane('code')
|
||||||
|
@ -253,7 +253,7 @@ extrude001 = extrude(sketch001, length = 50)
|
|||||||
|>
|
|>
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 5)
|
example = extrude(exampleSketch, length = 5)
|
||||||
shell({ faces: ['end'], thickness: 0.25 }, exampleSketch)`
|
shell(exampleSketch, faces = ['end'], thickness = 0.25)`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@
|
|||||||
"fmt": "prettier --write ./src *.ts *.json *.js ./e2e ./packages",
|
"fmt": "prettier --write ./src *.ts *.json *.js ./e2e ./packages",
|
||||||
"fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e ./packages",
|
"fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e ./packages",
|
||||||
"fetch:wasm": "./get-latest-wasm-bundle.sh",
|
"fetch:wasm": "./get-latest-wasm-bundle.sh",
|
||||||
"fetch:samples": "echo \"Fetching latest KCL samples...\" && curl -o public/kcl-samples-manifest-fallback.json https://raw.githubusercontent.com/KittyCAD/kcl-samples/main/manifest.json",
|
"fetch:samples": "echo \"Fetching latest KCL samples...\" && curl -o public/kcl-samples-manifest-fallback.json https://raw.githubusercontent.com/KittyCAD/kcl-samples/achalmers/kw-shell/manifest.json",
|
||||||
"isomorphic-copy-wasm": "(copy src/wasm-lib/pkg/wasm_lib_bg.wasm public || cp src/wasm-lib/pkg/wasm_lib_bg.wasm public)",
|
"isomorphic-copy-wasm": "(copy src/wasm-lib/pkg/wasm_lib_bg.wasm public || cp src/wasm-lib/pkg/wasm_lib_bg.wasm public)",
|
||||||
"build:wasm-dev": "yarn wasm-prep && (cd src/wasm-lib && wasm-pack build --dev --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && yarn isomorphic-copy-wasm && yarn fmt",
|
"build:wasm-dev": "yarn wasm-prep && (cd src/wasm-lib && wasm-pack build --dev --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && yarn isomorphic-copy-wasm && yarn fmt",
|
||||||
"build:wasm": "yarn wasm-prep && cd src/wasm-lib && wasm-pack build --release --target web --out-dir pkg && cargo test -p kcl-lib export_bindings && cd ../.. && yarn isomorphic-copy-wasm && yarn fmt",
|
"build:wasm": "yarn wasm-prep && cd src/wasm-lib && wasm-pack build --release --target web --out-dir pkg && cargo test -p kcl-lib export_bindings && cd ../.. && yarn isomorphic-copy-wasm && yarn fmt",
|
||||||
|
@ -28,7 +28,14 @@ try {
|
|||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
child_process.spawnSync('git', ['clone', URL_GIT_KCL_SAMPLES, DIR_KCL_SAMPLES])
|
child_process.spawnSync('git', [
|
||||||
|
'clone',
|
||||||
|
'--single-branch',
|
||||||
|
'--branch',
|
||||||
|
'achalmers/kw-shell',
|
||||||
|
URL_GIT_KCL_SAMPLES,
|
||||||
|
DIR_KCL_SAMPLES,
|
||||||
|
])
|
||||||
|
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
let files = await fs.readdir(DIR_KCL_SAMPLES)
|
let files = await fs.readdir(DIR_KCL_SAMPLES)
|
||||||
|
@ -17,6 +17,8 @@ import {
|
|||||||
createObjectExpression,
|
createObjectExpression,
|
||||||
createArrayExpression,
|
createArrayExpression,
|
||||||
createVariableDeclaration,
|
createVariableDeclaration,
|
||||||
|
createCallExpressionStdLibKw,
|
||||||
|
createLabeledArg,
|
||||||
} from 'lang/modifyAst'
|
} from 'lang/modifyAst'
|
||||||
import { KCL_DEFAULT_CONSTANT_PREFIXES } from 'lib/constants'
|
import { KCL_DEFAULT_CONSTANT_PREFIXES } from 'lib/constants'
|
||||||
import { KclManager } from 'lang/KclSingleton'
|
import { KclManager } from 'lang/KclSingleton'
|
||||||
@ -121,13 +123,14 @@ export function addShell({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const name = findUniqueName(node, KCL_DEFAULT_CONSTANT_PREFIXES.SHELL)
|
const name = findUniqueName(node, KCL_DEFAULT_CONSTANT_PREFIXES.SHELL)
|
||||||
const shell = createCallExpressionStdLib('shell', [
|
const shell = createCallExpressionStdLibKw(
|
||||||
createObjectExpression({
|
'shell',
|
||||||
faces: createArrayExpression(expressions),
|
|
||||||
thickness,
|
|
||||||
}),
|
|
||||||
createIdentifier(extrudeNode.node.id.name),
|
createIdentifier(extrudeNode.node.id.name),
|
||||||
])
|
[
|
||||||
|
createLabeledArg('faces', createArrayExpression(expressions)),
|
||||||
|
createLabeledArg('thickness', thickness),
|
||||||
|
]
|
||||||
|
)
|
||||||
const declaration = createVariableDeclaration(name, shell)
|
const declaration = createVariableDeclaration(name, shell)
|
||||||
|
|
||||||
// TODO: check if we should append at the end like here or right after the extrude
|
// TODO: check if we should append at the end like here or right after the extrude
|
||||||
@ -137,8 +140,7 @@ export function addShell({
|
|||||||
[modifiedAst.body.length - 1, 'index'],
|
[modifiedAst.body.length - 1, 'index'],
|
||||||
['declaration', 'VariableDeclaration'],
|
['declaration', 'VariableDeclaration'],
|
||||||
['init', 'VariableDeclarator'],
|
['init', 'VariableDeclarator'],
|
||||||
['arguments', 'CallExpression'],
|
['unlabeled', 'CallExpressionKw'],
|
||||||
[0, 'index'],
|
|
||||||
]
|
]
|
||||||
return {
|
return {
|
||||||
modifiedAst,
|
modifiedAst,
|
||||||
|
@ -242,7 +242,7 @@ firstSketch = startSketchOn('XY')
|
|||||||
|> extrude(length = 6)
|
|> extrude(length = 6)
|
||||||
|
|
||||||
// Remove the end face for the extrusion.
|
// Remove the end face for the extrusion.
|
||||||
shell({ faces = ['end'], thickness = 0.25 }, firstSketch)"#;
|
shell(firstSketch, faces = ['end'], thickness = 0.25)"#;
|
||||||
|
|
||||||
let (program, ctx, _) = parse_execute(new).await.unwrap();
|
let (program, ctx, _) = parse_execute(new).await.unwrap();
|
||||||
|
|
||||||
@ -273,7 +273,7 @@ firstSketch = startSketchOn('XY')
|
|||||||
|> extrude(length = 6)
|
|> extrude(length = 6)
|
||||||
|
|
||||||
// Remove the end face for the extrusion.
|
// Remove the end face for the extrusion.
|
||||||
shell({ faces = ['end'], thickness = 0.25 }, firstSketch) "#;
|
shell(firstSketch, faces = ['end'], thickness = 0.25) "#;
|
||||||
|
|
||||||
let new = r#"// Remove the end face for the extrusion.
|
let new = r#"// Remove the end face for the extrusion.
|
||||||
firstSketch = startSketchOn('XY')
|
firstSketch = startSketchOn('XY')
|
||||||
@ -285,7 +285,7 @@ firstSketch = startSketchOn('XY')
|
|||||||
|> extrude(length = 6)
|
|> extrude(length = 6)
|
||||||
|
|
||||||
// Remove the end face for the extrusion.
|
// Remove the end face for the extrusion.
|
||||||
shell({ faces = ['end'], thickness = 0.25 }, firstSketch)"#;
|
shell(firstSketch, faces = ['end'], thickness = 0.25)"#;
|
||||||
|
|
||||||
let (program_old, ctx, _) = parse_execute(old).await.unwrap();
|
let (program_old, ctx, _) = parse_execute(old).await.unwrap();
|
||||||
|
|
||||||
@ -318,7 +318,7 @@ firstSketch = startSketchOn('XY')
|
|||||||
|> extrude(length = 6)
|
|> extrude(length = 6)
|
||||||
|
|
||||||
// Remove the end face for the extrusion.
|
// Remove the end face for the extrusion.
|
||||||
shell({ faces = ['end'], thickness = 0.25 }, firstSketch) "#;
|
shell(firstSketch, faces = ['end'], thickness = 0.25) "#;
|
||||||
|
|
||||||
let new = r#"// Remove the end face for the extrusion.
|
let new = r#"// Remove the end face for the extrusion.
|
||||||
firstSketch = startSketchOn('XY')
|
firstSketch = startSketchOn('XY')
|
||||||
@ -330,7 +330,7 @@ firstSketch = startSketchOn('XY')
|
|||||||
|> extrude(length = 6)
|
|> extrude(length = 6)
|
||||||
|
|
||||||
// Remove the end face for the extrusion.
|
// Remove the end face for the extrusion.
|
||||||
shell({ faces = ['end'], thickness = 0.25 }, firstSketch)"#;
|
shell(firstSketch, faces = ['end'], thickness = 0.25)"#;
|
||||||
|
|
||||||
let (program, ctx, _) = parse_execute(old).await.unwrap();
|
let (program, ctx, _) = parse_execute(old).await.unwrap();
|
||||||
|
|
||||||
@ -363,7 +363,7 @@ firstSketch = startSketchOn('XY')
|
|||||||
|> extrude(length = 6)
|
|> extrude(length = 6)
|
||||||
|
|
||||||
// Remove the end face for the extrusion.
|
// Remove the end face for the extrusion.
|
||||||
shell({ faces = ['end'], thickness = 0.25 }, firstSketch) "#;
|
shell(firstSketch, faces = ['end'], thickness = 0.25) "#;
|
||||||
|
|
||||||
let new = r#"// Remove the end face for the extrusion.
|
let new = r#"// Remove the end face for the extrusion.
|
||||||
firstSketch = startSketchOn('XY')
|
firstSketch = startSketchOn('XY')
|
||||||
@ -375,7 +375,7 @@ firstSketch = startSketchOn('XY')
|
|||||||
|> extrude(length = 6)
|
|> extrude(length = 6)
|
||||||
|
|
||||||
// Remove the end face for the extrusion.
|
// Remove the end face for the extrusion.
|
||||||
shell({ faces = ['end'], thickness = 0.25 }, firstSketch)"#;
|
shell(firstSketch, faces = ['end'], thickness = 0.25)"#;
|
||||||
|
|
||||||
let (program, ctx, _) = parse_execute(old).await.unwrap();
|
let (program, ctx, _) = parse_execute(old).await.unwrap();
|
||||||
|
|
||||||
@ -409,7 +409,7 @@ firstSketch = startSketchOn('XY')
|
|||||||
|> extrude(length = 6)
|
|> extrude(length = 6)
|
||||||
|
|
||||||
// Remove the end face for the extrusion.
|
// Remove the end face for the extrusion.
|
||||||
shell({ faces = ['end'], thickness = 0.25 }, firstSketch)"#;
|
shell(firstSketch, faces = ['end'], thickness = 0.25)"#;
|
||||||
|
|
||||||
let (program, mut ctx, _) = parse_execute(new).await.unwrap();
|
let (program, mut ctx, _) = parse_execute(new).await.unwrap();
|
||||||
|
|
||||||
@ -451,7 +451,7 @@ firstSketch = startSketchOn('XY')
|
|||||||
|> extrude(length = 6)
|
|> extrude(length = 6)
|
||||||
|
|
||||||
// Remove the end face for the extrusion.
|
// Remove the end face for the extrusion.
|
||||||
shell({ faces = ['end'], thickness = 0.25 }, firstSketch)"#;
|
shell(firstSketch, faces = ['end'], thickness = 0.25)"#;
|
||||||
|
|
||||||
let (program, mut ctx, _) = parse_execute(new).await.unwrap();
|
let (program, mut ctx, _) = parse_execute(new).await.unwrap();
|
||||||
|
|
||||||
@ -486,7 +486,7 @@ firstSketch = startSketchOn('XY')
|
|||||||
|> extrude(length = 6)
|
|> extrude(length = 6)
|
||||||
|
|
||||||
// Remove the end face for the extrusion.
|
// Remove the end face for the extrusion.
|
||||||
shell({ faces = ['end'], thickness = 0.25 }, firstSketch)"#;
|
shell(firstSketch, faces = ['end'], thickness = 0.25)"#;
|
||||||
|
|
||||||
let (program, mut ctx, _) = parse_execute(new).await.unwrap();
|
let (program, mut ctx, _) = parse_execute(new).await.unwrap();
|
||||||
|
|
||||||
|
@ -1590,10 +1590,10 @@ let w = f() + f()
|
|||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
|> extrude(length = 40.14)
|
|> extrude(length = 40.14)
|
||||||
|> shell({
|
|> shell(
|
||||||
faces: [seg01],
|
thickness = 3.14,
|
||||||
thickness: 3.14,
|
faces = [seg01]
|
||||||
}, %)
|
)
|
||||||
"#;
|
"#;
|
||||||
|
|
||||||
let ctx = crate::test_server::new_context(UnitLength::Mm, true, None)
|
let ctx = crate::test_server::new_context(UnitLength::Mm, true, None)
|
||||||
@ -1620,10 +1620,10 @@ let w = f() + f()
|
|||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
|> extrude(length = 40.14)
|
|> extrude(length = 40.14)
|
||||||
|> shell({
|
|> shell(
|
||||||
faces: [seg01],
|
faces = [seg01],
|
||||||
thickness: 3.14,
|
thickness = 3.14,
|
||||||
}, %)
|
)
|
||||||
"#;
|
"#;
|
||||||
|
|
||||||
// Execute a slightly different program again.
|
// Execute a slightly different program again.
|
||||||
|
@ -120,10 +120,11 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
|
|||||||
/// |> close()
|
/// |> close()
|
||||||
/// |> extrude(length = 6)
|
/// |> extrude(length = 6)
|
||||||
///
|
///
|
||||||
/// shell({
|
/// shell(
|
||||||
|
/// firstSketch,
|
||||||
/// faces = ['end'],
|
/// faces = ['end'],
|
||||||
/// thickness = 0.25,
|
/// thickness = 0.25,
|
||||||
/// }, firstSketch)
|
/// )
|
||||||
/// |> appearance({
|
/// |> appearance({
|
||||||
/// color = '#ff0000',
|
/// color = '#ff0000',
|
||||||
/// metalness = 90,
|
/// metalness = 90,
|
||||||
@ -147,10 +148,11 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
|
|||||||
/// roughness = 90
|
/// roughness = 90
|
||||||
/// }, %)
|
/// }, %)
|
||||||
///
|
///
|
||||||
/// shell({
|
/// shell(
|
||||||
|
/// firstSketch,
|
||||||
/// faces = ['end'],
|
/// faces = ['end'],
|
||||||
/// thickness = 0.25,
|
/// thickness = 0.25,
|
||||||
/// }, firstSketch)
|
/// )
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
|
@ -1019,15 +1019,6 @@ impl<'a> FromKclValue<'a> for super::sketch::BezierData {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> FromKclValue<'a> for super::shell::ShellData {
|
|
||||||
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
|
|
||||||
let obj = arg.as_object()?;
|
|
||||||
let_field_of!(obj, thickness);
|
|
||||||
let_field_of!(obj, faces);
|
|
||||||
Some(Self { thickness, faces })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> FromKclValue<'a> for super::chamfer::ChamferData {
|
impl<'a> FromKclValue<'a> for super::chamfer::ChamferData {
|
||||||
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
|
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
|
||||||
let obj = arg.as_object()?;
|
let obj = arg.as_object()?;
|
||||||
|
@ -4,8 +4,6 @@ use anyhow::Result;
|
|||||||
use derive_docs::stdlib;
|
use derive_docs::stdlib;
|
||||||
use kcmc::{each_cmd as mcmd, length_unit::LengthUnit, ModelingCmd};
|
use kcmc::{each_cmd as mcmd, length_unit::LengthUnit, ModelingCmd};
|
||||||
use kittycad_modeling_cmds as kcmc;
|
use kittycad_modeling_cmds as kcmc;
|
||||||
use schemars::JsonSchema;
|
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
errors::{KclError, KclErrorDetails},
|
errors::{KclError, KclErrorDetails},
|
||||||
@ -13,22 +11,13 @@ use crate::{
|
|||||||
std::{sketch::FaceTag, Args},
|
std::{sketch::FaceTag, Args},
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Data for shells.
|
|
||||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
|
||||||
#[ts(export)]
|
|
||||||
#[serde(rename_all = "camelCase")]
|
|
||||||
pub struct ShellData {
|
|
||||||
/// The thickness of the shell.
|
|
||||||
pub thickness: f64,
|
|
||||||
/// The faces you want removed.
|
|
||||||
pub faces: Vec<FaceTag>,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Create a shell.
|
/// Create a shell.
|
||||||
pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||||
let (data, solid_set): (ShellData, SolidSet) = args.get_data_and_solid_set()?;
|
let solid_set = args.get_unlabeled_kw_arg("solidSet")?;
|
||||||
|
let thickness = args.get_kw_arg("thickness")?;
|
||||||
|
let faces = args.get_kw_arg("faces")?;
|
||||||
|
|
||||||
let result = inner_shell(data, solid_set, exec_state, args).await?;
|
let result = inner_shell(solid_set, thickness, faces, exec_state, args).await?;
|
||||||
Ok(result.into())
|
Ok(result.into())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,10 +36,11 @@ pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
|
|||||||
/// |> extrude(length = 6)
|
/// |> extrude(length = 6)
|
||||||
///
|
///
|
||||||
/// // Remove the end face for the extrusion.
|
/// // Remove the end face for the extrusion.
|
||||||
/// shell({
|
/// shell(
|
||||||
|
/// firstSketch,
|
||||||
/// faces = ['end'],
|
/// faces = ['end'],
|
||||||
/// thickness = 0.25,
|
/// thickness = 0.25,
|
||||||
/// }, firstSketch)
|
/// )
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
@ -64,10 +54,11 @@ pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
|
|||||||
/// |> extrude(length = 6)
|
/// |> extrude(length = 6)
|
||||||
///
|
///
|
||||||
/// // Remove the start face for the extrusion.
|
/// // Remove the start face for the extrusion.
|
||||||
/// shell({
|
/// shell(
|
||||||
|
/// firstSketch,
|
||||||
/// faces = ['start'],
|
/// faces = ['start'],
|
||||||
/// thickness = 0.25,
|
/// thickness = 0.25,
|
||||||
/// }, firstSketch)
|
/// )
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
@ -81,10 +72,11 @@ pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
|
|||||||
/// |> extrude(length = 6)
|
/// |> extrude(length = 6)
|
||||||
///
|
///
|
||||||
/// // Remove a tagged face for the extrusion.
|
/// // Remove a tagged face for the extrusion.
|
||||||
/// shell({
|
/// shell(
|
||||||
|
/// firstSketch,
|
||||||
/// faces = [myTag],
|
/// faces = [myTag],
|
||||||
/// thickness = 0.25,
|
/// thickness = 0.25,
|
||||||
/// }, firstSketch)
|
/// )
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
@ -98,10 +90,11 @@ pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
|
|||||||
/// |> extrude(length = 6)
|
/// |> extrude(length = 6)
|
||||||
///
|
///
|
||||||
/// // Remove a tagged face and the end face for the extrusion.
|
/// // Remove a tagged face and the end face for the extrusion.
|
||||||
/// shell({
|
/// shell(
|
||||||
|
/// firstSketch,
|
||||||
/// faces = [myTag, 'end'],
|
/// faces = [myTag, 'end'],
|
||||||
/// thickness = 0.25,
|
/// thickness = 0.25,
|
||||||
/// }, firstSketch)
|
/// )
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
@ -124,7 +117,7 @@ pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
|
|||||||
/// |> extrude(length = 50)
|
/// |> extrude(length = 50)
|
||||||
///
|
///
|
||||||
/// // We put "case" in the shell function to shell the entire object.
|
/// // We put "case" in the shell function to shell the entire object.
|
||||||
/// shell({ faces = ['start'], thickness = 5 }, case)
|
/// shell(case, faces = ['start'], thickness = 5)
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
@ -147,7 +140,7 @@ pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
|
|||||||
/// |> extrude(length = 50)
|
/// |> extrude(length = 50)
|
||||||
///
|
///
|
||||||
/// // We put "thing1" in the shell function to shell the end face of the object.
|
/// // We put "thing1" in the shell function to shell the end face of the object.
|
||||||
/// shell({ faces = ['end'], thickness = 5 }, thing1)
|
/// shell(thing1, faces = ['end'], thickness = 5)
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
@ -172,21 +165,29 @@ pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
|
|||||||
/// |> extrude(length = 50)
|
/// |> extrude(length = 50)
|
||||||
///
|
///
|
||||||
/// // We put "thing1" and "thing2" in the shell function to shell the end face of the object.
|
/// // We put "thing1" and "thing2" in the shell function to shell the end face of the object.
|
||||||
/// shell({ faces = ['end'], thickness = 5 }, [thing1, thing2])
|
/// shell([thing1, thing2], faces = ['end'], thickness = 5)
|
||||||
/// ```
|
/// ```
|
||||||
#[stdlib {
|
#[stdlib {
|
||||||
name = "shell",
|
name = "shell",
|
||||||
feature_tree_operation = true,
|
feature_tree_operation = true,
|
||||||
|
keywords = true,
|
||||||
|
unlabeled_first = true,
|
||||||
|
args = {
|
||||||
|
solid_set = { docs = "Which solid (or solids) to shell out"},
|
||||||
|
thickness = {docs = "The thickness of the shell"},
|
||||||
|
faces = {docs = "The faces you want removed"},
|
||||||
|
}
|
||||||
}]
|
}]
|
||||||
async fn inner_shell(
|
async fn inner_shell(
|
||||||
data: ShellData,
|
|
||||||
solid_set: SolidSet,
|
solid_set: SolidSet,
|
||||||
|
thickness: f64,
|
||||||
|
faces: Vec<FaceTag>,
|
||||||
exec_state: &mut ExecState,
|
exec_state: &mut ExecState,
|
||||||
args: Args,
|
args: Args,
|
||||||
) -> Result<SolidSet, KclError> {
|
) -> Result<SolidSet, KclError> {
|
||||||
if data.faces.is_empty() {
|
if faces.is_empty() {
|
||||||
return Err(KclError::Type(KclErrorDetails {
|
return Err(KclError::Type(KclErrorDetails {
|
||||||
message: "Expected at least one face".to_string(),
|
message: "You must shell at least one face".to_string(),
|
||||||
source_ranges: vec![args.source_range],
|
source_ranges: vec![args.source_range],
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@ -194,7 +195,7 @@ async fn inner_shell(
|
|||||||
let solids: Vec<Box<Solid>> = solid_set.clone().into();
|
let solids: Vec<Box<Solid>> = solid_set.clone().into();
|
||||||
if solids.is_empty() {
|
if solids.is_empty() {
|
||||||
return Err(KclError::Type(KclErrorDetails {
|
return Err(KclError::Type(KclErrorDetails {
|
||||||
message: "Expected at least one solid".to_string(),
|
message: "You must shell at least one solid".to_string(),
|
||||||
source_ranges: vec![args.source_range],
|
source_ranges: vec![args.source_range],
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@ -205,7 +206,7 @@ async fn inner_shell(
|
|||||||
// If we do not do these for sketch on face, things will fail with face does not exist.
|
// If we do not do these for sketch on face, things will fail with face does not exist.
|
||||||
args.flush_batch_for_solid_set(exec_state, solid.clone().into()).await?;
|
args.flush_batch_for_solid_set(exec_state, solid.clone().into()).await?;
|
||||||
|
|
||||||
for tag in &data.faces {
|
for tag in &faces {
|
||||||
let extrude_plane_id = tag.get_face_id(solid, exec_state, &args, false).await?;
|
let extrude_plane_id = tag.get_face_id(solid, exec_state, &args, false).await?;
|
||||||
|
|
||||||
face_ids.push(extrude_plane_id);
|
face_ids.push(extrude_plane_id);
|
||||||
@ -235,7 +236,7 @@ async fn inner_shell(
|
|||||||
hollow: false,
|
hollow: false,
|
||||||
face_ids,
|
face_ids,
|
||||||
object_id: solids[0].id,
|
object_id: solids[0].id,
|
||||||
shell_thickness: LengthUnit(data.thickness),
|
shell_thickness: LengthUnit(thickness),
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
@ -2542,7 +2542,7 @@ snapshot_kind: text
|
|||||||
"cmdId": "[uuid]",
|
"cmdId": "[uuid]",
|
||||||
"range": [
|
"range": [
|
||||||
2047,
|
2047,
|
||||||
2110,
|
2102,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"command": {
|
"command": {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: kcl/src/simulation_tests.rs
|
source: kcl/src/simulation_tests.rs
|
||||||
description: Result of parsing fillet-and-shell.kcl
|
description: Result of parsing fillet-and-shell.kcl
|
||||||
|
snapshot_kind: text
|
||||||
---
|
---
|
||||||
{
|
{
|
||||||
"Ok": {
|
"Ok": {
|
||||||
@ -2582,68 +2583,45 @@ description: Result of parsing fillet-and-shell.kcl
|
|||||||
"type": "ExpressionStatement"
|
"type": "ExpressionStatement"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"end": 2110,
|
"end": 2102,
|
||||||
"expression": {
|
"expression": {
|
||||||
"arguments": [
|
"arguments": [
|
||||||
{
|
{
|
||||||
"end": 2103,
|
"type": "LabeledArg",
|
||||||
"properties": [
|
"label": {
|
||||||
{
|
"type": "Identifier",
|
||||||
"end": 2072,
|
"name": "faces"
|
||||||
"key": {
|
},
|
||||||
"end": 2062,
|
"arg": {
|
||||||
"name": "faces",
|
"elements": [
|
||||||
"start": 2057,
|
{
|
||||||
"type": "Identifier"
|
"end": 2073,
|
||||||
},
|
"raw": "'end'",
|
||||||
"start": 2057,
|
"start": 2068,
|
||||||
"type": "ObjectProperty",
|
"type": "Literal",
|
||||||
"value": {
|
"type": "Literal",
|
||||||
"elements": [
|
"value": "end"
|
||||||
{
|
|
||||||
"end": 2071,
|
|
||||||
"raw": "'end'",
|
|
||||||
"start": 2066,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": "end"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"end": 2072,
|
|
||||||
"start": 2065,
|
|
||||||
"type": "ArrayExpression",
|
|
||||||
"type": "ArrayExpression"
|
|
||||||
}
|
}
|
||||||
},
|
],
|
||||||
{
|
"end": 2074,
|
||||||
"end": 2101,
|
"start": 2067,
|
||||||
"key": {
|
"type": "ArrayExpression",
|
||||||
"end": 2085,
|
"type": "ArrayExpression"
|
||||||
"name": "thickness",
|
}
|
||||||
"start": 2076,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"start": 2076,
|
|
||||||
"type": "ObjectProperty",
|
|
||||||
"value": {
|
|
||||||
"end": 2101,
|
|
||||||
"name": "caseThickness",
|
|
||||||
"start": 2088,
|
|
||||||
"type": "Identifier",
|
|
||||||
"type": "Identifier"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"start": 2053,
|
|
||||||
"type": "ObjectExpression",
|
|
||||||
"type": "ObjectExpression"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"end": 2109,
|
"type": "LabeledArg",
|
||||||
"name": "case",
|
"label": {
|
||||||
"start": 2105,
|
"type": "Identifier",
|
||||||
"type": "Identifier",
|
"name": "thickness"
|
||||||
"type": "Identifier"
|
},
|
||||||
|
"arg": {
|
||||||
|
"end": 2101,
|
||||||
|
"name": "caseThickness",
|
||||||
|
"start": 2088,
|
||||||
|
"type": "Identifier",
|
||||||
|
"type": "Identifier"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"callee": {
|
"callee": {
|
||||||
@ -2652,17 +2630,24 @@ description: Result of parsing fillet-and-shell.kcl
|
|||||||
"start": 2047,
|
"start": 2047,
|
||||||
"type": "Identifier"
|
"type": "Identifier"
|
||||||
},
|
},
|
||||||
"end": 2110,
|
"end": 2102,
|
||||||
"start": 2047,
|
"start": 2047,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"end": 2057,
|
||||||
|
"name": "case",
|
||||||
|
"start": 2053,
|
||||||
|
"type": "Identifier",
|
||||||
|
"type": "Identifier"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"start": 2047,
|
"start": 2047,
|
||||||
"type": "ExpressionStatement",
|
"type": "ExpressionStatement",
|
||||||
"type": "ExpressionStatement"
|
"type": "ExpressionStatement"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"end": 2111,
|
"end": 2103,
|
||||||
"nonCodeMeta": {
|
"nonCodeMeta": {
|
||||||
"nonCodeNodes": {
|
"nonCodeNodes": {
|
||||||
"1": [
|
"1": [
|
||||||
|
@ -74,7 +74,4 @@ m25Screw(border + rpizWidth / 2 + widthBetweenScrews / 2, 0 + border + rpizLengt
|
|||||||
|
|
||||||
m25Screw(border + rpizWidth / 2 + widthBetweenScrews / 2, 0 + border + rpizLength / 2 - (lengthBetweenScrews / 2), screwHeight)
|
m25Screw(border + rpizWidth / 2 + widthBetweenScrews / 2, 0 + border + rpizLength / 2 - (lengthBetweenScrews / 2), screwHeight)
|
||||||
|
|
||||||
shell({
|
shell(case, faces = ['end'], thickness = caseThickness)
|
||||||
faces = ['end'],
|
|
||||||
thickness = caseThickness
|
|
||||||
}, case)
|
|
||||||
|
@ -402,17 +402,17 @@ snapshot_kind: text
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {
|
||||||
"data": {
|
"faces": {
|
||||||
"sourceRange": [
|
"sourceRange": [
|
||||||
2053,
|
2067,
|
||||||
2103,
|
2074,
|
||||||
0
|
0
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"solid_set": {
|
"thickness": {
|
||||||
"sourceRange": [
|
"sourceRange": [
|
||||||
2105,
|
2088,
|
||||||
2109,
|
2101,
|
||||||
0
|
0
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -420,10 +420,16 @@ snapshot_kind: text
|
|||||||
"name": "shell",
|
"name": "shell",
|
||||||
"sourceRange": [
|
"sourceRange": [
|
||||||
2047,
|
2047,
|
||||||
2110,
|
2102,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"type": "StdLibCall",
|
"type": "StdLibCall",
|
||||||
"unlabeledArg": null
|
"unlabeledArg": {
|
||||||
|
"sourceRange": [
|
||||||
|
2053,
|
||||||
|
2057,
|
||||||
|
0
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: kcl/src/simulation_tests.rs
|
source: kcl/src/simulation_tests.rs
|
||||||
description: Artifact commands import_whole.kcl
|
description: Artifact commands import_whole.kcl
|
||||||
|
snapshot_kind: text
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@ -525,7 +526,7 @@ description: Artifact commands import_whole.kcl
|
|||||||
"cmdId": "[uuid]",
|
"cmdId": "[uuid]",
|
||||||
"range": [
|
"range": [
|
||||||
83,
|
83,
|
||||||
130,
|
123,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"command": {
|
"command": {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
source: kcl/src/simulation_tests.rs
|
source: kcl/src/simulation_tests.rs
|
||||||
description: Result of parsing import_whole.kcl
|
description: Result of parsing import_whole.kcl
|
||||||
|
snapshot_kind: text
|
||||||
---
|
---
|
||||||
{
|
{
|
||||||
"Ok": {
|
"Ok": {
|
||||||
@ -26,7 +27,7 @@ description: Result of parsing import_whole.kcl
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"declaration": {
|
"declaration": {
|
||||||
"end": 130,
|
"end": 123,
|
||||||
"id": {
|
"id": {
|
||||||
"end": 71,
|
"end": 71,
|
||||||
"name": "bar",
|
"name": "bar",
|
||||||
@ -45,67 +46,45 @@ description: Result of parsing import_whole.kcl
|
|||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
{
|
{
|
||||||
"end": 126,
|
"type": "LabeledArg",
|
||||||
"properties": [
|
"label": {
|
||||||
{
|
"type": "Identifier",
|
||||||
"end": 106,
|
"name": "faces"
|
||||||
"key": {
|
},
|
||||||
"end": 96,
|
"arg": {
|
||||||
"name": "faces",
|
"elements": [
|
||||||
"start": 91,
|
{
|
||||||
"type": "Identifier"
|
"end": 103,
|
||||||
},
|
"raw": "'end'",
|
||||||
"start": 91,
|
"start": 98,
|
||||||
"type": "ObjectProperty",
|
|
||||||
"value": {
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"end": 105,
|
|
||||||
"raw": "'end'",
|
|
||||||
"start": 100,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": "end"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"end": 106,
|
|
||||||
"start": 99,
|
|
||||||
"type": "ArrayExpression",
|
|
||||||
"type": "ArrayExpression"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"end": 124,
|
|
||||||
"key": {
|
|
||||||
"end": 117,
|
|
||||||
"name": "thickness",
|
|
||||||
"start": 108,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"start": 108,
|
|
||||||
"type": "ObjectProperty",
|
|
||||||
"value": {
|
|
||||||
"end": 124,
|
|
||||||
"raw": "0.25",
|
|
||||||
"start": 120,
|
|
||||||
"type": "Literal",
|
"type": "Literal",
|
||||||
"type": "Literal",
|
"type": "Literal",
|
||||||
"value": {
|
"value": "end"
|
||||||
"value": 0.25,
|
|
||||||
"suffix": "None"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
],
|
||||||
],
|
"end": 104,
|
||||||
"start": 89,
|
"start": 97,
|
||||||
"type": "ObjectExpression",
|
"type": "ArrayExpression",
|
||||||
"type": "ObjectExpression"
|
"type": "ArrayExpression"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"end": 129,
|
"type": "LabeledArg",
|
||||||
"start": 128,
|
"label": {
|
||||||
"type": "PipeSubstitution",
|
"type": "Identifier",
|
||||||
"type": "PipeSubstitution"
|
"name": "thickness"
|
||||||
|
},
|
||||||
|
"arg": {
|
||||||
|
"end": 122,
|
||||||
|
"raw": "0.25",
|
||||||
|
"start": 118,
|
||||||
|
"type": "Literal",
|
||||||
|
"type": "Literal",
|
||||||
|
"value": {
|
||||||
|
"value": 0.25,
|
||||||
|
"suffix": "None"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"callee": {
|
"callee": {
|
||||||
@ -114,13 +93,14 @@ description: Result of parsing import_whole.kcl
|
|||||||
"start": 83,
|
"start": 83,
|
||||||
"type": "Identifier"
|
"type": "Identifier"
|
||||||
},
|
},
|
||||||
"end": 130,
|
"end": 123,
|
||||||
"start": 83,
|
"start": 83,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"end": 130,
|
"end": 123,
|
||||||
"start": 74,
|
"start": 74,
|
||||||
"type": "PipeExpression",
|
"type": "PipeExpression",
|
||||||
"type": "PipeExpression"
|
"type": "PipeExpression"
|
||||||
@ -128,14 +108,14 @@ description: Result of parsing import_whole.kcl
|
|||||||
"start": 68,
|
"start": 68,
|
||||||
"type": "VariableDeclarator"
|
"type": "VariableDeclarator"
|
||||||
},
|
},
|
||||||
"end": 130,
|
"end": 123,
|
||||||
"kind": "const",
|
"kind": "const",
|
||||||
"start": 68,
|
"start": 68,
|
||||||
"type": "VariableDeclaration",
|
"type": "VariableDeclaration",
|
||||||
"type": "VariableDeclaration"
|
"type": "VariableDeclaration"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"end": 131,
|
"end": 124,
|
||||||
"nonCodeMeta": {
|
"nonCodeMeta": {
|
||||||
"nonCodeNodes": {
|
"nonCodeNodes": {
|
||||||
"0": [
|
"0": [
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
import "exported_mod.kcl" as foo
|
import "exported_mod.kcl" as foo
|
||||||
|
|
||||||
bar = foo
|
bar = foo
|
||||||
|> shell({ faces = ['end'], thickness = 0.25 }, %)
|
|> shell(faces = ['end'], thickness = 0.25)
|
||||||
|
@ -1,21 +1,22 @@
|
|||||||
---
|
---
|
||||||
source: kcl/src/simulation_tests.rs
|
source: kcl/src/simulation_tests.rs
|
||||||
description: Operations executed import_whole.kcl
|
description: Operations executed import_whole.kcl
|
||||||
|
snapshot_kind: text
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {
|
||||||
"data": {
|
"faces": {
|
||||||
"sourceRange": [
|
"sourceRange": [
|
||||||
89,
|
97,
|
||||||
126,
|
104,
|
||||||
0
|
0
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"solid_set": {
|
"thickness": {
|
||||||
"sourceRange": [
|
"sourceRange": [
|
||||||
128,
|
118,
|
||||||
129,
|
122,
|
||||||
0
|
0
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -23,7 +24,7 @@ description: Operations executed import_whole.kcl
|
|||||||
"name": "shell",
|
"name": "shell",
|
||||||
"sourceRange": [
|
"sourceRange": [
|
||||||
83,
|
83,
|
||||||
130,
|
123,
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"type": "StdLibCall",
|
"type": "StdLibCall",
|
||||||
|
@ -75,7 +75,7 @@ m25Screw(border + rpizWidth / 2 + widthBetweenScrews / 2, 0 + border + rpizLengt
|
|||||||
|
|
||||||
m25Screw(border + rpizWidth / 2 + widthBetweenScrews / 2, 0 + border + rpizLength / 2 - (lengthBetweenScrews / 2), screwHeight)
|
m25Screw(border + rpizWidth / 2 + widthBetweenScrews / 2, 0 + border + rpizLength / 2 - (lengthBetweenScrews / 2), screwHeight)
|
||||||
|
|
||||||
shell({
|
shell(
|
||||||
faces: ['end'],
|
faces = ['end'],
|
||||||
thickness: caseThickness
|
thickness = caseThickness
|
||||||
}, case)
|
)
|
||||||
|
@ -1534,10 +1534,10 @@ async fn kcl_test_shell_with_tag() {
|
|||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
|> extrude(length = 40.14)
|
|> extrude(length = 40.14)
|
||||||
|> shell({
|
|> shell(
|
||||||
faces: [seg01],
|
faces = [seg01],
|
||||||
thickness: 3.14,
|
thickness = 3.14,
|
||||||
}, %)
|
)
|
||||||
"#;
|
"#;
|
||||||
|
|
||||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||||
@ -1998,10 +1998,10 @@ async fn kcl_test_error_no_auth_websocket() {
|
|||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
|> extrude(length = 40.14)
|
|> extrude(length = 40.14)
|
||||||
|> shell({
|
|> shell(
|
||||||
faces: [seg01],
|
faces = [seg01],
|
||||||
thickness: 3.14,
|
thickness = 3.14,
|
||||||
}, %)
|
)
|
||||||
"#;
|
"#;
|
||||||
|
|
||||||
let result = execute_and_snapshot_no_auth(code, UnitLength::Mm, None).await;
|
let result = execute_and_snapshot_no_auth(code, UnitLength::Mm, None).await;
|
||||||
|
Reference in New Issue
Block a user