Compare commits
1 Commits
codex/fix-
...
remove-ext
Author | SHA1 | Date | |
---|---|---|---|
448403d4fa |
56
.github/workflows/build-wasm.yml
vendored
@ -1,56 +0,0 @@
|
||||
name: Build WASM
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
npm-build-wasm:
|
||||
runs-on: runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: false # configured below
|
||||
|
||||
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||
with:
|
||||
tool: wasm-pack
|
||||
|
||||
- name: Use Rust cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: './rust'
|
||||
|
||||
- name: Build Wasm
|
||||
shell: bash
|
||||
run: npm run build:wasm
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: prepared-wasm
|
||||
path: |
|
||||
rust/kcl-wasm-lib/pkg/kcl_wasm_lib*
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: prepared-ts-rs-bindings
|
||||
path: |
|
||||
rust/kcl-lib/bindings/*
|
50
.github/workflows/cargo-test.yml
vendored
@ -155,7 +155,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
- name: Install Rust
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: false # Configured below.
|
||||
@ -190,54 +190,6 @@ jobs:
|
||||
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
|
||||
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
CI_PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
run-internal-kcl-samples:
|
||||
name: cargo test (internal-kcl-samples)
|
||||
runs-on:
|
||||
- runs-on=${{ github.run_id }}
|
||||
- runner=32cpu-linux-x64
|
||||
- extras=s3-cache
|
||||
steps:
|
||||
- uses: runs-on/action@v1
|
||||
- uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
|
||||
private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
- name: Install Rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: false # Configured below.
|
||||
- name: Start Vector
|
||||
run: .github/ci-cd-scripts/start-vector-ubuntu.sh
|
||||
env:
|
||||
GH_ACTIONS_AXIOM_TOKEN: ${{ secrets.GH_ACTIONS_AXIOM_TOKEN }}
|
||||
OS_NAME: ${{ env.OS_NAME }}
|
||||
- uses: taiki-e/install-action@nextest
|
||||
- name: Download internal KCL samples
|
||||
run: git clone --depth=1 https://x-access-token:${{ secrets.GH_PAT_KCL_SAMPLES_INTERNAL }}@github.com/KittyCAD/kcl-samples-internal public/kcl-samples/internal
|
||||
- name: Run tests
|
||||
shell: bash
|
||||
run: |-
|
||||
cd rust/kcl-lib
|
||||
cargo nextest run \
|
||||
--retries=10 --no-fail-fast --features artifact-graph --profile=ci \
|
||||
internal \
|
||||
2>&1 | tee /tmp/github-actions.log
|
||||
env:
|
||||
TWENTY_TWENTY: overwrite
|
||||
INSTA_UPDATE: always
|
||||
EXPECTORATE: overwrite
|
||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN_DEV}}
|
||||
ZOO_HOST: https://api.dev.zoo.dev
|
||||
MODELING_APP_INTERNAL_SAMPLES_SECRET: ${{secrets.MODELING_APP_INTERNAL_SAMPLES_SECRET}}
|
||||
run-wasm-tests:
|
||||
name: Run wasm tests
|
||||
strategy:
|
||||
|
99
.github/workflows/kcl-language-server.yml
vendored
@ -21,11 +21,14 @@ on:
|
||||
- '**.rs'
|
||||
- .github/workflows/kcl-language-server.yml
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
CARGO_NET_RETRY: 10
|
||||
@ -35,9 +38,10 @@ env:
|
||||
MACOSX_DEPLOYMENT_TARGET: 10.15
|
||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
||||
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: kcl-language-server (vscode tests)
|
||||
name: vscode tests
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@ -73,20 +77,22 @@ jobs:
|
||||
include:
|
||||
- os: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
code-target: win32-x64
|
||||
#- os: windows-latest
|
||||
#target: i686-pc-windows-msvc
|
||||
#code-target:
|
||||
#win32-ia32
|
||||
#- os: windows-latest
|
||||
#target: aarch64-pc-windows-msvc
|
||||
#code-target: win32-arm64
|
||||
code-target:
|
||||
win32-x64
|
||||
#- os: windows-latest
|
||||
#target: i686-pc-windows-msvc
|
||||
#code-target:
|
||||
#win32-ia32
|
||||
#- os: windows-latest
|
||||
#target: aarch64-pc-windows-msvc
|
||||
#code-target: win32-arm64
|
||||
- os: ubuntu-latest
|
||||
target: x86_64-unknown-linux-gnu
|
||||
code-target: linux-x64
|
||||
#- os: ubuntu-latest
|
||||
#target: aarch64-unknown-linux-musl
|
||||
#code-target: linux-arm64
|
||||
code-target:
|
||||
linux-x64
|
||||
#- os: ubuntu-latest
|
||||
#target: aarch64-unknown-linux-musl
|
||||
#code-target: linux-arm64
|
||||
- os: ubuntu-latest
|
||||
target: aarch64-unknown-linux-gnu
|
||||
code-target: linux-arm64
|
||||
@ -99,33 +105,41 @@ jobs:
|
||||
- os: macos-latest
|
||||
target: aarch64-apple-darwin
|
||||
code-target: darwin-arm64
|
||||
name: kcl-language-server build-release (${{ matrix.target }})
|
||||
|
||||
name: build-release (${{ matrix.target }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
container: ${{ matrix.container }}
|
||||
|
||||
env:
|
||||
RA_TARGET: ${{ matrix.target }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: ${{ env.FETCH_DEPTH }}
|
||||
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
rm rust/rust-toolchain.toml
|
||||
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: rust
|
||||
components: rust-src
|
||||
target: ${{ matrix.target }}
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- name: Update apt repositories
|
||||
if: matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'arm-unknown-linux-gnueabihf' || matrix.os == 'ubuntu-latest'
|
||||
run: sudo apt-get update
|
||||
|
||||
- if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
name: Install deps
|
||||
shell: bash
|
||||
@ -150,53 +164,64 @@ jobs:
|
||||
zlib1g-dev
|
||||
|
||||
cargo install cross
|
||||
|
||||
- name: Install AArch64 target toolchain
|
||||
if: matrix.target == 'aarch64-unknown-linux-gnu'
|
||||
run: sudo apt-get install gcc-aarch64-linux-gnu
|
||||
|
||||
- name: Install ARM target toolchain
|
||||
if: matrix.target == 'arm-unknown-linux-gnueabihf'
|
||||
run: sudo apt-get install gcc-arm-linux-gnueabihf
|
||||
|
||||
- name: build
|
||||
run: |
|
||||
cd rust
|
||||
cargo kcl-language-server-release build --client-patch-version ${{ github.run_number }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
# npm will symlink which will cause issues w tarballing later
|
||||
yarn install
|
||||
|
||||
- name: Package Extension (release)
|
||||
if: startsWith(github.event.ref, 'refs/tags/')
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce package --yarn -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }}
|
||||
|
||||
- name: Package Extension (nightly)
|
||||
if: startsWith(github.event.ref, 'refs/tags/') == false
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce package --yarn -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} --pre-release
|
||||
|
||||
- name: remove server
|
||||
if: matrix.target == 'x86_64-unknown-linux-gnu'
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
rm -rf server
|
||||
|
||||
- name: Package Extension (no server, release)
|
||||
if: matrix.target == 'x86_64-unknown-linux-gnu' && startsWith(github.event.ref, 'refs/tags/')
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce package --yarn -o ../build/kcl-language-server-no-server.vsix
|
||||
|
||||
- name: Package Extension (no server, nightly)
|
||||
if: matrix.target == 'x86_64-unknown-linux-gnu' && startsWith(github.event.ref, 'refs/tags/') == false
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce package --yarn -o ../build/kcl-language-server-no-server.vsix --pre-release
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-${{ matrix.target }}
|
||||
path: ./rust/build
|
||||
|
||||
build-release-x86_64-unknown-linux-musl:
|
||||
name: kcl-language-server build-release (x86_64-unknown-linux-musl)
|
||||
name: build-release (x86_64-unknown-linux-musl)
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RA_TARGET: x86_64-unknown-linux-musl
|
||||
@ -206,6 +231,7 @@ jobs:
|
||||
image: alpine:latest
|
||||
volumes:
|
||||
- /usr/local/cargo/registry:/usr/local/cargo/registry
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
@ -219,46 +245,55 @@ jobs:
|
||||
nodejs \
|
||||
npm \
|
||||
yarn
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: ${{ env.FETCH_DEPTH }}
|
||||
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
rm rust/rust-toolchain.toml
|
||||
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: rust
|
||||
components: rust-src
|
||||
target: ${{ matrix.target }}
|
||||
|
||||
- name: build
|
||||
run: |
|
||||
cd rust
|
||||
cargo kcl-language-server-release build --client-patch-version ${{ github.run_number }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
# npm will symlink which will cause issues w tarballing later
|
||||
yarn install
|
||||
|
||||
- name: Package Extension (release)
|
||||
if: startsWith(github.event.ref, 'refs/tags/')
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce package --yarn -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64
|
||||
|
||||
- name: Package Extension (release)
|
||||
if: startsWith(github.event.ref, 'refs/tags/') == false
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce package --yarn -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64 --pre-release
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-x86_64-unknown-linux-musl
|
||||
path: ./rust/build
|
||||
|
||||
publish:
|
||||
name: kcl-language-server (publish)
|
||||
name: publish
|
||||
runs-on: ubuntu-latest
|
||||
needs: ["build-release", "build-release-x86_64-unknown-linux-musl"]
|
||||
if: startsWith(github.event.ref, 'refs/tags')
|
||||
@ -266,17 +301,22 @@ jobs:
|
||||
contents: write
|
||||
steps:
|
||||
- run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||
|
||||
- run: 'echo "TAG: $TAG"'
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: ${{ env.FETCH_DEPTH }}
|
||||
|
||||
- name: Install Nodejs
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- run: echo "HEAD_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||
- run: 'echo "HEAD_SHA: $HEAD_SHA"'
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-aarch64-apple-darwin
|
||||
@ -304,29 +344,33 @@ jobs:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-x86_64-pc-windows-msvc
|
||||
path: rust/build
|
||||
#- uses: actions/download-artifact@v4
|
||||
#with:
|
||||
#name: release-i686-pc-windows-msvc
|
||||
#path:
|
||||
#build
|
||||
#- uses: actions/download-artifact@v4
|
||||
#with:
|
||||
#name: release-aarch64-pc-windows-msvc
|
||||
#path: rust/build
|
||||
path:
|
||||
rust/build
|
||||
#- uses: actions/download-artifact@v4
|
||||
#with:
|
||||
#name: release-i686-pc-windows-msvc
|
||||
#path:
|
||||
#build
|
||||
#- uses: actions/download-artifact@v4
|
||||
#with:
|
||||
#name: release-aarch64-pc-windows-msvc
|
||||
#path: rust/build
|
||||
- run: ls -al ./rust/build
|
||||
|
||||
- name: Publish Release
|
||||
uses: ./.github/actions/github-release
|
||||
with:
|
||||
files: "rust/build/*"
|
||||
name: ${{ env.TAG }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: move files to dir for upload
|
||||
shell: bash
|
||||
run: |
|
||||
cd rust
|
||||
mkdir -p releases/language-server/${{ env.TAG }}
|
||||
cp -r build/* releases/language-server/${{ env.TAG }}
|
||||
|
||||
- name: "Authenticate to Google Cloud"
|
||||
uses: "google-github-actions/auth@v2.1.8"
|
||||
with:
|
||||
@ -341,12 +385,15 @@ jobs:
|
||||
with:
|
||||
path: rust/releases
|
||||
destination: dl.kittycad.io
|
||||
|
||||
- run: rm rust/build/kcl-language-server-no-server.vsix
|
||||
|
||||
- name: Publish Extension (Code Marketplace, release)
|
||||
# token from https://dev.azure.com/kcl-language-server/
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce publish --pat ${{ secrets.VSCE_PAT }} --packagePath ../build/kcl-language-server-*.vsix
|
||||
|
||||
- name: Publish Extension (OpenVSX, release)
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
|
32
.github/workflows/kcl-python-bindings.yml
vendored
@ -4,6 +4,7 @@
|
||||
# maturin generate-ci github
|
||||
#
|
||||
name: kcl-python-bindings
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@ -26,14 +27,16 @@ on:
|
||||
- '**.rs'
|
||||
- .github/workflows/kcl-python-bindings.yml
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
linux-x86_64:
|
||||
name: kcl-python-bindings (linux-x86_64)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@ -55,8 +58,8 @@ jobs:
|
||||
with:
|
||||
name: wheels-linux-x86_64
|
||||
path: rust/kcl-python-bindings/dist
|
||||
|
||||
windows:
|
||||
name: kcl-python-bindings (windows)
|
||||
runs-on: windows-16-cores
|
||||
strategy:
|
||||
matrix:
|
||||
@ -81,8 +84,8 @@ jobs:
|
||||
with:
|
||||
name: wheels-windows-${{ matrix.target }}
|
||||
path: rust/kcl-python-bindings/dist
|
||||
|
||||
macos:
|
||||
name: kcl-python-bindings (macos)
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
matrix:
|
||||
@ -107,8 +110,8 @@ jobs:
|
||||
with:
|
||||
name: wheels-macos-${{ matrix.target }}
|
||||
path: rust/kcl-python-bindings/dist
|
||||
|
||||
test:
|
||||
name: kcl-python-bindings (test)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@ -124,8 +127,8 @@ jobs:
|
||||
env:
|
||||
KITTYCAD_API_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
ZOO_HOST: https://api.dev.zoo.dev
|
||||
|
||||
sdist:
|
||||
name: kcl-python-bindings (sdist)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@ -133,10 +136,10 @@ jobs:
|
||||
uses: astral-sh/setup-uv@v5
|
||||
- name: Install codespell
|
||||
run: |
|
||||
uv venv .venv
|
||||
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
|
||||
echo "$PWD/.venv/bin" >> $GITHUB_PATH
|
||||
uv pip install pip --upgrade
|
||||
uv venv .venv
|
||||
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
|
||||
echo "$PWD/.venv/bin" >> $GITHUB_PATH
|
||||
uv pip install pip --upgrade
|
||||
- name: Build sdist
|
||||
uses: PyO3/maturin-action@v1
|
||||
with:
|
||||
@ -148,6 +151,7 @@ jobs:
|
||||
with:
|
||||
name: wheels-sdist
|
||||
path: rust/kcl-python-bindings/dist
|
||||
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
@ -164,11 +168,11 @@ jobs:
|
||||
uses: astral-sh/setup-uv@v5
|
||||
- name: do uv things
|
||||
run: |
|
||||
cd rust/kcl-python-bindings
|
||||
uv venv .venv
|
||||
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
|
||||
echo "$PWD/.venv/bin" >> $GITHUB_PATH
|
||||
uv pip install pip --upgrade
|
||||
cd rust/kcl-python-bindings
|
||||
uv venv .venv
|
||||
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
|
||||
echo "$PWD/.venv/bin" >> $GITHUB_PATH
|
||||
uv pip install pip --upgrade
|
||||
- name: Publish to PyPI
|
||||
uses: PyO3/maturin-action@v1
|
||||
env:
|
||||
|
167
.github/workflows/static-analysis.yml
vendored
@ -28,7 +28,53 @@ jobs:
|
||||
- run: npm run fmt:check
|
||||
|
||||
npm-build-wasm:
|
||||
uses: ./.github/workflows/build-wasm.yml
|
||||
# Build the wasm blob once on the fastest runner.
|
||||
runs-on: runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: false # Configured below.
|
||||
|
||||
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||
with:
|
||||
tool: wasm-pack
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: './rust'
|
||||
|
||||
- name: Build Wasm
|
||||
shell: bash
|
||||
run: npm run build:wasm
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: prepared-wasm
|
||||
path: |
|
||||
rust/kcl-wasm-lib/pkg/kcl_wasm_lib*
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: prepared-ts-rs-bindings
|
||||
path: |
|
||||
rust/kcl-lib/bindings/*
|
||||
|
||||
npm-tsc:
|
||||
runs-on: ubuntu-latest
|
||||
@ -127,3 +173,122 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
- name: Run codespell
|
||||
uses: crate-ci/typos@v1.32.0
|
||||
|
||||
npm-unit-test-kcl-samples:
|
||||
runs-on: ubuntu-latest
|
||||
needs: npm-build-wasm
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- run: npm install
|
||||
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||
with:
|
||||
tool: wasm-pack
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
- name: Copy prepared wasm
|
||||
run: |
|
||||
ls -R prepared-wasm
|
||||
cp prepared-wasm/kcl_wasm_lib_bg.wasm public
|
||||
mkdir rust/kcl-wasm-lib/pkg
|
||||
cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
|
||||
|
||||
- name: Copy prepared ts-rs bindings
|
||||
run: |
|
||||
ls -R prepared-ts-rs-bindings
|
||||
mkdir rust/kcl-lib/bindings
|
||||
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||
|
||||
- run: npm run simpleserver:bg
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
|
||||
- name: Install Chromium Browser
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
run: npm run playwright install chromium --with-deps
|
||||
|
||||
- name: Download internal KCL samples
|
||||
run: git clone --depth=1 https://x-access-token:${{ secrets.GH_PAT_KCL_SAMPLES_INTERNAL }}@github.com/KittyCAD/kcl-samples-internal public/kcl-samples/internal
|
||||
|
||||
- name: Regenerate KCL samples manifest
|
||||
run: cd rust/kcl-lib && EXPECTORATE=overwrite cargo test generate_manifest
|
||||
|
||||
- name: Check public and internal KCL samples
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
run: npm run test:unit:kcl-samples
|
||||
env:
|
||||
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
|
||||
npm-unit-test:
|
||||
runs-on: ubuntu-latest
|
||||
needs: npm-build-wasm
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- run: npm install
|
||||
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||
with:
|
||||
tool: wasm-pack
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
- name: Copy prepared wasm
|
||||
run: |
|
||||
ls -R prepared-wasm
|
||||
cp prepared-wasm/kcl_wasm_lib_bg.wasm public
|
||||
mkdir rust/kcl-wasm-lib/pkg
|
||||
cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
|
||||
|
||||
- name: Copy prepared ts-rs bindings
|
||||
run: |
|
||||
ls -R prepared-ts-rs-bindings
|
||||
mkdir rust/kcl-lib/bindings
|
||||
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||
|
||||
- run: npm run simpleserver:bg
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
|
||||
- name: Install Chromium Browser
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
run: npm run playwright install chromium --with-deps
|
||||
|
||||
- name: Run unit tests
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
run: xvfb-run -a npm run test:unit
|
||||
env:
|
||||
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
|
||||
- name: Check for changes
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
id: git-check
|
||||
run: |
|
||||
git add src/lang/std/artifactMapGraphs
|
||||
if git status src/lang/std/artifactMapGraphs | grep -q "Changes to be committed"
|
||||
then echo "modified=true" >> $GITHUB_OUTPUT
|
||||
else echo "modified=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Commit changes, if any
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' && steps.git-check.outputs.modified == 'true' }}
|
||||
run: |
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
|
||||
git fetch origin
|
||||
echo ${{ github.head_ref }}
|
||||
git checkout ${{ github.head_ref }}
|
||||
# TODO when webkit works on ubuntu remove the os part of the commit message
|
||||
git commit -am "Look at this (photo)Graph *in the voice of Nickelback*" || true
|
||||
git push
|
||||
git push origin ${{ github.head_ref }}
|
||||
|
124
.github/workflows/unit-tests.yml
vendored
@ -1,124 +0,0 @@
|
||||
name: Unit Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
actions: read
|
||||
|
||||
jobs:
|
||||
npm-build-wasm:
|
||||
uses: ./.github/workflows/build-wasm.yml
|
||||
|
||||
npm-test-unit:
|
||||
runs-on: ubuntu-latest
|
||||
needs: npm-build-wasm
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- run: npm install
|
||||
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||
with:
|
||||
tool: wasm-pack
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
- name: Copy prepared wasm
|
||||
run: |
|
||||
ls -R prepared-wasm
|
||||
cp prepared-wasm/kcl_wasm_lib_bg.wasm public
|
||||
mkdir rust/kcl-wasm-lib/pkg
|
||||
cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
|
||||
|
||||
- name: Copy prepared ts-rs bindings
|
||||
run: |
|
||||
ls -R prepared-ts-rs-bindings
|
||||
mkdir rust/kcl-lib/bindings
|
||||
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||
|
||||
- run: npm run simpleserver:bg
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
|
||||
- name: Install Chromium Browser
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
run: npm run playwright install chromium --with-deps
|
||||
|
||||
- name: Run unit tests
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
run: xvfb-run -a npm run test:unit
|
||||
env:
|
||||
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
|
||||
- name: Check for changes
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
id: git-check
|
||||
run: |
|
||||
git add src/lang/std/artifactMapGraphs
|
||||
if git status src/lang/std/artifactMapGraphs | grep -q "Changes to be committed"
|
||||
then echo "modified=true" >> $GITHUB_OUTPUT
|
||||
else echo "modified=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Commit changes, if any
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' && steps.git-check.outputs.modified == 'true' }}
|
||||
run: |
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
|
||||
git fetch origin
|
||||
echo ${{ github.head_ref }}
|
||||
git checkout ${{ github.head_ref }}
|
||||
# TODO when webkit works on ubuntu remove the os part of the commit message
|
||||
git commit -am "Look at this (photo)Graph *in the voice of Nickelback*" || true
|
||||
git push
|
||||
git push origin ${{ github.head_ref }}
|
||||
|
||||
npm-test-unit-components:
|
||||
runs-on: ubuntu-latest
|
||||
needs: npm-build-wasm
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- run: npm install
|
||||
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||
with:
|
||||
tool: wasm-pack
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
- name: Copy prepared wasm
|
||||
run: |
|
||||
ls -R prepared-wasm
|
||||
cp prepared-wasm/kcl_wasm_lib_bg.wasm public
|
||||
mkdir rust/kcl-wasm-lib/pkg
|
||||
cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
|
||||
|
||||
- name: Copy prepared ts-rs bindings
|
||||
run: |
|
||||
ls -R prepared-ts-rs-bindings
|
||||
mkdir rust/kcl-lib/bindings
|
||||
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||
|
||||
- name: Run component tests
|
||||
run: npm run test:unit:components
|
2
.gitignore
vendored
@ -58,8 +58,6 @@ trace.zip
|
||||
/public/kcl-samples/.github
|
||||
/public/kcl-samples/screenshots/main.kcl
|
||||
/public/kcl-samples/step/main.kcl
|
||||
/public/kcl-samples/internal
|
||||
/rust/kcl-lib/tests/kcl_samples/internal
|
||||
/test-results/
|
||||
/playwright-report/
|
||||
/blob-report/
|
||||
|
1
Makefile
@ -114,6 +114,7 @@ test-unit: install ## Run the unit tests
|
||||
npm run test:unit:components
|
||||
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
|
||||
npm run test:unit
|
||||
npm run test:unit:kcl-samples
|
||||
|
||||
.PHONY: test-e2e
|
||||
test-e2e: test-e2e-$(TARGET)
|
||||
|
@ -21,7 +21,7 @@ extend-exclude = [
|
||||
]
|
||||
|
||||
[default.extend-words]
|
||||
metalness = "metalness" # appearance API
|
||||
metalness = "metalness" # appearance API
|
||||
Hom = "Hom" # short for homogenous
|
||||
typ = "typ" # used to declare a variable named 'type' which is a reserved keyword in Rust
|
||||
ue = "ue" # short for UnaryExpression
|
||||
@ -29,7 +29,6 @@ THRE = "THRE" # Weird bug that wrongly detects THREEjs as a typo
|
||||
nwo = "nwo" # don't know what this is about tbh
|
||||
"ot" = "ot" # some abbreviation, idk what
|
||||
"oe" = "oe" # some abbreviation, idk what
|
||||
"colinear" = "colinear" # some engine shit, kidding
|
||||
|
||||
[default]
|
||||
extend-ignore-identifiers-re = [
|
||||
|
@ -256720,7 +256720,7 @@
|
||||
false
|
||||
],
|
||||
[
|
||||
"// Create a spring by sweeping around a helix path.\n\n// Create a helix around the Z axis.\nhelixPath = helix(\n angleStart = 0,\n ccw = true,\n revolutions = 4,\n length = 10,\n radius = 5,\n axis = Z,\n)\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn(XZ)\n |> circle(center = [5, 0], radius = 1)\n |> sweep(path = helixPath)",
|
||||
"// Create a spring by sweeping around a helix path.\n\n// Create a helix around the Z axis.\nhelixPath = helix(\n angleStart = 0,\n ccw = true,\n revolutions = 4,\n length = 10,\n radius = 5,\n axis = Z,\n)\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn(YZ)\n |> circle(center = [0, 0], radius = 1)\n |> sweep(path = helixPath, relativeTo = \"sketchPlane\")",
|
||||
false
|
||||
],
|
||||
[
|
||||
|
@ -267,75 +267,6 @@ test.describe('when using the file tree to', () => {
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
test(
|
||||
'loading small file, then large, then back to small',
|
||||
{
|
||||
tag: '@electron',
|
||||
},
|
||||
async ({ page }, testInfo) => {
|
||||
const {
|
||||
panesOpen,
|
||||
pasteCodeInEditor,
|
||||
createNewFile,
|
||||
openDebugPanel,
|
||||
closeDebugPanel,
|
||||
expectCmdLog,
|
||||
} = await getUtils(page, test)
|
||||
|
||||
await page.setViewportSize({ width: 1200, height: 500 })
|
||||
page.on('console', console.log)
|
||||
|
||||
await panesOpen(['files', 'code'])
|
||||
await createProject({ name: 'project-000', page })
|
||||
|
||||
// Create a small file
|
||||
const kclCube = await fsp.readFile(
|
||||
'rust/kcl-lib/e2e/executor/inputs/cube.kcl',
|
||||
'utf-8'
|
||||
)
|
||||
// pasted into main.kcl
|
||||
await pasteCodeInEditor(kclCube)
|
||||
|
||||
// Create a large lego file
|
||||
await createNewFile('lego')
|
||||
const legoFile = page.getByRole('listitem').filter({
|
||||
has: page.getByRole('button', { name: 'lego.kcl' }),
|
||||
})
|
||||
await expect(legoFile).toBeVisible({ timeout: 60_000 })
|
||||
await legoFile.click()
|
||||
const kclLego = await fsp.readFile(
|
||||
'rust/kcl-lib/e2e/executor/inputs/lego.kcl',
|
||||
'utf-8'
|
||||
)
|
||||
await pasteCodeInEditor(kclLego)
|
||||
const mainFile = page.getByRole('listitem').filter({
|
||||
has: page.getByRole('button', { name: 'main.kcl' }),
|
||||
})
|
||||
|
||||
// Open settings and enable the debug panel
|
||||
await page
|
||||
.getByRole('link', {
|
||||
name: 'settings Settings',
|
||||
})
|
||||
.click()
|
||||
await page.locator('#showDebugPanel').getByText('OffOn').click()
|
||||
await page.getByTestId('settings-close-button').click()
|
||||
|
||||
await test.step('swap between small and large files', async () => {
|
||||
await openDebugPanel()
|
||||
// Previously created a file so we need to start back at main.kcl
|
||||
await mainFile.click()
|
||||
await expectCmdLog('[data-message-type="execution-done"]', 60_000)
|
||||
// Click the large file
|
||||
await legoFile.click()
|
||||
// Once it is building, click back to the smaller file
|
||||
await mainFile.click()
|
||||
await expectCmdLog('[data-message-type="execution-done"]', 60_000)
|
||||
await closeDebugPanel()
|
||||
})
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
test.describe('Renaming in the file tree', () => {
|
||||
|
@ -197,6 +197,18 @@ test.describe(
|
||||
await clickElectronNativeMenuById(tronApp, 'File.Export current part')
|
||||
await cmdBar.expectCommandName('Export')
|
||||
})
|
||||
await test.step('Modeling.File.Share part via Zoo link', async () => {
|
||||
await page.waitForTimeout(250)
|
||||
await clickElectronNativeMenuById(
|
||||
tronApp,
|
||||
'File.Share part via Zoo link'
|
||||
)
|
||||
const textToCheck =
|
||||
'Link copied to clipboard. Anyone who clicks this link will get a copy of this file. Share carefully!'
|
||||
// Check if text appears anywhere in the page
|
||||
const isTextVisible = page.getByText(textToCheck)
|
||||
await expect(isTextVisible).toBeVisible({ timeout: 10000 })
|
||||
})
|
||||
await test.step('Modeling.File.Preferences.Project settings', async () => {
|
||||
await page.waitForTimeout(250)
|
||||
await clickElectronNativeMenuById(
|
||||
|
@ -6,6 +6,7 @@ test.describe('Onboarding tests', () => {
|
||||
homePage,
|
||||
toolbar,
|
||||
editor,
|
||||
scene,
|
||||
tronApp,
|
||||
}) => {
|
||||
if (!tronApp) {
|
||||
@ -61,6 +62,7 @@ test.describe('Onboarding tests', () => {
|
||||
await editor.expectEditor.toContain('@settings(defaultLengthUnit = in)', {
|
||||
shouldNormalise: true,
|
||||
})
|
||||
await scene.connectionEstablished()
|
||||
})
|
||||
|
||||
await test.step('Go home and verify we still see the tutorial button, then begin it.', async () => {
|
||||
@ -130,7 +132,9 @@ test.describe('Onboarding tests', () => {
|
||||
})
|
||||
|
||||
await test.step('Dismiss the onboarding', async () => {
|
||||
await postDismissToast.waitFor({ state: 'hidden' })
|
||||
await page.keyboard.press('Escape')
|
||||
await expect(postDismissToast).toBeVisible()
|
||||
await expect(page.getByTestId('onboarding-content')).not.toBeVisible()
|
||||
await expect.poll(() => page.url()).not.toContain('/onboarding')
|
||||
})
|
||||
@ -158,10 +162,13 @@ test.describe('Onboarding tests', () => {
|
||||
await test.step('Gets to the onboarding start', async () => {
|
||||
await expect(toolbar.projectName).toContainText('tutorial-project')
|
||||
await expect(tutorialWelcomeHeading).toBeVisible()
|
||||
await scene.connectionEstablished()
|
||||
})
|
||||
|
||||
await test.step('Dismiss the onboarding', async () => {
|
||||
await postDismissToast.waitFor({ state: 'hidden' })
|
||||
await page.keyboard.press('Escape')
|
||||
await expect(postDismissToast).toBeVisible()
|
||||
await expect(page.getByTestId('onboarding-content')).not.toBeVisible()
|
||||
await expect.poll(() => page.url()).not.toContain('/onboarding')
|
||||
})
|
||||
|
@ -99,8 +99,6 @@ test.describe('edit with AI example snapshots', () => {
|
||||
await test.step('fire off edit prompt', async () => {
|
||||
await cmdBar.captureTextToCadRequestSnapshot(test.info())
|
||||
await cmdBar.openCmdBar('promptToEdit')
|
||||
await page.waitForTimeout(100)
|
||||
await cmdBar.progressCmdBar()
|
||||
// being specific about the color with a hex means asserting pixel color is more stable
|
||||
await page
|
||||
.getByTestId('cmd-bar-arg-value')
|
||||
|
@ -88,8 +88,6 @@ test.describe('Prompt-to-edit tests', () => {
|
||||
|
||||
await test.step('fire off edit prompt', async () => {
|
||||
await cmdBar.openCmdBar('promptToEdit')
|
||||
await page.waitForTimeout(100)
|
||||
await cmdBar.progressCmdBar()
|
||||
// being specific about the color with a hex means asserting pixel color is more stable
|
||||
await page
|
||||
.getByTestId('cmd-bar-arg-value')
|
||||
@ -167,8 +165,6 @@ test.describe('Prompt-to-edit tests', () => {
|
||||
|
||||
await test.step('fire of bad prompt', async () => {
|
||||
await cmdBar.openCmdBar('promptToEdit')
|
||||
await page.waitForTimeout(100)
|
||||
await cmdBar.progressCmdBar()
|
||||
await page
|
||||
.getByTestId('cmd-bar-arg-value')
|
||||
.fill('ansheusha asnthuatshoeuhtaoetuhthaeu laughs in dvorak')
|
||||
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 132 KiB |
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 116 KiB |
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 132 KiB |
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
@ -551,6 +551,11 @@ export async function getUtils(page: Page, test_?: typeof test) {
|
||||
|
||||
createNewFile: async (name: string) => {
|
||||
return test?.step(`Create a file named ${name}`, async () => {
|
||||
// If the application is in the middle of connecting a stream
|
||||
// then creating a new file won't work in the end.
|
||||
await expect(
|
||||
page.getByRole('button', { name: 'Start Sketch' })
|
||||
).not.toBeDisabled()
|
||||
await page.getByTestId('create-file-button').click()
|
||||
await page.getByTestId('tree-input-field').fill(name)
|
||||
await page.keyboard.press('Enter')
|
||||
|
@ -94,6 +94,7 @@
|
||||
"build:wasm:dev": "./scripts/build-wasm-dev.sh",
|
||||
"build:wasm:dev:windows": "powershell -ExecutionPolicy Bypass -File ./scripts/build-wasm-dev.ps1",
|
||||
"pretest": "npm run remove-importmeta",
|
||||
"test:rust": "(cd rust && just test && just lint)",
|
||||
"simpleserver": "npm run pretest && http-server ./public --cors -p 3000",
|
||||
"simpleserver:ci": "npm run pretest && http-server ./public --cors -p 3000 &",
|
||||
"simpleserver:bg": "npm run pretest && http-server ./public --cors -p 3000 &",
|
||||
@ -129,14 +130,15 @@
|
||||
"tronb:package:prod": "npm run tronb:vite:prod && electron-builder --config electron-builder.yml --publish always",
|
||||
"test-setup": "npm install && npm run build:wasm",
|
||||
"test": "vitest --mode development",
|
||||
"test:rust": "(cd rust && just test && just lint)",
|
||||
"test:snapshots": "PLATFORM=web NODE_ENV=development playwright test --config=playwright.config.ts --grep=@snapshot --trace=on --shard=1/1",
|
||||
"test:unit": "vitest run --mode development --exclude **/jest-component-unit-tests/*",
|
||||
"test:unit": "vitest run --mode development --exclude **/kclSamples.test.ts --exclude **/jest-component-unit-tests/*",
|
||||
"test:unit:components": "jest -c jest-component-unit-tests/jest.config.ts --rootDir jest-component-unit-tests/",
|
||||
"test:unit:kcl-samples": "vitest run --mode development ./src/lang/kclSamples.test.ts",
|
||||
"test:playwright:electron": "playwright test --config=playwright.electron.config.ts --grep-invert=@snapshot",
|
||||
"test:playwright:electron:local": "npm run tronb:vite:dev && playwright test --config=playwright.electron.config.ts --grep-invert=@snapshot --grep-invert=\"$(curl --silent https://test-analysis-bot.hawk-dinosaur.ts.net/projects/KittyCAD/modeling-app/tests/disabled/regex)\"",
|
||||
"test:playwright:electron:local-engine": "npm run tronb:vite:dev && playwright test --config=playwright.electron.config.ts --grep-invert='@snapshot|@skipLocalEngine' --grep-invert=\"$(curl --silent https://test-analysis-bot.hawk-dinosaur.ts.net/projects/KittyCAD/modeling-app/tests/disabled/regex)\"",
|
||||
"test:unit:local": "npm run simpleserver:bg && npm run test:unit; kill-port 3000"
|
||||
"test:unit:local": "npm run simpleserver:bg && npm run test:unit; kill-port 3000",
|
||||
"test:unit:kcl-samples:local": "npm run simpleserver:bg && npm run test:unit:kcl-samples; kill-port 3000"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
|
123
rust/Cargo.lock
generated
@ -1815,7 +1815,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-bumper"
|
||||
version = "0.1.74"
|
||||
version = "0.1.73"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@ -1826,7 +1826,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-derive-docs"
|
||||
version = "0.1.74"
|
||||
version = "0.1.73"
|
||||
dependencies = [
|
||||
"Inflector",
|
||||
"anyhow",
|
||||
@ -1845,9 +1845,8 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-directory-test-macro"
|
||||
version = "0.1.74"
|
||||
version = "0.1.73"
|
||||
dependencies = [
|
||||
"convert_case",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.100",
|
||||
@ -1855,7 +1854,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-language-server"
|
||||
version = "0.2.74"
|
||||
version = "0.2.73"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@ -1876,7 +1875,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-language-server-release"
|
||||
version = "0.1.74"
|
||||
version = "0.1.73"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@ -1896,7 +1895,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-lib"
|
||||
version = "0.2.74"
|
||||
version = "0.2.73"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"approx 0.5.1",
|
||||
@ -1935,7 +1934,6 @@ dependencies = [
|
||||
"measurements",
|
||||
"miette",
|
||||
"mime_guess",
|
||||
"nalgebra-glm",
|
||||
"parse-display 0.10.0",
|
||||
"pretty_assertions",
|
||||
"pyo3",
|
||||
@ -1973,7 +1971,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-python-bindings"
|
||||
version = "0.3.74"
|
||||
version = "0.3.73"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"kcl-lib",
|
||||
@ -1988,7 +1986,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-test-server"
|
||||
version = "0.1.74"
|
||||
version = "0.1.73"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"hyper 0.14.32",
|
||||
@ -2001,7 +1999,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-to-core"
|
||||
version = "0.1.74"
|
||||
version = "0.1.73"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@ -2015,7 +2013,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-wasm-lib"
|
||||
version = "0.1.74"
|
||||
version = "0.1.73"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bson",
|
||||
@ -2255,16 +2253,6 @@ dependencies = [
|
||||
"pkg-config",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "matrixmultiply"
|
||||
version = "0.3.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"rawpointer",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "measurements"
|
||||
version = "0.11.0"
|
||||
@ -2385,33 +2373,6 @@ dependencies = [
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nalgebra"
|
||||
version = "0.33.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "26aecdf64b707efd1310e3544d709c5c0ac61c13756046aaaba41be5c4f66a3b"
|
||||
dependencies = [
|
||||
"approx 0.5.1",
|
||||
"matrixmultiply",
|
||||
"num-complex",
|
||||
"num-rational",
|
||||
"num-traits 0.2.19",
|
||||
"simba",
|
||||
"typenum",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nalgebra-glm"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e441f43bccdf40cb6bd4294321e6983c5bc7b9886112d19fd4c9813976b117e4"
|
||||
dependencies = [
|
||||
"approx 0.5.1",
|
||||
"nalgebra",
|
||||
"num-traits 0.2.19",
|
||||
"simba",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "newline-converter"
|
||||
version = "0.3.0"
|
||||
@ -2451,15 +2412,6 @@ dependencies = [
|
||||
"num-traits 0.2.19",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-complex"
|
||||
version = "0.4.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
|
||||
dependencies = [
|
||||
"num-traits 0.2.19",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-conv"
|
||||
version = "0.1.0"
|
||||
@ -2490,17 +2442,6 @@ dependencies = [
|
||||
"num-modular",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-rational"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824"
|
||||
dependencies = [
|
||||
"num-bigint",
|
||||
"num-integer",
|
||||
"num-traits 0.2.19",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
version = "0.1.43"
|
||||
@ -2654,12 +2595,6 @@ dependencies = [
|
||||
"syn 2.0.100",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "paste"
|
||||
version = "1.0.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
|
||||
|
||||
[[package]]
|
||||
name = "pbkdf2"
|
||||
version = "0.12.2"
|
||||
@ -3158,12 +3093,6 @@ dependencies = [
|
||||
"getrandom 0.3.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rawpointer"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
|
||||
|
||||
[[package]]
|
||||
name = "rayon"
|
||||
version = "1.10.0"
|
||||
@ -3447,15 +3376,6 @@ version = "1.0.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
|
||||
|
||||
[[package]]
|
||||
name = "safe_arch"
|
||||
version = "0.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "same-file"
|
||||
version = "1.0.6"
|
||||
@ -3711,19 +3631,6 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "simba"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b3a386a501cd104797982c15ae17aafe8b9261315b5d07e3ec803f2ea26be0fa"
|
||||
dependencies = [
|
||||
"approx 0.5.1",
|
||||
"num-complex",
|
||||
"num-traits 0.2.19",
|
||||
"paste",
|
||||
"wide",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "simd-adler32"
|
||||
version = "0.3.7"
|
||||
@ -4824,16 +4731,6 @@ dependencies = [
|
||||
"rustls-pki-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wide"
|
||||
version = "0.7.32"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "41b5576b9a81633f3e8df296ce0063042a73507636cbe956c61133dd7034ab22"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"safe_arch",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.3.9"
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
[package]
|
||||
name = "kcl-bumper"
|
||||
version = "0.1.74"
|
||||
version = "0.1.73"
|
||||
edition = "2021"
|
||||
repository = "https://github.com/KittyCAD/modeling-api"
|
||||
rust-version = "1.76"
|
||||
|
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "kcl-derive-docs"
|
||||
description = "A tool for generating documentation from Rust derive macros"
|
||||
version = "0.1.74"
|
||||
version = "0.1.73"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/KittyCAD/modeling-app"
|
||||
|
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "kcl-directory-test-macro"
|
||||
description = "A tool for generating tests from a directory of kcl files"
|
||||
version = "0.1.74"
|
||||
version = "0.1.73"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/KittyCAD/modeling-app"
|
||||
@ -11,7 +11,6 @@ proc-macro = true
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
convert_case = "0.8.0"
|
||||
proc-macro2 = "1"
|
||||
quote = "1"
|
||||
syn = { version = "2.0.96", features = ["full"] }
|
||||
|
@ -1,13 +1,10 @@
|
||||
use std::fs;
|
||||
|
||||
use convert_case::Casing;
|
||||
use proc_macro::TokenStream;
|
||||
use quote::{format_ident, quote};
|
||||
use syn::{parse_macro_input, LitStr};
|
||||
|
||||
/// A macro that generates test functions for each directory within a given path.
|
||||
/// To be included the test directory must have a main.kcl file.
|
||||
/// This will also recursively search for directories within the given path.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
@ -48,11 +45,7 @@ pub fn test_all_dirs(attr: TokenStream, item: TokenStream) -> TokenStream {
|
||||
|
||||
// Generate a test function for each directory
|
||||
let test_fns = dirs.iter().map(|(dir_name, dir_path)| {
|
||||
let relative_path = dir_path
|
||||
.strip_prefix(&path.to_string_lossy().to_string())
|
||||
.unwrap()
|
||||
.trim();
|
||||
let test_fn_name = format_ident!("{}_{}", fn_name, sanitize_dir_name(relative_path));
|
||||
let test_fn_name = format_ident!("{}_{}", fn_name, sanitize_dir_name(dir_name));
|
||||
let dir_name_str = dir_name.clone();
|
||||
let dir_path_str = dir_path.clone();
|
||||
|
||||
@ -82,26 +75,16 @@ fn get_all_directories(path: &std::path::Path) -> Result<Vec<(String, String)>,
|
||||
|
||||
for entry in fs::read_dir(path)? {
|
||||
let entry = entry?;
|
||||
let new_path = entry.path();
|
||||
let path = entry.path();
|
||||
|
||||
if new_path.is_dir()
|
||||
&& !IGNORE_DIRS.contains(&new_path.file_name().and_then(|name| name.to_str()).unwrap_or(""))
|
||||
{
|
||||
// Check if the directory contains a main.kcl file.
|
||||
let main_kcl_path = new_path.join("main.kcl");
|
||||
if !main_kcl_path.exists() {
|
||||
// Recurse into the directory.
|
||||
let sub_dirs = get_all_directories(&new_path)?;
|
||||
dirs.extend(sub_dirs);
|
||||
continue;
|
||||
}
|
||||
let dir_name = new_path
|
||||
if path.is_dir() && !IGNORE_DIRS.contains(&path.file_name().and_then(|name| name.to_str()).unwrap_or("")) {
|
||||
let dir_name = path
|
||||
.file_name()
|
||||
.and_then(|name| name.to_str())
|
||||
.unwrap_or("unknown")
|
||||
.to_string();
|
||||
|
||||
let dir_path = new_path.to_str().unwrap_or("unknown").to_string();
|
||||
let dir_path = path.to_str().unwrap_or("unknown").to_string();
|
||||
|
||||
dirs.push((dir_name, dir_path));
|
||||
}
|
||||
@ -112,9 +95,10 @@ fn get_all_directories(path: &std::path::Path) -> Result<Vec<(String, String)>,
|
||||
|
||||
/// Sanitize directory name to create a valid Rust identifier
|
||||
fn sanitize_dir_name(name: &str) -> String {
|
||||
let binding = name
|
||||
.replace(|c: char| !c.is_ascii_alphanumeric() && c != '_', "_")
|
||||
.replace("/", "_");
|
||||
let name = binding.trim_start_matches('_').to_string();
|
||||
name.to_case(convert_case::Case::Snake)
|
||||
let name = name.replace(|c: char| !c.is_ascii_alphanumeric() && c != '_', "_");
|
||||
if name.chars().next().is_some_and(|c| c.is_numeric()) {
|
||||
format!("d_{}", name)
|
||||
} else {
|
||||
name
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "kcl-language-server-release"
|
||||
version = "0.1.74"
|
||||
version = "0.1.73"
|
||||
edition = "2021"
|
||||
authors = ["KittyCAD Inc <kcl@kittycad.io>"]
|
||||
publish = false
|
||||
|
@ -2,7 +2,7 @@
|
||||
name = "kcl-language-server"
|
||||
description = "A language server for KCL."
|
||||
authors = ["KittyCAD Inc <kcl@kittycad.io>"]
|
||||
version = "0.2.74"
|
||||
version = "0.2.73"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "kcl-lib"
|
||||
description = "KittyCAD Language implementation and tools"
|
||||
version = "0.2.74"
|
||||
version = "0.2.73"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/KittyCAD/modeling-app"
|
||||
@ -50,7 +50,6 @@ lazy_static = { workspace = true }
|
||||
measurements = "0.11.0"
|
||||
miette = { workspace = true }
|
||||
mime_guess = "2.0.5"
|
||||
nalgebra-glm = "0.19.0"
|
||||
parse-display = "0.10.0"
|
||||
pyo3 = { workspace = true, optional = true }
|
||||
regex = "1.11.1"
|
||||
|
@ -1,7 +1,5 @@
|
||||
//! Cache testing framework.
|
||||
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
use kcl_lib::NodePathStep;
|
||||
use kcl_lib::{bust_cache, ExecError, ExecOutcome};
|
||||
use kcmc::{each_cmd as mcmd, ModelingCmd};
|
||||
use kittycad_modeling_cmds as kcmc;
|
||||
@ -332,40 +330,6 @@ extrude001 = extrude(profile001, length = 4)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_cache_add_offset_plane_computes_node_path() {
|
||||
let code = r#"sketch001 = startSketchOn(XY)
|
||||
profile001 = startProfile(sketch001, at = [0, 0])
|
||||
"#;
|
||||
let code_with_more = code.to_owned()
|
||||
+ r#"plane001 = offsetPlane(XY, offset = 500)
|
||||
"#;
|
||||
|
||||
let result = cache_test(
|
||||
"add_offset_plane_preserves_artifact_commands",
|
||||
vec![
|
||||
Variation {
|
||||
code,
|
||||
other_files: vec![],
|
||||
settings: &Default::default(),
|
||||
},
|
||||
Variation {
|
||||
code: code_with_more.as_str(),
|
||||
other_files: vec![],
|
||||
settings: &Default::default(),
|
||||
},
|
||||
],
|
||||
)
|
||||
.await;
|
||||
|
||||
let second = &result.last().unwrap().2;
|
||||
|
||||
let v = second.artifact_graph.values().collect::<Vec<_>>();
|
||||
let path_step = &v[2].code_ref().unwrap().node_path.steps[0];
|
||||
assert_eq!(*path_step, NodePathStep::ProgramBodyItem { index: 2 });
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_cache_empty_file_pop_cache_empty_file_planes_work() {
|
||||
// Get the current working directory.
|
||||
|
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 26 KiB |
@ -129,7 +129,6 @@ impl From<KclErrorWithOutputs> for KclError {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct KclErrorWithOutputs {
|
||||
pub error: KclError,
|
||||
pub non_fatal: Vec<CompilationError>,
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
pub operations: Vec<Operation>,
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
@ -142,10 +141,8 @@ pub struct KclErrorWithOutputs {
|
||||
}
|
||||
|
||||
impl KclErrorWithOutputs {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn new(
|
||||
error: KclError,
|
||||
non_fatal: Vec<CompilationError>,
|
||||
#[cfg(feature = "artifact-graph")] operations: Vec<Operation>,
|
||||
#[cfg(feature = "artifact-graph")] artifact_commands: Vec<ArtifactCommand>,
|
||||
#[cfg(feature = "artifact-graph")] artifact_graph: ArtifactGraph,
|
||||
@ -155,7 +152,6 @@ impl KclErrorWithOutputs {
|
||||
) -> Self {
|
||||
Self {
|
||||
error,
|
||||
non_fatal,
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
operations,
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
@ -170,7 +166,6 @@ impl KclErrorWithOutputs {
|
||||
pub fn no_outputs(error: KclError) -> Self {
|
||||
Self {
|
||||
error,
|
||||
non_fatal: Default::default(),
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
operations: Default::default(),
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
|
@ -750,7 +750,6 @@ pub(super) fn build_artifact_graph(
|
||||
artifact_commands: &[ArtifactCommand],
|
||||
responses: &IndexMap<Uuid, WebSocketResponse>,
|
||||
ast: &Node<Program>,
|
||||
cached_body_items: usize,
|
||||
exec_artifacts: &mut IndexMap<ArtifactId, Artifact>,
|
||||
initial_graph: ArtifactGraph,
|
||||
) -> Result<ArtifactGraph, KclError> {
|
||||
@ -764,7 +763,7 @@ pub(super) fn build_artifact_graph(
|
||||
for exec_artifact in exec_artifacts.values_mut() {
|
||||
// Note: We only have access to the new AST. So if these artifacts
|
||||
// somehow came from cached AST, this won't fill in anything.
|
||||
fill_in_node_paths(exec_artifact, ast, cached_body_items);
|
||||
fill_in_node_paths(exec_artifact, ast);
|
||||
}
|
||||
|
||||
for artifact_command in artifact_commands {
|
||||
@ -791,7 +790,6 @@ pub(super) fn build_artifact_graph(
|
||||
&flattened_responses,
|
||||
&path_to_plane_id_map,
|
||||
ast,
|
||||
cached_body_items,
|
||||
exec_artifacts,
|
||||
)?;
|
||||
for artifact in artifact_updates {
|
||||
@ -809,18 +807,16 @@ pub(super) fn build_artifact_graph(
|
||||
|
||||
/// These may have been created with placeholder `CodeRef`s because we didn't
|
||||
/// have the entire AST available. Now we fill them in.
|
||||
fn fill_in_node_paths(artifact: &mut Artifact, program: &Node<Program>, cached_body_items: usize) {
|
||||
fn fill_in_node_paths(artifact: &mut Artifact, program: &Node<Program>) {
|
||||
match artifact {
|
||||
Artifact::StartSketchOnFace(face) => {
|
||||
if face.code_ref.node_path.is_empty() {
|
||||
face.code_ref.node_path =
|
||||
NodePath::from_range(program, cached_body_items, face.code_ref.range).unwrap_or_default();
|
||||
face.code_ref.node_path = NodePath::from_range(program, face.code_ref.range).unwrap_or_default();
|
||||
}
|
||||
}
|
||||
Artifact::StartSketchOnPlane(plane) => {
|
||||
if plane.code_ref.node_path.is_empty() {
|
||||
plane.code_ref.node_path =
|
||||
NodePath::from_range(program, cached_body_items, plane.code_ref.range).unwrap_or_default();
|
||||
plane.code_ref.node_path = NodePath::from_range(program, plane.code_ref.range).unwrap_or_default();
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
@ -909,7 +905,6 @@ fn artifacts_to_update(
|
||||
responses: &FnvHashMap<Uuid, OkModelingCmdResponse>,
|
||||
path_to_plane_id_map: &FnvHashMap<Uuid, Uuid>,
|
||||
ast: &Node<Program>,
|
||||
cached_body_items: usize,
|
||||
exec_artifacts: &IndexMap<ArtifactId, Artifact>,
|
||||
) -> Result<Vec<Artifact>, KclError> {
|
||||
let uuid = artifact_command.cmd_id;
|
||||
@ -923,7 +918,7 @@ fn artifacts_to_update(
|
||||
// correct value based on NodePath.
|
||||
let path_to_node = Vec::new();
|
||||
let range = artifact_command.range;
|
||||
let node_path = NodePath::from_range(ast, cached_body_items, range).unwrap_or_default();
|
||||
let node_path = NodePath::from_range(ast, range).unwrap_or_default();
|
||||
let code_ref = CodeRef {
|
||||
range,
|
||||
node_path,
|
||||
|
@ -79,9 +79,6 @@ pub(super) enum CacheResult {
|
||||
reapply_settings: bool,
|
||||
/// The program that needs to be executed.
|
||||
program: Node<Program>,
|
||||
/// The number of body items that were cached and omitted from the
|
||||
/// program that needs to be executed. Used to compute [`crate::NodePath`].
|
||||
cached_body_items: usize,
|
||||
},
|
||||
/// Check only the imports, and not the main program.
|
||||
/// Before sending this we already checked the main program and it is the same.
|
||||
@ -194,7 +191,6 @@ pub(super) async fn get_changed_program(old: CacheInformation<'_>, new: CacheInf
|
||||
clear_scene: true,
|
||||
reapply_settings: true,
|
||||
program: new.ast.clone(),
|
||||
cached_body_items: 0,
|
||||
};
|
||||
}
|
||||
|
||||
@ -223,7 +219,6 @@ fn generate_changed_program(old_ast: Node<Program>, mut new_ast: Node<Program>,
|
||||
clear_scene: true,
|
||||
reapply_settings,
|
||||
program: new_ast,
|
||||
cached_body_items: 0,
|
||||
};
|
||||
}
|
||||
|
||||
@ -244,7 +239,6 @@ fn generate_changed_program(old_ast: Node<Program>, mut new_ast: Node<Program>,
|
||||
clear_scene: true,
|
||||
reapply_settings,
|
||||
program: new_ast,
|
||||
cached_body_items: 0,
|
||||
}
|
||||
}
|
||||
std::cmp::Ordering::Greater => {
|
||||
@ -261,7 +255,6 @@ fn generate_changed_program(old_ast: Node<Program>, mut new_ast: Node<Program>,
|
||||
clear_scene: false,
|
||||
reapply_settings,
|
||||
program: new_ast,
|
||||
cached_body_items: old_ast.body.len(),
|
||||
}
|
||||
}
|
||||
std::cmp::Ordering::Equal => {
|
||||
@ -599,8 +592,7 @@ startSketchOn(XY)
|
||||
CacheResult::ReExecute {
|
||||
clear_scene: true,
|
||||
reapply_settings: true,
|
||||
program: new_program.ast,
|
||||
cached_body_items: 0,
|
||||
program: new_program.ast
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -638,8 +630,7 @@ startSketchOn(XY)
|
||||
CacheResult::ReExecute {
|
||||
clear_scene: true,
|
||||
reapply_settings: true,
|
||||
program: new_program.ast,
|
||||
cached_body_items: 0,
|
||||
program: new_program.ast
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -1467,6 +1467,7 @@ impl Node<CallExpressionKw> {
|
||||
.await
|
||||
.map_err(|e| {
|
||||
// Add the call expression to the source ranges.
|
||||
// TODO currently ignored by the frontend
|
||||
e.add_source_ranges(vec![callsite])
|
||||
})?;
|
||||
|
||||
|
@ -571,7 +571,7 @@ impl ExecutorContext {
|
||||
// part of the scene).
|
||||
exec_state.mut_stack().push_new_env_for_scope();
|
||||
|
||||
let result = self.inner_run(&program, 0, &mut exec_state, true).await?;
|
||||
let result = self.inner_run(&program, &mut exec_state, true).await?;
|
||||
|
||||
// Restore any temporary variables, then save any newly created variables back to
|
||||
// memory in case another run wants to use them. Note this is just saved to the preserved
|
||||
@ -590,13 +590,12 @@ impl ExecutorContext {
|
||||
pub async fn run_with_caching(&self, program: crate::Program) -> Result<ExecOutcome, KclErrorWithOutputs> {
|
||||
assert!(!self.is_mock());
|
||||
|
||||
let (program, mut exec_state, preserve_mem, cached_body_items, imports_info) = if let Some(OldAstState {
|
||||
let (program, mut exec_state, preserve_mem, imports_info) = if let Some(OldAstState {
|
||||
ast: old_ast,
|
||||
exec_state: mut old_state,
|
||||
settings: old_settings,
|
||||
result_env,
|
||||
}) =
|
||||
cache::read_old_ast().await
|
||||
}) = cache::read_old_ast().await
|
||||
{
|
||||
let old = CacheInformation {
|
||||
ast: &old_ast,
|
||||
@ -608,13 +607,11 @@ impl ExecutorContext {
|
||||
};
|
||||
|
||||
// Get the program that actually changed from the old and new information.
|
||||
let (clear_scene, program, body_items, import_check_info) = match cache::get_changed_program(old, new).await
|
||||
{
|
||||
let (clear_scene, program, import_check_info) = match cache::get_changed_program(old, new).await {
|
||||
CacheResult::ReExecute {
|
||||
clear_scene,
|
||||
reapply_settings,
|
||||
program: changed_program,
|
||||
cached_body_items,
|
||||
} => {
|
||||
if reapply_settings
|
||||
&& self
|
||||
@ -623,7 +620,7 @@ impl ExecutorContext {
|
||||
.await
|
||||
.is_err()
|
||||
{
|
||||
(true, program, cached_body_items, None)
|
||||
(true, program, None)
|
||||
} else {
|
||||
(
|
||||
clear_scene,
|
||||
@ -631,7 +628,6 @@ impl ExecutorContext {
|
||||
ast: changed_program,
|
||||
original_file_contents: program.original_file_contents,
|
||||
},
|
||||
cached_body_items,
|
||||
None,
|
||||
)
|
||||
}
|
||||
@ -647,7 +643,7 @@ impl ExecutorContext {
|
||||
.await
|
||||
.is_err()
|
||||
{
|
||||
(true, program, old_ast.body.len(), None)
|
||||
(true, program, None)
|
||||
} else {
|
||||
// We need to check our imports to see if they changed.
|
||||
let mut new_exec_state = ExecState::new(self);
|
||||
@ -680,7 +676,6 @@ impl ExecutorContext {
|
||||
ast: changed_program,
|
||||
original_file_contents: program.original_file_contents,
|
||||
},
|
||||
old_ast.body.len(),
|
||||
// We only care about this if we are clearing the scene.
|
||||
if clear_scene {
|
||||
Some((new_universe, new_universe_map, new_exec_state))
|
||||
@ -709,7 +704,7 @@ impl ExecutorContext {
|
||||
let outcome = old_state.to_exec_outcome(result_env).await;
|
||||
return Ok(outcome);
|
||||
}
|
||||
(true, program, old_ast.body.len(), None)
|
||||
(true, program, None)
|
||||
}
|
||||
CacheResult::NoAction(false) => {
|
||||
let outcome = old_state.to_exec_outcome(result_env).await;
|
||||
@ -741,17 +736,17 @@ impl ExecutorContext {
|
||||
(old_state, true, None)
|
||||
};
|
||||
|
||||
(program, exec_state, preserve_mem, body_items, universe_info)
|
||||
(program, exec_state, preserve_mem, universe_info)
|
||||
} else {
|
||||
let mut exec_state = ExecState::new(self);
|
||||
self.send_clear_scene(&mut exec_state, Default::default())
|
||||
.await
|
||||
.map_err(KclErrorWithOutputs::no_outputs)?;
|
||||
(program, exec_state, false, 0, None)
|
||||
(program, exec_state, false, None)
|
||||
};
|
||||
|
||||
let result = self
|
||||
.run_concurrent(&program, cached_body_items, &mut exec_state, imports_info, preserve_mem)
|
||||
.run_concurrent(&program, &mut exec_state, imports_info, preserve_mem)
|
||||
.await;
|
||||
|
||||
if result.is_err() {
|
||||
@ -785,7 +780,7 @@ impl ExecutorContext {
|
||||
program: &crate::Program,
|
||||
exec_state: &mut ExecState,
|
||||
) -> Result<(EnvironmentRef, Option<ModelingSessionData>), KclErrorWithOutputs> {
|
||||
self.run_concurrent(program, 0, exec_state, None, false).await
|
||||
self.run_concurrent(program, exec_state, None, false).await
|
||||
}
|
||||
|
||||
/// Perform the execution of a program using a concurrent
|
||||
@ -798,7 +793,6 @@ impl ExecutorContext {
|
||||
pub async fn run_concurrent(
|
||||
&self,
|
||||
program: &crate::Program,
|
||||
cached_body_items: usize,
|
||||
exec_state: &mut ExecState,
|
||||
universe_info: Option<(Universe, UniverseMap)>,
|
||||
preserve_mem: bool,
|
||||
@ -829,7 +823,6 @@ impl ExecutorContext {
|
||||
|
||||
KclErrorWithOutputs::new(
|
||||
err,
|
||||
exec_state.errors().to_vec(),
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
exec_state.global.operations.clone(),
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
@ -1006,7 +999,6 @@ impl ExecutorContext {
|
||||
|
||||
return Err(KclErrorWithOutputs::new(
|
||||
e,
|
||||
exec_state.errors().to_vec(),
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
exec_state.global.operations.clone(),
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
@ -1022,8 +1014,7 @@ impl ExecutorContext {
|
||||
}
|
||||
}
|
||||
|
||||
self.inner_run(program, cached_body_items, exec_state, preserve_mem)
|
||||
.await
|
||||
self.inner_run(program, exec_state, preserve_mem).await
|
||||
}
|
||||
|
||||
/// Get the universe & universe map of the program.
|
||||
@ -1057,7 +1048,6 @@ impl ExecutorContext {
|
||||
|
||||
KclErrorWithOutputs::new(
|
||||
err,
|
||||
exec_state.errors().to_vec(),
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
exec_state.global.operations.clone(),
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
@ -1078,7 +1068,6 @@ impl ExecutorContext {
|
||||
async fn inner_run(
|
||||
&self,
|
||||
program: &crate::Program,
|
||||
cached_body_items: usize,
|
||||
exec_state: &mut ExecState,
|
||||
preserve_mem: bool,
|
||||
) -> Result<(EnvironmentRef, Option<ModelingSessionData>), KclErrorWithOutputs> {
|
||||
@ -1092,7 +1081,7 @@ impl ExecutorContext {
|
||||
|
||||
let default_planes = self.engine.get_default_planes().read().await.clone();
|
||||
let result = self
|
||||
.execute_and_build_graph(&program.ast, cached_body_items, exec_state, preserve_mem)
|
||||
.execute_and_build_graph(&program.ast, exec_state, preserve_mem)
|
||||
.await;
|
||||
|
||||
crate::log::log(format!(
|
||||
@ -1111,7 +1100,6 @@ impl ExecutorContext {
|
||||
|
||||
KclErrorWithOutputs::new(
|
||||
e,
|
||||
exec_state.errors().to_vec(),
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
exec_state.global.operations.clone(),
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
@ -1139,7 +1127,6 @@ impl ExecutorContext {
|
||||
async fn execute_and_build_graph(
|
||||
&self,
|
||||
program: NodeRef<'_, crate::parsing::ast::types::Program>,
|
||||
#[cfg_attr(not(feature = "artifact-graph"), expect(unused))] cached_body_items: usize,
|
||||
exec_state: &mut ExecState,
|
||||
preserve_mem: bool,
|
||||
) -> Result<EnvironmentRef, KclError> {
|
||||
@ -1177,7 +1164,6 @@ impl ExecutorContext {
|
||||
&new_commands,
|
||||
&new_responses,
|
||||
program,
|
||||
cached_body_items,
|
||||
&mut exec_state.global.artifacts,
|
||||
initial_graph,
|
||||
);
|
||||
|
@ -1277,15 +1277,7 @@ impl KclValue {
|
||||
.satisfied(values.len(), allow_shrink)
|
||||
.ok_or(CoercionError::from(self))?;
|
||||
|
||||
if len > values.len() {
|
||||
let message = format!(
|
||||
"Internal: Expected coerced array length {len} to be less than or equal to original length {}",
|
||||
values.len()
|
||||
);
|
||||
exec_state.err(CompilationError::err(self.into(), message.clone()));
|
||||
#[cfg(debug_assertions)]
|
||||
panic!("{message}");
|
||||
}
|
||||
assert!(len <= values.len());
|
||||
values.truncate(len);
|
||||
|
||||
Ok(KclValue::HomArray {
|
||||
|
@ -99,7 +99,7 @@ pub use lsp::{
|
||||
kcl::{Backend as KclLspBackend, Server as KclLspServerSubCommand},
|
||||
};
|
||||
pub use modules::ModuleId;
|
||||
pub use parsing::ast::types::{FormatOptions, NodePath, Step as NodePathStep};
|
||||
pub use parsing::ast::types::{FormatOptions, NodePath};
|
||||
pub use settings::types::{project::ProjectConfiguration, Configuration, UnitLength};
|
||||
pub use source_range::SourceRange;
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
@ -250,8 +250,8 @@ impl Program {
|
||||
self.ast.lint(rule)
|
||||
}
|
||||
|
||||
pub fn node_path_from_range(&self, cached_body_items: usize, range: SourceRange) -> Option<NodePath> {
|
||||
NodePath::from_range(&self.ast, cached_body_items, range)
|
||||
pub fn node_path_from_range(&self, range: SourceRange) -> Option<NodePath> {
|
||||
NodePath::from_range(&self.ast, range)
|
||||
}
|
||||
|
||||
pub fn recast(&self) -> String {
|
||||
|
@ -11,7 +11,7 @@ use std::{
|
||||
|
||||
use anyhow::Result;
|
||||
use parse_display::{Display, FromStr};
|
||||
pub use path::{NodePath, Step};
|
||||
pub use path::NodePath;
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tower_lsp::lsp_types::{
|
||||
|
@ -62,21 +62,14 @@ pub enum Step {
|
||||
impl NodePath {
|
||||
/// Given a program and a [`SourceRange`], return the path to the node that
|
||||
/// contains the range.
|
||||
pub(crate) fn from_range(program: &Node<Program>, cached_body_items: usize, range: SourceRange) -> Option<Self> {
|
||||
Self::from_body(&program.body, cached_body_items, range, NodePath::default())
|
||||
pub(crate) fn from_range(program: &Node<Program>, range: SourceRange) -> Option<Self> {
|
||||
Self::from_body(&program.body, range, NodePath::default())
|
||||
}
|
||||
|
||||
fn from_body(
|
||||
body: &[BodyItem],
|
||||
cached_body_items: usize,
|
||||
range: SourceRange,
|
||||
mut path: NodePath,
|
||||
) -> Option<NodePath> {
|
||||
fn from_body(body: &[BodyItem], range: SourceRange, mut path: NodePath) -> Option<NodePath> {
|
||||
for (i, item) in body.iter().enumerate() {
|
||||
if item.contains_range(&range) {
|
||||
path.push(Step::ProgramBodyItem {
|
||||
index: cached_body_items + i,
|
||||
});
|
||||
path.push(Step::ProgramBodyItem { index: i });
|
||||
return Self::from_body_item(item, range, path);
|
||||
}
|
||||
}
|
||||
@ -269,7 +262,7 @@ impl NodePath {
|
||||
}
|
||||
if node.then_val.contains_range(&range) {
|
||||
path.push(Step::IfExpressionThen);
|
||||
return Self::from_body(&node.then_val.body, 0, range, path);
|
||||
return Self::from_body(&node.then_val.body, range, path);
|
||||
}
|
||||
for else_if in &node.else_ifs {
|
||||
if else_if.contains_range(&range) {
|
||||
@ -280,14 +273,14 @@ impl NodePath {
|
||||
}
|
||||
if else_if.then_val.contains_range(&range) {
|
||||
path.push(Step::IfExpressionElseIfBody);
|
||||
return Self::from_body(&else_if.then_val.body, 0, range, path);
|
||||
return Self::from_body(&else_if.then_val.body, range, path);
|
||||
}
|
||||
return Some(path);
|
||||
}
|
||||
}
|
||||
if node.final_else.contains_range(&range) {
|
||||
path.push(Step::IfExpressionElse);
|
||||
return Self::from_body(&node.final_else.body, 0, range, path);
|
||||
return Self::from_body(&node.final_else.body, range, path);
|
||||
}
|
||||
}
|
||||
Expr::LabelledExpression(node) => {
|
||||
@ -352,7 +345,7 @@ mod tests {
|
||||
// fn cube(sideLength, center) {
|
||||
// ^^^^
|
||||
assert_eq!(
|
||||
NodePath::from_range(&program.ast, 0, range(38, 42)).unwrap(),
|
||||
NodePath::from_range(&program.ast, range(38, 42)).unwrap(),
|
||||
NodePath {
|
||||
steps: vec![Step::ProgramBodyItem { index: 0 }, Step::VariableDeclarationDeclaration],
|
||||
}
|
||||
@ -360,7 +353,7 @@ mod tests {
|
||||
// fn cube(sideLength, center) {
|
||||
// ^^^^^^
|
||||
assert_eq!(
|
||||
NodePath::from_range(&program.ast, 0, range(55, 61)).unwrap(),
|
||||
NodePath::from_range(&program.ast, range(55, 61)).unwrap(),
|
||||
NodePath {
|
||||
steps: vec![
|
||||
Step::ProgramBodyItem { index: 0 },
|
||||
@ -373,7 +366,7 @@ mod tests {
|
||||
// |> line(endAbsolute = p1)
|
||||
// ^^
|
||||
assert_eq!(
|
||||
NodePath::from_range(&program.ast, 0, range(293, 295)).unwrap(),
|
||||
NodePath::from_range(&program.ast, range(293, 295)).unwrap(),
|
||||
NodePath {
|
||||
steps: vec![
|
||||
Step::ProgramBodyItem { index: 0 },
|
||||
@ -390,7 +383,7 @@ mod tests {
|
||||
// myCube = cube(sideLength = 40, center = [0, 0])
|
||||
// ^
|
||||
assert_eq!(
|
||||
NodePath::from_range(&program.ast, 0, range(485, 486)).unwrap(),
|
||||
NodePath::from_range(&program.ast, range(485, 486)).unwrap(),
|
||||
NodePath {
|
||||
steps: vec![
|
||||
Step::ProgramBodyItem { index: 1 },
|
||||
|
@ -21,7 +21,7 @@ struct Test {
|
||||
name: String,
|
||||
/// The name of the KCL file that's the entry point, e.g. "main.kcl", in the
|
||||
/// `input_dir`.
|
||||
entry_point: PathBuf,
|
||||
entry_point: String,
|
||||
/// Input KCL files are in this directory.
|
||||
input_dir: PathBuf,
|
||||
/// Expected snapshot output files are in this directory.
|
||||
@ -34,16 +34,11 @@ impl Test {
|
||||
fn new(name: &str) -> Self {
|
||||
Self {
|
||||
name: name.to_owned(),
|
||||
entry_point: Path::new("tests").join(name).join("input.kcl"),
|
||||
entry_point: "input.kcl".to_owned(),
|
||||
input_dir: Path::new("tests").join(name),
|
||||
output_dir: Path::new("tests").join(name),
|
||||
}
|
||||
}
|
||||
|
||||
/// Read in the entry point file and return its contents as a string.
|
||||
pub fn read(&self) -> String {
|
||||
std::fs::read_to_string(&self.entry_point).expect("Failed to read file: {filename}")
|
||||
}
|
||||
}
|
||||
|
||||
fn assert_snapshot<F, R>(test: &Test, operation: &str, f: F)
|
||||
@ -71,12 +66,19 @@ where
|
||||
settings.bind(f);
|
||||
}
|
||||
|
||||
fn read<P>(filename: &str, dir: P) -> String
|
||||
where
|
||||
P: AsRef<Path>,
|
||||
{
|
||||
std::fs::read_to_string(dir.as_ref().join(filename)).expect("Failed to read file: {filename}")
|
||||
}
|
||||
|
||||
fn parse(test_name: &str) {
|
||||
parse_test(&Test::new(test_name));
|
||||
}
|
||||
|
||||
fn parse_test(test: &Test) {
|
||||
let input = test.read();
|
||||
let input = read(&test.entry_point, &test.input_dir);
|
||||
let tokens = crate::parsing::token::lex(&input, ModuleId::default()).unwrap();
|
||||
|
||||
// Parse the tokens into an AST.
|
||||
@ -96,7 +98,7 @@ async fn unparse(test_name: &str) {
|
||||
|
||||
async fn unparse_test(test: &Test) {
|
||||
// Parse into an AST
|
||||
let input = test.read();
|
||||
let input = read(&test.entry_point, &test.input_dir);
|
||||
let tokens = crate::parsing::token::lex(&input, ModuleId::default()).unwrap();
|
||||
let ast = crate::parsing::parse_tokens(tokens).unwrap();
|
||||
|
||||
@ -109,9 +111,10 @@ async fn unparse_test(test: &Test) {
|
||||
}));
|
||||
|
||||
// Check all the rest of the files in the directory.
|
||||
let entry_point = test.input_dir.join(&test.entry_point);
|
||||
let kcl_files = crate::unparser::walk_dir(&test.input_dir).await.unwrap();
|
||||
// Filter out the entry point file.
|
||||
let kcl_files = kcl_files.into_iter().filter(|f| f != &test.entry_point);
|
||||
let kcl_files = kcl_files.into_iter().filter(|f| f != &entry_point);
|
||||
let futures = kcl_files
|
||||
.into_iter()
|
||||
.filter(|file| file.extension().is_some_and(|ext| ext == "kcl")) // We only care about kcl
|
||||
@ -151,11 +154,13 @@ async fn execute(test_name: &str, render_to_png: bool) {
|
||||
}
|
||||
|
||||
async fn execute_test(test: &Test, render_to_png: bool, export_step: bool) {
|
||||
let input = test.read();
|
||||
let input = read(&test.entry_point, &test.input_dir);
|
||||
let ast = crate::Program::parse_no_errs(&input).unwrap();
|
||||
|
||||
// Run the program.
|
||||
let exec_res = crate::test_server::execute_and_snapshot_ast(ast, Some(test.entry_point.clone()), export_step).await;
|
||||
let exec_res =
|
||||
crate::test_server::execute_and_snapshot_ast(ast, Some(test.input_dir.join(&test.entry_point)), export_step)
|
||||
.await;
|
||||
match exec_res {
|
||||
Ok((exec_state, env_ref, png, step)) => {
|
||||
let fail_path = test.output_dir.join("execution_error.snap");
|
||||
@ -2765,7 +2770,7 @@ mod clone_w_fillets {
|
||||
/// Test that KCL is executed correctly.
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
#[ignore] // turn on when https://github.com/KittyCAD/engine/pull/3380 is merged
|
||||
// There's also a test in clone.rs you need to turn too
|
||||
// Theres also a test in clone.rs you need to turn too
|
||||
async fn kcl_test_execute() {
|
||||
super::execute(TEST_NAME, true).await
|
||||
}
|
||||
@ -3086,48 +3091,6 @@ mod error_revolve_on_edge_get_edge {
|
||||
super::execute(TEST_NAME, true).await
|
||||
}
|
||||
}
|
||||
mod subtract_with_pattern {
|
||||
const TEST_NAME: &str = "subtract_with_pattern";
|
||||
|
||||
/// Test parsing KCL.
|
||||
#[test]
|
||||
fn parse() {
|
||||
super::parse(TEST_NAME)
|
||||
}
|
||||
|
||||
/// Test that parsing and unparsing KCL produces the original KCL input.
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn unparse() {
|
||||
super::unparse(TEST_NAME).await
|
||||
}
|
||||
|
||||
/// Test that KCL is executed correctly.
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_execute() {
|
||||
super::execute(TEST_NAME, true).await
|
||||
}
|
||||
}
|
||||
mod subtract_with_pattern_cut_thru {
|
||||
const TEST_NAME: &str = "subtract_with_pattern_cut_thru";
|
||||
|
||||
/// Test parsing KCL.
|
||||
#[test]
|
||||
fn parse() {
|
||||
super::parse(TEST_NAME)
|
||||
}
|
||||
|
||||
/// Test that parsing and unparsing KCL produces the original KCL input.
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn unparse() {
|
||||
super::unparse(TEST_NAME).await
|
||||
}
|
||||
|
||||
/// Test that KCL is executed correctly.
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_execute() {
|
||||
super::execute(TEST_NAME, true).await
|
||||
}
|
||||
}
|
||||
mod sketch_on_face_union {
|
||||
const TEST_NAME: &str = "sketch_on_face_union";
|
||||
|
||||
@ -3149,67 +3112,3 @@ mod sketch_on_face_union {
|
||||
super::execute(TEST_NAME, true).await
|
||||
}
|
||||
}
|
||||
mod multi_target_csg {
|
||||
const TEST_NAME: &str = "multi_target_csg";
|
||||
|
||||
/// Test parsing KCL.
|
||||
#[test]
|
||||
fn parse() {
|
||||
super::parse(TEST_NAME)
|
||||
}
|
||||
|
||||
/// Test that parsing and unparsing KCL produces the original KCL input.
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn unparse() {
|
||||
super::unparse(TEST_NAME).await
|
||||
}
|
||||
|
||||
/// Test that KCL is executed correctly.
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_execute() {
|
||||
super::execute(TEST_NAME, true).await
|
||||
}
|
||||
}
|
||||
mod revolve_colinear {
|
||||
const TEST_NAME: &str = "revolve-colinear";
|
||||
|
||||
/// Test parsing KCL.
|
||||
#[test]
|
||||
fn parse() {
|
||||
super::parse(TEST_NAME)
|
||||
}
|
||||
|
||||
/// Test that parsing and unparsing KCL produces the original KCL input.
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn unparse() {
|
||||
super::unparse(TEST_NAME).await
|
||||
}
|
||||
|
||||
/// Test that KCL is executed correctly.
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
#[ignore] // until https://github.com/KittyCAD/engine/pull/3417 lands
|
||||
async fn kcl_test_execute() {
|
||||
super::execute(TEST_NAME, true).await
|
||||
}
|
||||
}
|
||||
mod subtract_regression07 {
|
||||
const TEST_NAME: &str = "subtract_regression07";
|
||||
|
||||
/// Test parsing KCL.
|
||||
#[test]
|
||||
fn parse() {
|
||||
super::parse(TEST_NAME)
|
||||
}
|
||||
|
||||
/// Test that parsing and unparsing KCL produces the original KCL input.
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn unparse() {
|
||||
super::unparse(TEST_NAME).await
|
||||
}
|
||||
|
||||
/// Test that KCL is executed correctly.
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_execute() {
|
||||
super::execute(TEST_NAME, true).await
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ lazy_static::lazy_static! {
|
||||
|
||||
#[kcl_directory_test_macro::test_all_dirs("../public/kcl-samples")]
|
||||
fn parse(dir_name: &str, dir_path: &Path) {
|
||||
let t = test(dir_name, dir_path.join("main.kcl"));
|
||||
let t = test(dir_name, dir_path.join("main.kcl").to_str().unwrap().to_owned());
|
||||
let write_new = matches!(
|
||||
std::env::var("INSTA_UPDATE").as_deref(),
|
||||
Ok("auto" | "always" | "new" | "unseen")
|
||||
@ -37,7 +37,7 @@ fn parse(dir_name: &str, dir_path: &Path) {
|
||||
|
||||
#[kcl_directory_test_macro::test_all_dirs("../public/kcl-samples")]
|
||||
async fn unparse(dir_name: &str, dir_path: &Path) {
|
||||
let t = test(dir_name, dir_path.join("main.kcl"));
|
||||
let t = test(dir_name, dir_path.join("main.kcl").to_str().unwrap().to_owned());
|
||||
unparse_test(&t).await;
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ async fn unparse_test(test: &Test) {
|
||||
|
||||
#[kcl_directory_test_macro::test_all_dirs("../public/kcl-samples")]
|
||||
async fn kcl_test_execute(dir_name: &str, dir_path: &Path) {
|
||||
let t = test(dir_name, dir_path.join("main.kcl"));
|
||||
let t = test(dir_name, dir_path.join("main.kcl").to_str().unwrap().to_owned());
|
||||
super::execute_test(&t, true, true).await;
|
||||
}
|
||||
|
||||
@ -129,22 +129,12 @@ fn test_after_engine_generate_manifest() {
|
||||
generate_kcl_manifest(&INPUTS_DIR).unwrap();
|
||||
}
|
||||
|
||||
fn test(test_name: &str, entry_point: std::path::PathBuf) -> Test {
|
||||
let parent = std::fs::canonicalize(entry_point.parent().unwrap()).unwrap();
|
||||
let inputs_dir = std::fs::canonicalize(INPUTS_DIR.as_path()).unwrap();
|
||||
let relative_path = parent.strip_prefix(inputs_dir).unwrap();
|
||||
let output_dir = std::fs::canonicalize(OUTPUTS_DIR.as_path()).unwrap();
|
||||
let relative_output_dir = output_dir.join(relative_path);
|
||||
|
||||
// Ensure the output directory exists.
|
||||
if !relative_output_dir.exists() {
|
||||
std::fs::create_dir_all(&relative_output_dir).unwrap();
|
||||
}
|
||||
fn test(test_name: &str, entry_point: String) -> Test {
|
||||
Test {
|
||||
name: test_name.to_owned(),
|
||||
entry_point: entry_point.clone(),
|
||||
input_dir: parent.to_path_buf(),
|
||||
output_dir: relative_output_dir,
|
||||
entry_point,
|
||||
input_dir: INPUTS_DIR.join(test_name),
|
||||
output_dir: OUTPUTS_DIR.join(test_name),
|
||||
}
|
||||
}
|
||||
|
||||
@ -183,9 +173,8 @@ fn kcl_samples_inputs() -> Vec<Test> {
|
||||
eprintln!("Found KCL sample: {:?}", dir_name.to_string_lossy());
|
||||
// Look for the entry point inside the directory.
|
||||
let sub_dir = INPUTS_DIR.join(dir_name);
|
||||
let main_kcl_path = sub_dir.join("main.kcl");
|
||||
let entry_point = if main_kcl_path.exists() {
|
||||
main_kcl_path
|
||||
let entry_point = if sub_dir.join("main.kcl").exists() {
|
||||
"main.kcl".to_owned()
|
||||
} else {
|
||||
panic!("No main.kcl found in {:?}", sub_dir);
|
||||
};
|
||||
|
@ -161,7 +161,6 @@ async fn fix_tags_and_references(
|
||||
},
|
||||
exec_state,
|
||||
args,
|
||||
None,
|
||||
)
|
||||
.await?;
|
||||
|
||||
|
@ -293,6 +293,20 @@ pub async fn subtract(exec_state: &mut ExecState, args: Args) -> Result<KclValue
|
||||
let solids: Vec<Solid> = args.get_unlabeled_kw_arg_typed("solids", &RuntimeType::solids(), exec_state)?;
|
||||
let tools: Vec<Solid> = args.get_kw_arg_typed("tools", &RuntimeType::solids(), exec_state)?;
|
||||
|
||||
if solids.len() > 1 {
|
||||
return Err(KclError::UndefinedValue(KclErrorDetails {
|
||||
message: "Only one solid is allowed for a subtract operation, currently.".to_string(),
|
||||
source_ranges: vec![args.source_range],
|
||||
}));
|
||||
}
|
||||
|
||||
if tools.len() > 1 {
|
||||
return Err(KclError::UndefinedValue(KclErrorDetails {
|
||||
message: "Only one tool is allowed for a subtract operation, currently.".to_string(),
|
||||
source_ranges: vec![args.source_range],
|
||||
}));
|
||||
}
|
||||
|
||||
let tolerance: Option<TyF64> = args.get_kw_arg_opt_typed("tolerance", &RuntimeType::length(), exec_state)?;
|
||||
|
||||
let solids = inner_subtract(solids, tools, tolerance, exec_state, args).await?;
|
||||
|
@ -220,7 +220,6 @@ async fn inner_extrude(
|
||||
},
|
||||
exec_state,
|
||||
&args,
|
||||
None,
|
||||
)
|
||||
.await?,
|
||||
);
|
||||
@ -235,7 +234,6 @@ pub(crate) struct NamedCapTags<'a> {
|
||||
pub end: Option<&'a TagNode>,
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub(crate) async fn do_post_extrude<'a>(
|
||||
sketch: &Sketch,
|
||||
#[cfg(feature = "artifact-graph")] solid_id: ArtifactId,
|
||||
@ -244,7 +242,6 @@ pub(crate) async fn do_post_extrude<'a>(
|
||||
named_cap_tags: &'a NamedCapTags<'a>,
|
||||
exec_state: &mut ExecState,
|
||||
args: &Args,
|
||||
edge_id: Option<Uuid>,
|
||||
) -> Result<Solid, KclError> {
|
||||
// Bring the object to the front of the scene.
|
||||
// See: https://github.com/KittyCAD/modeling-app/issues/806
|
||||
@ -254,9 +251,7 @@ pub(crate) async fn do_post_extrude<'a>(
|
||||
)
|
||||
.await?;
|
||||
|
||||
let any_edge_id = if let Some(id) = edge_id {
|
||||
id
|
||||
} else if let Some(edge_id) = sketch.mirror {
|
||||
let any_edge_id = if let Some(edge_id) = sketch.mirror {
|
||||
edge_id
|
||||
} else {
|
||||
// The "get extrusion face info" API call requires *any* edge on the sketch being extruded.
|
||||
|
@ -187,7 +187,6 @@ async fn inner_loft(
|
||||
},
|
||||
exec_state,
|
||||
&args,
|
||||
None,
|
||||
)
|
||||
.await?,
|
||||
))
|
||||
|
@ -20,8 +20,6 @@ use crate::{
|
||||
std::{axis_or_reference::Axis2dOrEdgeReference, extrude::do_post_extrude, Args},
|
||||
};
|
||||
|
||||
extern crate nalgebra_glm as glm;
|
||||
|
||||
/// Revolve a sketch or set of sketches around an axis.
|
||||
pub async fn revolve(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let sketches = args.get_unlabeled_kw_arg_typed("sketches", &RuntimeType::sketches(), exec_state)?;
|
||||
@ -133,9 +131,8 @@ async fn inner_revolve(
|
||||
let mut solids = Vec::new();
|
||||
for sketch in &sketches {
|
||||
let id = exec_state.next_uuid();
|
||||
let tolerance = tolerance.as_ref().map(|t| t.to_mm()).unwrap_or(DEFAULT_TOLERANCE);
|
||||
|
||||
let direction = match &axis {
|
||||
match &axis {
|
||||
Axis2dOrEdgeReference::Axis { direction, origin } => {
|
||||
args.batch_modeling_cmd(
|
||||
id,
|
||||
@ -152,13 +149,12 @@ async fn inner_revolve(
|
||||
y: LengthUnit(origin[1].to_mm()),
|
||||
z: LengthUnit(0.0),
|
||||
},
|
||||
tolerance: LengthUnit(tolerance),
|
||||
tolerance: LengthUnit(tolerance.as_ref().map(|t| t.to_mm()).unwrap_or(DEFAULT_TOLERANCE)),
|
||||
axis_is_2d: true,
|
||||
opposite: opposite.clone(),
|
||||
}),
|
||||
)
|
||||
.await?;
|
||||
glm::DVec2::new(direction[0].to_mm(), direction[1].to_mm())
|
||||
}
|
||||
Axis2dOrEdgeReference::Edge(edge) => {
|
||||
let edge_id = edge.get_engine_id(exec_state, &args)?;
|
||||
@ -168,29 +164,12 @@ async fn inner_revolve(
|
||||
angle,
|
||||
target: sketch.id.into(),
|
||||
edge_id,
|
||||
tolerance: LengthUnit(tolerance),
|
||||
tolerance: LengthUnit(tolerance.as_ref().map(|t| t.to_mm()).unwrap_or(DEFAULT_TOLERANCE)),
|
||||
opposite: opposite.clone(),
|
||||
}),
|
||||
)
|
||||
.await?;
|
||||
//TODO: fix me! Need to be able to calculate this to ensure the path isn't colinear
|
||||
glm::DVec2::new(0.0, 1.0)
|
||||
}
|
||||
};
|
||||
|
||||
let mut edge_id = None;
|
||||
// If an edge lies on the axis of revolution it will not exist after the revolve, so
|
||||
// it cannot be used to retrieve data about the solid
|
||||
for path in sketch.paths.clone() {
|
||||
let from = path.get_from();
|
||||
let to = path.get_to();
|
||||
|
||||
let dir = glm::DVec2::new(to[0].n - from[0].n, to[1].n - from[1].n);
|
||||
if glm::are_collinear2d(&dir, &direction, tolerance) {
|
||||
continue;
|
||||
}
|
||||
edge_id = Some(path.get_id());
|
||||
break;
|
||||
}
|
||||
|
||||
solids.push(
|
||||
@ -206,7 +185,6 @@ async fn inner_revolve(
|
||||
},
|
||||
exec_state,
|
||||
&args,
|
||||
edge_id,
|
||||
)
|
||||
.await?,
|
||||
);
|
||||
|
@ -110,9 +110,9 @@ pub async fn sweep(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
|
||||
///
|
||||
///
|
||||
/// // Create a spring by sweeping around the helix path.
|
||||
/// springSketch = startSketchOn(XZ)
|
||||
/// |> circle( center = [5, 0], radius = 1)
|
||||
/// |> sweep(path = helixPath)
|
||||
/// springSketch = startSketchOn(YZ)
|
||||
/// |> circle( center = [0, 0], radius = 1)
|
||||
/// |> sweep(path = helixPath, relativeTo = "sketchPlane")
|
||||
/// ```
|
||||
///
|
||||
/// ```no_run
|
||||
@ -228,7 +228,6 @@ async fn inner_sweep(
|
||||
},
|
||||
exec_state,
|
||||
&args,
|
||||
None,
|
||||
)
|
||||
.await?,
|
||||
);
|
||||
|
@ -82,9 +82,9 @@ export END = 'end'
|
||||
/// )
|
||||
///
|
||||
/// // Create a spring by sweeping around the helix path.
|
||||
/// springSketch = startSketchOn(XZ)
|
||||
/// |> circle( center = [5, 0], radius = 0.5)
|
||||
/// |> sweep(path = helixPath)
|
||||
/// springSketch = startSketchOn(YZ)
|
||||
/// |> circle( center = [0, 0], radius = 0.5)
|
||||
/// |> sweep(path = helixPath, relativeTo = sweep::SKETCH_PLANE)
|
||||
/// ```
|
||||
///
|
||||
/// ```
|
||||
@ -103,9 +103,9 @@ export END = 'end'
|
||||
/// )
|
||||
///
|
||||
/// // Create a spring by sweeping around the helix path.
|
||||
/// springSketch = startSketchOn(XZ)
|
||||
/// |> circle( center = [5, 0], radius = 0.5 )
|
||||
/// |> sweep(path = helixPath)
|
||||
/// springSketch = startSketchOn(XY)
|
||||
/// |> circle( center = [0, 0], radius = 0.5 )
|
||||
/// |> sweep(path = helixPath, relativeTo = sweep::SKETCH_PLANE)
|
||||
/// ```
|
||||
///
|
||||
/// ```
|
||||
@ -123,9 +123,9 @@ export END = 'end'
|
||||
/// )
|
||||
///
|
||||
/// // Create a spring by sweeping around the helix path.
|
||||
/// springSketch = startSketchOn(XZ)
|
||||
/// |> circle( center = [5, 0], radius = 1 )
|
||||
/// |> sweep(path = helixPath)
|
||||
/// springSketch = startSketchOn(XY)
|
||||
/// |> circle( center = [0, 0], radius = 1 )
|
||||
/// |> sweep(path = helixPath, relativeTo = sweep::SKETCH_PLANE)
|
||||
/// ```
|
||||
///
|
||||
/// ```
|
||||
@ -408,13 +408,13 @@ export fn offsetPlane(
|
||||
/// )
|
||||
///
|
||||
///
|
||||
/// springSketch = startSketchOn(XZ)
|
||||
/// springSketch = startSketchOn(YZ)
|
||||
/// |> circle( center = [0, 0], radius = 1)
|
||||
///
|
||||
/// // Create a spring by sweeping around the helix path.
|
||||
/// sweepedSpring = clone(springSketch)
|
||||
/// |> translate(x=5)
|
||||
/// |> sweep(path = helixPath)
|
||||
/// |> translate(x=100)
|
||||
/// |> sweep(path = helixPath, relativeTo = sweep::SKETCH_PLANE)
|
||||
/// ```
|
||||
///
|
||||
/// ```kcl
|
||||
|
@ -1,6 +0,0 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Artifact graph flowchart multi_target_csg.kcl
|
||||
extension: md
|
||||
snapshot_kind: binary
|
||||
---
|
@ -1,466 +0,0 @@
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph path5 [Path]
|
||||
5["Path<br>[89, 136, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
|
||||
10["Segment<br>[142, 163, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
||||
11["Segment<br>[169, 247, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
|
||||
12["Segment<br>[253, 275, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
|
||||
13["Segment<br>[281, 362, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
|
||||
14["Segment<br>[368, 390, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
|
||||
15["Segment<br>[396, 477, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
|
||||
16["Segment<br>[483, 504, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 7 }]
|
||||
17["Segment<br>[510, 590, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
|
||||
18["Segment<br>[596, 603, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 9 }]
|
||||
34[Solid2d]
|
||||
end
|
||||
subgraph path6 [Path]
|
||||
6["Path<br>[627, 695, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 10 }, CallKwArg { index: 0 }]
|
||||
19["Segment<br>[627, 695, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 10 }, CallKwArg { index: 0 }]
|
||||
37[Solid2d]
|
||||
end
|
||||
subgraph path7 [Path]
|
||||
7["Path<br>[811, 861, 0]"]
|
||||
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
|
||||
20["Segment<br>[867, 898, 0]"]
|
||||
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
||||
21["Segment<br>[904, 929, 0]"]
|
||||
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
|
||||
22["Segment<br>[935, 969, 0]"]
|
||||
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
|
||||
23["Segment<br>[975, 1008, 0]"]
|
||||
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
|
||||
24["Segment<br>[1014, 1038, 0]"]
|
||||
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
|
||||
25["Segment<br>[1044, 1051, 0]"]
|
||||
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
|
||||
33[Solid2d]
|
||||
end
|
||||
subgraph path8 [Path]
|
||||
8["Path<br>[1075, 1118, 0]"]
|
||||
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
|
||||
26["Segment<br>[1124, 1148, 0]"]
|
||||
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
||||
27["Segment<br>[1154, 1187, 0]"]
|
||||
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
|
||||
28["Segment<br>[1193, 1227, 0]"]
|
||||
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
|
||||
29["Segment<br>[1233, 1258, 0]"]
|
||||
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
|
||||
30["Segment<br>[1264, 1296, 0]"]
|
||||
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
|
||||
31["Segment<br>[1302, 1309, 0]"]
|
||||
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
|
||||
36[Solid2d]
|
||||
end
|
||||
subgraph path9 [Path]
|
||||
9["Path<br>[1499, 1562, 0]"]
|
||||
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
32["Segment<br>[1499, 1562, 0]"]
|
||||
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
35[Solid2d]
|
||||
end
|
||||
1["Plane<br>[47, 65, 0]"]
|
||||
%% [ProgramBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
2["Plane<br>[770, 787, 0]"]
|
||||
%% [ProgramBodyItem { index: 3 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
3["Plane<br>[1444, 1474, 0]"]
|
||||
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, CallKwUnlabeledArg]
|
||||
4["StartSketchOnPlane<br>[1430, 1475, 0]"]
|
||||
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
38["Sweep Extrusion<br>[711, 756, 0]"]
|
||||
%% [ProgramBodyItem { index: 2 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
39["Sweep Extrusion<br>[1324, 1416, 0]"]
|
||||
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
40["Sweep Extrusion<br>[1324, 1416, 0]"]
|
||||
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
41["Sweep Extrusion<br>[1580, 1623, 0]"]
|
||||
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
42[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
43[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
44[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
45[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
46[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
47[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
48[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
49[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
50[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
51[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
52[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
53[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
54[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
55[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
56[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
57[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
58[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
59[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
60[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
61[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
62[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
63["Cap Start"]
|
||||
%% face_code_ref=Missing NodePath
|
||||
64["Cap Start"]
|
||||
%% face_code_ref=Missing NodePath
|
||||
65["Cap Start"]
|
||||
%% face_code_ref=Missing NodePath
|
||||
66["Cap Start"]
|
||||
%% face_code_ref=Missing NodePath
|
||||
67["Cap End"]
|
||||
%% face_code_ref=Missing NodePath
|
||||
68["Cap End"]
|
||||
%% face_code_ref=Missing NodePath
|
||||
69["Cap End"]
|
||||
%% face_code_ref=Missing NodePath
|
||||
70["Cap End"]
|
||||
%% face_code_ref=Missing NodePath
|
||||
71["SweepEdge Opposite"]
|
||||
72["SweepEdge Opposite"]
|
||||
73["SweepEdge Opposite"]
|
||||
74["SweepEdge Opposite"]
|
||||
75["SweepEdge Opposite"]
|
||||
76["SweepEdge Opposite"]
|
||||
77["SweepEdge Opposite"]
|
||||
78["SweepEdge Opposite"]
|
||||
79["SweepEdge Opposite"]
|
||||
80["SweepEdge Opposite"]
|
||||
81["SweepEdge Opposite"]
|
||||
82["SweepEdge Opposite"]
|
||||
83["SweepEdge Opposite"]
|
||||
84["SweepEdge Opposite"]
|
||||
85["SweepEdge Opposite"]
|
||||
86["SweepEdge Opposite"]
|
||||
87["SweepEdge Opposite"]
|
||||
88["SweepEdge Opposite"]
|
||||
89["SweepEdge Opposite"]
|
||||
90["SweepEdge Opposite"]
|
||||
91["SweepEdge Opposite"]
|
||||
92["SweepEdge Adjacent"]
|
||||
93["SweepEdge Adjacent"]
|
||||
94["SweepEdge Adjacent"]
|
||||
95["SweepEdge Adjacent"]
|
||||
96["SweepEdge Adjacent"]
|
||||
97["SweepEdge Adjacent"]
|
||||
98["SweepEdge Adjacent"]
|
||||
99["SweepEdge Adjacent"]
|
||||
100["SweepEdge Adjacent"]
|
||||
101["SweepEdge Adjacent"]
|
||||
102["SweepEdge Adjacent"]
|
||||
103["SweepEdge Adjacent"]
|
||||
104["SweepEdge Adjacent"]
|
||||
105["SweepEdge Adjacent"]
|
||||
106["SweepEdge Adjacent"]
|
||||
107["SweepEdge Adjacent"]
|
||||
108["SweepEdge Adjacent"]
|
||||
109["SweepEdge Adjacent"]
|
||||
110["SweepEdge Adjacent"]
|
||||
111["SweepEdge Adjacent"]
|
||||
112["SweepEdge Adjacent"]
|
||||
1 --- 5
|
||||
1 --- 6
|
||||
2 --- 7
|
||||
2 --- 8
|
||||
3 <--x 4
|
||||
3 --- 9
|
||||
5 --- 10
|
||||
5 --- 11
|
||||
5 --- 12
|
||||
5 --- 13
|
||||
5 --- 14
|
||||
5 --- 15
|
||||
5 --- 16
|
||||
5 --- 17
|
||||
5 --- 18
|
||||
5 --- 34
|
||||
5 ---- 38
|
||||
6 --- 19
|
||||
6 --- 37
|
||||
7 --- 20
|
||||
7 --- 21
|
||||
7 --- 22
|
||||
7 --- 23
|
||||
7 --- 24
|
||||
7 --- 25
|
||||
7 --- 33
|
||||
7 ---- 40
|
||||
8 --- 26
|
||||
8 --- 27
|
||||
8 --- 28
|
||||
8 --- 29
|
||||
8 --- 30
|
||||
8 --- 31
|
||||
8 --- 36
|
||||
8 ---- 39
|
||||
9 --- 32
|
||||
9 --- 35
|
||||
9 ---- 41
|
||||
10 --- 58
|
||||
10 x--> 65
|
||||
10 --- 91
|
||||
10 --- 112
|
||||
11 --- 57
|
||||
11 x--> 65
|
||||
11 --- 90
|
||||
11 --- 111
|
||||
12 --- 59
|
||||
12 x--> 65
|
||||
12 --- 89
|
||||
12 --- 110
|
||||
13 --- 56
|
||||
13 x--> 65
|
||||
13 --- 88
|
||||
13 --- 109
|
||||
14 --- 55
|
||||
14 x--> 65
|
||||
14 --- 87
|
||||
14 --- 108
|
||||
15 --- 60
|
||||
15 x--> 65
|
||||
15 --- 86
|
||||
15 --- 107
|
||||
16 --- 62
|
||||
16 x--> 65
|
||||
16 --- 85
|
||||
16 --- 106
|
||||
17 --- 61
|
||||
17 x--> 65
|
||||
17 --- 84
|
||||
17 --- 105
|
||||
20 --- 49
|
||||
20 x--> 63
|
||||
20 --- 78
|
||||
20 --- 99
|
||||
21 --- 54
|
||||
21 x--> 63
|
||||
21 --- 79
|
||||
21 --- 100
|
||||
22 --- 52
|
||||
22 x--> 63
|
||||
22 --- 80
|
||||
22 --- 101
|
||||
23 --- 51
|
||||
23 x--> 63
|
||||
23 --- 81
|
||||
23 --- 102
|
||||
24 --- 53
|
||||
24 x--> 63
|
||||
24 --- 82
|
||||
24 --- 103
|
||||
25 --- 50
|
||||
25 x--> 63
|
||||
25 --- 83
|
||||
25 --- 104
|
||||
26 --- 44
|
||||
26 x--> 64
|
||||
26 --- 76
|
||||
26 --- 97
|
||||
27 --- 45
|
||||
27 x--> 64
|
||||
27 --- 75
|
||||
27 --- 96
|
||||
28 --- 47
|
||||
28 x--> 64
|
||||
28 --- 74
|
||||
28 --- 95
|
||||
29 --- 42
|
||||
29 x--> 64
|
||||
29 --- 73
|
||||
29 --- 94
|
||||
30 --- 46
|
||||
30 x--> 64
|
||||
30 --- 72
|
||||
30 --- 93
|
||||
31 --- 43
|
||||
31 x--> 64
|
||||
31 --- 71
|
||||
31 --- 92
|
||||
32 --- 48
|
||||
32 x--> 70
|
||||
32 --- 77
|
||||
32 --- 98
|
||||
38 --- 55
|
||||
38 --- 56
|
||||
38 --- 57
|
||||
38 --- 58
|
||||
38 --- 59
|
||||
38 --- 60
|
||||
38 --- 61
|
||||
38 --- 62
|
||||
38 --- 65
|
||||
38 --- 69
|
||||
38 --- 84
|
||||
38 --- 85
|
||||
38 --- 86
|
||||
38 --- 87
|
||||
38 --- 88
|
||||
38 --- 89
|
||||
38 --- 90
|
||||
38 --- 91
|
||||
38 --- 105
|
||||
38 --- 106
|
||||
38 --- 107
|
||||
38 --- 108
|
||||
38 --- 109
|
||||
38 --- 110
|
||||
38 --- 111
|
||||
38 --- 112
|
||||
39 --- 42
|
||||
39 --- 43
|
||||
39 --- 44
|
||||
39 --- 45
|
||||
39 --- 46
|
||||
39 --- 47
|
||||
39 --- 64
|
||||
39 --- 68
|
||||
39 --- 71
|
||||
39 --- 72
|
||||
39 --- 73
|
||||
39 --- 74
|
||||
39 --- 75
|
||||
39 --- 76
|
||||
39 --- 92
|
||||
39 --- 93
|
||||
39 --- 94
|
||||
39 --- 95
|
||||
39 --- 96
|
||||
39 --- 97
|
||||
40 --- 49
|
||||
40 --- 50
|
||||
40 --- 51
|
||||
40 --- 52
|
||||
40 --- 53
|
||||
40 --- 54
|
||||
40 --- 63
|
||||
40 --- 67
|
||||
40 --- 78
|
||||
40 --- 79
|
||||
40 --- 80
|
||||
40 --- 81
|
||||
40 --- 82
|
||||
40 --- 83
|
||||
40 --- 99
|
||||
40 --- 100
|
||||
40 --- 101
|
||||
40 --- 102
|
||||
40 --- 103
|
||||
40 --- 104
|
||||
41 --- 48
|
||||
41 --- 66
|
||||
41 --- 70
|
||||
41 --- 77
|
||||
41 --- 98
|
||||
42 --- 73
|
||||
42 --- 94
|
||||
95 <--x 42
|
||||
43 --- 71
|
||||
43 --- 92
|
||||
93 <--x 43
|
||||
44 --- 76
|
||||
92 <--x 44
|
||||
44 --- 97
|
||||
45 --- 75
|
||||
45 --- 96
|
||||
97 <--x 45
|
||||
46 --- 72
|
||||
46 --- 93
|
||||
94 <--x 46
|
||||
47 --- 74
|
||||
47 --- 95
|
||||
96 <--x 47
|
||||
48 --- 77
|
||||
48 --- 98
|
||||
49 --- 78
|
||||
49 --- 99
|
||||
104 <--x 49
|
||||
50 --- 83
|
||||
103 <--x 50
|
||||
50 --- 104
|
||||
51 --- 81
|
||||
101 <--x 51
|
||||
51 --- 102
|
||||
52 --- 80
|
||||
100 <--x 52
|
||||
52 --- 101
|
||||
53 --- 82
|
||||
102 <--x 53
|
||||
53 --- 103
|
||||
54 --- 79
|
||||
99 <--x 54
|
||||
54 --- 100
|
||||
55 --- 87
|
||||
55 --- 108
|
||||
109 <--x 55
|
||||
56 --- 88
|
||||
56 --- 109
|
||||
110 <--x 56
|
||||
57 --- 90
|
||||
57 --- 111
|
||||
112 <--x 57
|
||||
58 --- 91
|
||||
105 <--x 58
|
||||
58 --- 112
|
||||
59 --- 89
|
||||
59 --- 110
|
||||
111 <--x 59
|
||||
60 --- 86
|
||||
60 --- 107
|
||||
108 <--x 60
|
||||
61 --- 84
|
||||
61 --- 105
|
||||
106 <--x 61
|
||||
62 --- 85
|
||||
62 --- 106
|
||||
107 <--x 62
|
||||
77 <--x 66
|
||||
78 <--x 67
|
||||
79 <--x 67
|
||||
80 <--x 67
|
||||
81 <--x 67
|
||||
82 <--x 67
|
||||
83 <--x 67
|
||||
71 <--x 68
|
||||
72 <--x 68
|
||||
73 <--x 68
|
||||
74 <--x 68
|
||||
75 <--x 68
|
||||
76 <--x 68
|
||||
84 <--x 69
|
||||
85 <--x 69
|
||||
86 <--x 69
|
||||
87 <--x 69
|
||||
88 <--x 69
|
||||
89 <--x 69
|
||||
90 <--x 69
|
||||
91 <--x 69
|
||||
```
|
@ -1,14 +0,0 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Error from executing multi_target_csg.kcl
|
||||
---
|
||||
KCL Engine error
|
||||
|
||||
× engine: Currently the engine does not support multiple targets on subtract
|
||||
╭─[69:10]
|
||||
68 │
|
||||
69 │ cut000 = subtract(extrude001, tools = cut000Extrude)
|
||||
· ─────────────────────┬─────────────────────
|
||||
· ╰── tests/multi_target_csg/input.kcl
|
||||
70 │
|
||||
╰────
|
@ -1,89 +0,0 @@
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
sketch002 = startSketchOn(-XZ)
|
||||
|
||||
sketch002Profile000 = startProfile(sketch002, at = [-0.1625, 0.1875])
|
||||
|> xLine(length = 0.325)
|
||||
|> arc(
|
||||
angleStart = 90,
|
||||
angleEnd = 0,
|
||||
radius = 0.025,
|
||||
)
|
||||
|> yLine(length = -0.325)
|
||||
|> arc(
|
||||
angleStart = 360,
|
||||
angleEnd = 270,
|
||||
radius = 0.025,
|
||||
)
|
||||
|> xLine(length = -0.325)
|
||||
|> arc(
|
||||
angleStart = 270,
|
||||
angleEnd = 180,
|
||||
radius = 0.025,
|
||||
)
|
||||
|> yLine(length = 0.325)
|
||||
|> arc(
|
||||
angleStart = 180,
|
||||
angleEnd = 90,
|
||||
radius = 0.025,
|
||||
)
|
||||
|> close()
|
||||
|> subtract2d(tool = circle(
|
||||
center = [-0, -0],
|
||||
radius = 0.039062,
|
||||
tag = $hole001
|
||||
))
|
||||
|
||||
extrude000 = extrude(sketch002Profile000, length = 0.0625)
|
||||
|
||||
sketch003 = startSketchOn(XY)
|
||||
|
||||
sketch003Profile000 = startProfile(sketch003, at = [-0.05582, -0.21875])
|
||||
|> line(end = [0.048496, 0.21875])
|
||||
|> xLine(length = -0.087793)
|
||||
|> line(end = [-0.026673, -0.120313])
|
||||
|> line(end = [0.058646, -0.098438])
|
||||
|> xLine(length = 0.007324)
|
||||
|> close()
|
||||
|
||||
sketch003Profile001 = startProfile(sketch003, at = [0.007324, 0])
|
||||
|> xLine(length = 0.087793)
|
||||
|> line(end = [0.026673, -0.120313])
|
||||
|> line(end = [-0.058646, -0.098438])
|
||||
|> xLine(length = -0.007324)
|
||||
|> line(end = [-0.048496, 0.21875])
|
||||
|> close()
|
||||
|
||||
extrude001 = extrude([sketch003Profile000, sketch003Profile001], length = 0.1, bidirectionalLength = 0.1)
|
||||
|
||||
sketch004 = startSketchOn(offsetPlane(-XZ, offset = 0.1))
|
||||
|
||||
sketch004Profile000 = circle(
|
||||
sketch004,
|
||||
center = [-0, -0],
|
||||
radius = 0.039062
|
||||
)
|
||||
|
||||
cut000Extrude = extrude([sketch004Profile000], length = -1)
|
||||
|
||||
cut000 = subtract(extrude001, tools = cut000Extrude)
|
||||
|
||||
sketch005 = startSketchOn(offsetPlane(-XZ, offset = 0.07))
|
||||
|
||||
sketch005Profile000 = circle(
|
||||
sketch005,
|
||||
center = [0, 0],
|
||||
radius = 0.052734
|
||||
)
|
||||
|
||||
sketch006 = startSketchOn(offsetPlane(-XZ, offset = 0.0325))
|
||||
|
||||
sketch006Profile000 = circle(
|
||||
sketch006,
|
||||
center = [0, 0],
|
||||
radius = 0.03
|
||||
)
|
||||
|
||||
draftCut000Extrude = loft([sketch005Profile000, sketch006Profile000])
|
||||
|
||||
draftCut000 = subtract(extrude000, tools = draftCut000Extrude)
|
@ -1,265 +0,0 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Operations executed multi_target_csg.kcl
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Plane",
|
||||
"artifact_id": "[uuid]"
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"tool": {
|
||||
"value": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
"name": "subtract2d",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"value": {
|
||||
"type": "Number",
|
||||
"value": 0.0625,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Inches"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"labeledArgs": {},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Plane",
|
||||
"artifact_id": "[uuid]"
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"bidirectionalLength": {
|
||||
"value": {
|
||||
"type": "Number",
|
||||
"value": 0.1,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Inches"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
},
|
||||
"length": {
|
||||
"value": {
|
||||
"type": "Number",
|
||||
"value": 0.1,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Inches"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Array",
|
||||
"value": [
|
||||
{
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"labeledArgs": {},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Plane",
|
||||
"artifact_id": "[uuid]"
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "KclStdLibCall",
|
||||
"name": "offsetPlane",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Plane",
|
||||
"artifact_id": "[uuid]"
|
||||
},
|
||||
"sourceRange": []
|
||||
},
|
||||
"labeledArgs": {
|
||||
"offset": {
|
||||
"value": {
|
||||
"type": "Number",
|
||||
"value": 0.1,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Inches"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"value": {
|
||||
"type": "Number",
|
||||
"value": -1.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Inches"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Array",
|
||||
"value": [
|
||||
{
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"isError": true,
|
||||
"labeledArgs": {
|
||||
"tools": {
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
"name": "subtract",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Array",
|
||||
"value": [
|
||||
{
|
||||
"type": "Solid",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Solid",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
}
|
||||
]
|
@ -1,71 +0,0 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Result of unparsing multi_target_csg.kcl
|
||||
---
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
sketch002 = startSketchOn(-XZ)
|
||||
|
||||
sketch002Profile000 = startProfile(sketch002, at = [-0.1625, 0.1875])
|
||||
|> xLine(length = 0.325)
|
||||
|> arc(angleStart = 90, angleEnd = 0, radius = 0.025)
|
||||
|> yLine(length = -0.325)
|
||||
|> arc(angleStart = 360, angleEnd = 270, radius = 0.025)
|
||||
|> xLine(length = -0.325)
|
||||
|> arc(angleStart = 270, angleEnd = 180, radius = 0.025)
|
||||
|> yLine(length = 0.325)
|
||||
|> arc(angleStart = 180, angleEnd = 90, radius = 0.025)
|
||||
|> close()
|
||||
|> subtract2d(tool = circle(center = [-0, -0], radius = 0.039062, tag = $hole001))
|
||||
|
||||
extrude000 = extrude(sketch002Profile000, length = 0.0625)
|
||||
|
||||
sketch003 = startSketchOn(XY)
|
||||
|
||||
sketch003Profile000 = startProfile(sketch003, at = [-0.05582, -0.21875])
|
||||
|> line(end = [0.048496, 0.21875])
|
||||
|> xLine(length = -0.087793)
|
||||
|> line(end = [-0.026673, -0.120313])
|
||||
|> line(end = [0.058646, -0.098438])
|
||||
|> xLine(length = 0.007324)
|
||||
|> close()
|
||||
|
||||
sketch003Profile001 = startProfile(sketch003, at = [0.007324, 0])
|
||||
|> xLine(length = 0.087793)
|
||||
|> line(end = [0.026673, -0.120313])
|
||||
|> line(end = [-0.058646, -0.098438])
|
||||
|> xLine(length = -0.007324)
|
||||
|> line(end = [-0.048496, 0.21875])
|
||||
|> close()
|
||||
|
||||
extrude001 = extrude(
|
||||
[
|
||||
sketch003Profile000,
|
||||
sketch003Profile001
|
||||
],
|
||||
length = 0.1,
|
||||
bidirectionalLength = 0.1,
|
||||
)
|
||||
|
||||
sketch004 = startSketchOn(offsetPlane(-XZ, offset = 0.1))
|
||||
|
||||
sketch004Profile000 = circle(sketch004, center = [-0, -0], radius = 0.039062)
|
||||
|
||||
cut000Extrude = extrude([sketch004Profile000], length = -1)
|
||||
|
||||
cut000 = subtract(extrude001, tools = cut000Extrude)
|
||||
|
||||
sketch005 = startSketchOn(offsetPlane(-XZ, offset = 0.07))
|
||||
|
||||
sketch005Profile000 = circle(sketch005, center = [0, 0], radius = 0.052734)
|
||||
|
||||
sketch006 = startSketchOn(offsetPlane(-XZ, offset = 0.0325))
|
||||
|
||||
sketch006Profile000 = circle(sketch006, center = [0, 0], radius = 0.03)
|
||||
|
||||
draftCut000Extrude = loft([
|
||||
sketch005Profile000,
|
||||
sketch006Profile000
|
||||
])
|
||||
|
||||
draftCut000 = subtract(extrude000, tools = draftCut000Extrude)
|
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 174 KiB |
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 194 KiB |
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 194 KiB |
Before Width: | Height: | Size: 187 KiB After Width: | Height: | Size: 174 KiB |
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 174 KiB |
@ -1,210 +0,0 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Artifact commands revolve-colinear.kcl
|
||||
---
|
||||
[
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "edge_lines_visible",
|
||||
"hidden": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "object_visible",
|
||||
"object_id": "[uuid]",
|
||||
"hidden": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "object_visible",
|
||||
"object_id": "[uuid]",
|
||||
"hidden": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "make_plane",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"x_axis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"y_axis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"size": 60.0,
|
||||
"clobber": false,
|
||||
"hide": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "enable_sketch_mode",
|
||||
"entity_id": "[uuid]",
|
||||
"ortho": false,
|
||||
"animated": false,
|
||||
"adjust_camera": false,
|
||||
"planar_normal": {
|
||||
"x": 0.0,
|
||||
"y": -1.0,
|
||||
"z": 0.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "move_path_pen",
|
||||
"path": "[uuid]",
|
||||
"to": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "sketch_mode_disable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "start_path"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "extend_path",
|
||||
"path": "[uuid]",
|
||||
"segment": {
|
||||
"type": "line",
|
||||
"end": {
|
||||
"x": 0.0,
|
||||
"y": 2.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"relative": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "extend_path",
|
||||
"path": "[uuid]",
|
||||
"segment": {
|
||||
"type": "line",
|
||||
"end": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"relative": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "extend_path",
|
||||
"path": "[uuid]",
|
||||
"segment": {
|
||||
"type": "line",
|
||||
"end": {
|
||||
"x": 0.0,
|
||||
"y": -2.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"relative": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "close_path",
|
||||
"path_id": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "object_bring_to_front",
|
||||
"object_id": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "revolve",
|
||||
"target": "[uuid]",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"axis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"axis_is_2d": true,
|
||||
"angle": {
|
||||
"unit": "degrees",
|
||||
"value": 360.0
|
||||
},
|
||||
"tolerance": 0.0000001,
|
||||
"opposite": "None"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "solid3d_get_adjacency_info",
|
||||
"object_id": "[uuid]",
|
||||
"edge_id": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "solid3d_get_extrusion_face_info",
|
||||
"object_id": "[uuid]",
|
||||
"edge_id": "[uuid]"
|
||||
}
|
||||
}
|
||||
]
|
@ -1,6 +0,0 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Artifact graph flowchart revolve-colinear.kcl
|
||||
extension: md
|
||||
snapshot_kind: binary
|
||||
---
|
@ -1,52 +0,0 @@
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph path2 [Path]
|
||||
2["Path<br>[29, 54, 0]"]
|
||||
%% [ProgramBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
||||
3["Segment<br>[60, 77, 0]"]
|
||||
%% [ProgramBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
|
||||
4["Segment<br>[83, 100, 0]"]
|
||||
%% [ProgramBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
|
||||
5["Segment<br>[106, 124, 0]"]
|
||||
%% [ProgramBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
|
||||
6["Segment<br>[130, 137, 0]"]
|
||||
%% [ProgramBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
|
||||
7[Solid2d]
|
||||
end
|
||||
1["Plane<br>[6, 23, 0]"]
|
||||
%% [ProgramBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
|
||||
8["Sweep Revolve<br>[143, 160, 0]"]
|
||||
%% [ProgramBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
|
||||
9[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
10[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
11[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
12["SweepEdge Adjacent"]
|
||||
13["SweepEdge Adjacent"]
|
||||
1 --- 2
|
||||
2 --- 3
|
||||
2 --- 4
|
||||
2 --- 5
|
||||
2 --- 6
|
||||
2 --- 7
|
||||
2 ---- 8
|
||||
8 <--x 4
|
||||
4 --- 10
|
||||
4 --- 12
|
||||
8 <--x 5
|
||||
5 --- 9
|
||||
5 --- 13
|
||||
8 <--x 6
|
||||
6 --- 11
|
||||
8 --- 9
|
||||
8 --- 10
|
||||
8 --- 11
|
||||
8 --- 12
|
||||
8 --- 13
|
||||
12 <--x 9
|
||||
9 --- 13
|
||||
10 --- 12
|
||||
13 <--x 11
|
||||
```
|
@ -1,372 +0,0 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Result of parsing revolve-colinear.kcl
|
||||
---
|
||||
{
|
||||
"Ok": {
|
||||
"body": [
|
||||
{
|
||||
"commentStart": 0,
|
||||
"declaration": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"id": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "sk0",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"init": {
|
||||
"body": [
|
||||
{
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "startSketchOn",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "XZ",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "at",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"elements": [
|
||||
{
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "0",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 0.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
{
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "0",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 0.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
],
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "ArrayExpression",
|
||||
"type": "ArrayExpression"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "startProfile",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "length",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "2",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 2.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "yLine",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "length",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "1",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 1.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "xLine",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "length",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"argument": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "2",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 2.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"operator": "-",
|
||||
"start": 0,
|
||||
"type": "UnaryExpression",
|
||||
"type": "UnaryExpression"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "yLine",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
},
|
||||
{
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "close",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "axis",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "Y",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "revolve",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
}
|
||||
],
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "PipeExpression",
|
||||
"type": "PipeExpression"
|
||||
},
|
||||
"start": 0,
|
||||
"type": "VariableDeclarator"
|
||||
},
|
||||
"end": 0,
|
||||
"kind": "const",
|
||||
"start": 0,
|
||||
"type": "VariableDeclaration",
|
||||
"type": "VariableDeclaration"
|
||||
}
|
||||
],
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
sk0 = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> yLine(length = 2)
|
||||
|> xLine(length = 1)
|
||||
|> yLine(length = -2)
|
||||
|> close()
|
||||
|> revolve(axis = Y)
|
@ -1,105 +0,0 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Operations executed revolve-colinear.kcl
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Plane",
|
||||
"artifact_id": "[uuid]"
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "KclStdLibCall",
|
||||
"name": "revolve",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
},
|
||||
"labeledArgs": {
|
||||
"axis": {
|
||||
"value": {
|
||||
"type": "Object",
|
||||
"value": {
|
||||
"direction": {
|
||||
"type": "Array",
|
||||
"value": [
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"origin": {
|
||||
"type": "Array",
|
||||
"value": [
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
]
|
@ -1,179 +0,0 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Variables in memory after executing revolve-colinear.kcl
|
||||
---
|
||||
{
|
||||
"sk0": {
|
||||
"type": "Solid",
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"artifactId": "[uuid]",
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": []
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
2.0
|
||||
],
|
||||
"type": "ToPoint",
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": []
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
2.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
1.0,
|
||||
2.0
|
||||
],
|
||||
"type": "ToPoint",
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": []
|
||||
},
|
||||
"from": [
|
||||
1.0,
|
||||
2.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
1.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint",
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": []
|
||||
},
|
||||
"from": [
|
||||
1.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint",
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
}
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"artifactId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
}
|
||||
},
|
||||
"type": "plane",
|
||||
"value": "XZ",
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"units": {
|
||||
"type": "Unknown"
|
||||
}
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0,
|
||||
"units": {
|
||||
"type": "Unknown"
|
||||
}
|
||||
}
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
"artifactId": "[uuid]",
|
||||
"originalId": "[uuid]",
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
}
|
||||
},
|
||||
"height": 0.0,
|
||||
"startCapId": null,
|
||||
"endCapId": null,
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"sectional": false
|
||||
}
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 91 KiB |
@ -1,11 +0,0 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Result of unparsing revolve-colinear.kcl
|
||||
---
|
||||
sk0 = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> yLine(length = 2)
|
||||
|> xLine(length = 1)
|
||||
|> yLine(length = -2)
|
||||
|> close()
|
||||
|> revolve(axis = Y)
|
@ -1,669 +0,0 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Artifact commands subtract_regression07.kcl
|
||||
---
|
||||
[
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "edge_lines_visible",
|
||||
"hidden": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "object_visible",
|
||||
"object_id": "[uuid]",
|
||||
"hidden": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "object_visible",
|
||||
"object_id": "[uuid]",
|
||||
"hidden": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "make_plane",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"x_axis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"y_axis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"size": 60.0,
|
||||
"clobber": false,
|
||||
"hide": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "enable_sketch_mode",
|
||||
"entity_id": "[uuid]",
|
||||
"ortho": false,
|
||||
"animated": false,
|
||||
"adjust_camera": false,
|
||||
"planar_normal": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "move_path_pen",
|
||||
"path": "[uuid]",
|
||||
"to": {
|
||||
"x": 1.8331,
|
||||
"y": 3.175,
|
||||
"z": 0.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "sketch_mode_disable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "start_path"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "extend_path",
|
||||
"path": "[uuid]",
|
||||
"segment": {
|
||||
"type": "line",
|
||||
"end": {
|
||||
"x": -3.6662,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"relative": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "extend_path",
|
||||
"path": "[uuid]",
|
||||
"segment": {
|
||||
"type": "line",
|
||||
"end": {
|
||||
"x": -1.8331,
|
||||
"y": -3.175,
|
||||
"z": 0.0
|
||||
},
|
||||
"relative": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "extend_path",
|
||||
"path": "[uuid]",
|
||||
"segment": {
|
||||
"type": "line",
|
||||
"end": {
|
||||
"x": 1.8331,
|
||||
"y": -3.175,
|
||||
"z": 0.0
|
||||
},
|
||||
"relative": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "extend_path",
|
||||
"path": "[uuid]",
|
||||
"segment": {
|
||||
"type": "line",
|
||||
"end": {
|
||||
"x": 3.6662,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"relative": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "extend_path",
|
||||
"path": "[uuid]",
|
||||
"segment": {
|
||||
"type": "line",
|
||||
"end": {
|
||||
"x": 1.8331,
|
||||
"y": 3.175,
|
||||
"z": 0.0
|
||||
},
|
||||
"relative": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "extend_path",
|
||||
"path": "[uuid]",
|
||||
"segment": {
|
||||
"type": "line",
|
||||
"end": {
|
||||
"x": -1.8331,
|
||||
"y": 3.175,
|
||||
"z": 0.0
|
||||
},
|
||||
"relative": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "close_path",
|
||||
"path_id": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "close_path",
|
||||
"path_id": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "enable_sketch_mode",
|
||||
"entity_id": "[uuid]",
|
||||
"ortho": false,
|
||||
"animated": false,
|
||||
"adjust_camera": false,
|
||||
"planar_normal": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "extend_path",
|
||||
"path": "[uuid]",
|
||||
"segment": {
|
||||
"type": "arc",
|
||||
"center": {
|
||||
"x": 0.0,
|
||||
"y": 0.0
|
||||
},
|
||||
"radius": 2.0193,
|
||||
"start": {
|
||||
"unit": "degrees",
|
||||
"value": 0.0
|
||||
},
|
||||
"end": {
|
||||
"unit": "degrees",
|
||||
"value": 360.0
|
||||
},
|
||||
"relative": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "move_path_pen",
|
||||
"path": "[uuid]",
|
||||
"to": {
|
||||
"x": 2.0193,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "sketch_mode_disable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "start_path"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "object_visible",
|
||||
"object_id": "[uuid]",
|
||||
"hidden": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "solid2d_add_hole",
|
||||
"object_id": "[uuid]",
|
||||
"hole_id": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "enable_sketch_mode",
|
||||
"entity_id": "[uuid]",
|
||||
"ortho": false,
|
||||
"animated": false,
|
||||
"adjust_camera": false,
|
||||
"planar_normal": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "extrude",
|
||||
"target": "[uuid]",
|
||||
"distance": 4.762499999999999,
|
||||
"faces": null,
|
||||
"opposite": {
|
||||
"Other": 4.762499999999999
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "object_bring_to_front",
|
||||
"object_id": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "sketch_mode_disable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "solid3d_get_adjacency_info",
|
||||
"object_id": "[uuid]",
|
||||
"edge_id": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "solid3d_get_extrusion_face_info",
|
||||
"object_id": "[uuid]",
|
||||
"edge_id": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "make_plane",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 6.35
|
||||
},
|
||||
"x_axis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"y_axis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"size": 100.0,
|
||||
"clobber": false,
|
||||
"hide": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "plane_set_color",
|
||||
"plane_id": "[uuid]",
|
||||
"color": {
|
||||
"r": 0.6,
|
||||
"g": 0.6,
|
||||
"b": 0.6,
|
||||
"a": 0.3
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "close_path",
|
||||
"path_id": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "enable_sketch_mode",
|
||||
"entity_id": "[uuid]",
|
||||
"ortho": false,
|
||||
"animated": false,
|
||||
"adjust_camera": false,
|
||||
"planar_normal": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "extend_path",
|
||||
"path": "[uuid]",
|
||||
"segment": {
|
||||
"type": "arc",
|
||||
"center": {
|
||||
"x": 0.0,
|
||||
"y": 0.0
|
||||
},
|
||||
"radius": 2.4003,
|
||||
"start": {
|
||||
"unit": "degrees",
|
||||
"value": 0.0
|
||||
},
|
||||
"end": {
|
||||
"unit": "degrees",
|
||||
"value": 360.0
|
||||
},
|
||||
"relative": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "move_path_pen",
|
||||
"path": "[uuid]",
|
||||
"to": {
|
||||
"x": 2.4003,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "object_visible",
|
||||
"object_id": "[uuid]",
|
||||
"hidden": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "sketch_mode_disable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "start_path"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "make_plane",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 2.54
|
||||
},
|
||||
"x_axis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"y_axis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"size": 100.0,
|
||||
"clobber": false,
|
||||
"hide": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "plane_set_color",
|
||||
"plane_id": "[uuid]",
|
||||
"color": {
|
||||
"r": 0.6,
|
||||
"g": 0.6,
|
||||
"b": 0.6,
|
||||
"a": 0.3
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "close_path",
|
||||
"path_id": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "enable_sketch_mode",
|
||||
"entity_id": "[uuid]",
|
||||
"ortho": false,
|
||||
"animated": false,
|
||||
"adjust_camera": false,
|
||||
"planar_normal": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "extend_path",
|
||||
"path": "[uuid]",
|
||||
"segment": {
|
||||
"type": "arc",
|
||||
"center": {
|
||||
"x": 0.0,
|
||||
"y": 0.0
|
||||
},
|
||||
"radius": 2.032,
|
||||
"start": {
|
||||
"unit": "degrees",
|
||||
"value": 0.0
|
||||
},
|
||||
"end": {
|
||||
"unit": "degrees",
|
||||
"value": 360.0
|
||||
},
|
||||
"relative": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "move_path_pen",
|
||||
"path": "[uuid]",
|
||||
"to": {
|
||||
"x": 2.032,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "object_visible",
|
||||
"object_id": "[uuid]",
|
||||
"hidden": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "sketch_mode_disable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "start_path"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "loft",
|
||||
"section_ids": [
|
||||
"[uuid]",
|
||||
"[uuid]"
|
||||
],
|
||||
"v_degree": 2,
|
||||
"bez_approximate_rational": false,
|
||||
"base_curve_index": null,
|
||||
"tolerance": 0.0000001
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "object_bring_to_front",
|
||||
"object_id": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "solid3d_get_adjacency_info",
|
||||
"object_id": "[uuid]",
|
||||
"edge_id": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "solid3d_get_extrusion_face_info",
|
||||
"object_id": "[uuid]",
|
||||
"edge_id": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "boolean_subtract",
|
||||
"target_ids": [
|
||||
"[uuid]"
|
||||
],
|
||||
"tool_ids": [
|
||||
"[uuid]"
|
||||
],
|
||||
"tolerance": 0.0000001
|
||||
}
|
||||
}
|
||||
]
|
@ -1,6 +0,0 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Artifact graph flowchart subtract_regression07.kcl
|
||||
extension: md
|
||||
snapshot_kind: binary
|
||||
---
|
@ -1,198 +0,0 @@
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph path6 [Path]
|
||||
6["Path<br>[88, 135, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
|
||||
10["Segment<br>[141, 166, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
||||
11["Segment<br>[172, 203, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
|
||||
12["Segment<br>[209, 239, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
|
||||
13["Segment<br>[245, 269, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
|
||||
14["Segment<br>[275, 304, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
|
||||
15["Segment<br>[310, 340, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
|
||||
16["Segment<br>[346, 353, 0]"]
|
||||
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 7 }]
|
||||
20[Solid2d]
|
||||
end
|
||||
subgraph path7 [Path]
|
||||
7["Path<br>[377, 436, 0]"]
|
||||
%% [ProgramBodyItem { index: 2 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
17["Segment<br>[377, 436, 0]"]
|
||||
%% [ProgramBodyItem { index: 2 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
22[Solid2d]
|
||||
end
|
||||
subgraph path8 [Path]
|
||||
8["Path<br>[706, 765, 0]"]
|
||||
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
19[Solid2d]
|
||||
end
|
||||
subgraph path9 [Path]
|
||||
9["Path<br>[847, 904, 0]"]
|
||||
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
18["Segment<br>[847, 904, 0]"]
|
||||
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
21[Solid2d]
|
||||
end
|
||||
1["Plane<br>[47, 64, 0]"]
|
||||
%% [ProgramBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
2["Plane<br>[651, 681, 0]"]
|
||||
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, CallKwUnlabeledArg]
|
||||
3["Plane<br>[793, 822, 0]"]
|
||||
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, CallKwUnlabeledArg]
|
||||
4["StartSketchOnPlane<br>[779, 823, 0]"]
|
||||
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
5["StartSketchOnPlane<br>[637, 682, 0]"]
|
||||
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
23["Sweep Extrusion<br>[543, 623, 0]"]
|
||||
%% [ProgramBodyItem { index: 4 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
24["Sweep Loft<br>[927, 975, 0]"]
|
||||
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
25["CompositeSolid Subtract<br>[991, 1039, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit]
|
||||
26[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
27[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
28[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
29[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
30[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
31[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
32[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
33["Cap Start"]
|
||||
%% face_code_ref=Missing NodePath
|
||||
34["Cap End"]
|
||||
%% face_code_ref=Missing NodePath
|
||||
35["Cap End"]
|
||||
%% face_code_ref=Missing NodePath
|
||||
36["Cap End"]
|
||||
%% face_code_ref=Missing NodePath
|
||||
37["SweepEdge Opposite"]
|
||||
38["SweepEdge Opposite"]
|
||||
39["SweepEdge Opposite"]
|
||||
40["SweepEdge Opposite"]
|
||||
41["SweepEdge Opposite"]
|
||||
42["SweepEdge Opposite"]
|
||||
43["SweepEdge Opposite"]
|
||||
44["SweepEdge Adjacent"]
|
||||
45["SweepEdge Adjacent"]
|
||||
46["SweepEdge Adjacent"]
|
||||
47["SweepEdge Adjacent"]
|
||||
48["SweepEdge Adjacent"]
|
||||
49["SweepEdge Adjacent"]
|
||||
50["SweepEdge Adjacent"]
|
||||
1 --- 6
|
||||
1 --- 7
|
||||
2 <--x 5
|
||||
2 --- 8
|
||||
3 <--x 4
|
||||
3 --- 9
|
||||
6 --- 10
|
||||
6 --- 11
|
||||
6 --- 12
|
||||
6 --- 13
|
||||
6 --- 14
|
||||
6 --- 15
|
||||
6 --- 16
|
||||
6 --- 20
|
||||
6 ---- 23
|
||||
6 --- 25
|
||||
7 --- 17
|
||||
7 --- 22
|
||||
8 --- 19
|
||||
8 x---> 24
|
||||
8 x--> 43
|
||||
9 --- 18
|
||||
9 --- 21
|
||||
9 ---- 24
|
||||
10 --- 31
|
||||
10 x--> 33
|
||||
10 --- 37
|
||||
10 --- 44
|
||||
11 --- 29
|
||||
11 x--> 33
|
||||
11 --- 38
|
||||
11 --- 45
|
||||
12 --- 28
|
||||
12 x--> 33
|
||||
12 --- 39
|
||||
12 --- 46
|
||||
13 --- 30
|
||||
13 x--> 33
|
||||
13 --- 40
|
||||
13 --- 47
|
||||
14 --- 27
|
||||
14 x--> 33
|
||||
14 --- 41
|
||||
14 --- 48
|
||||
15 --- 26
|
||||
15 x--> 33
|
||||
15 --- 42
|
||||
15 --- 49
|
||||
18 --- 32
|
||||
18 x--> 35
|
||||
18 --- 43
|
||||
18 --- 50
|
||||
23 --- 26
|
||||
23 --- 27
|
||||
23 --- 28
|
||||
23 --- 29
|
||||
23 --- 30
|
||||
23 --- 31
|
||||
23 --- 33
|
||||
23 --- 34
|
||||
23 --- 37
|
||||
23 --- 38
|
||||
23 --- 39
|
||||
23 --- 40
|
||||
23 --- 41
|
||||
23 --- 42
|
||||
23 --- 44
|
||||
23 --- 45
|
||||
23 --- 46
|
||||
23 --- 47
|
||||
23 --- 48
|
||||
23 --- 49
|
||||
24 <--x 25
|
||||
24 --- 32
|
||||
24 --- 35
|
||||
24 --- 36
|
||||
24 --- 43
|
||||
24 --- 50
|
||||
26 --- 42
|
||||
48 <--x 26
|
||||
26 --- 49
|
||||
27 --- 41
|
||||
47 <--x 27
|
||||
27 --- 48
|
||||
28 --- 39
|
||||
45 <--x 28
|
||||
28 --- 46
|
||||
29 --- 38
|
||||
44 <--x 29
|
||||
29 --- 45
|
||||
30 --- 40
|
||||
46 <--x 30
|
||||
30 --- 47
|
||||
31 --- 37
|
||||
31 --- 44
|
||||
49 <--x 31
|
||||
32 --- 43
|
||||
32 --- 50
|
||||
37 <--x 34
|
||||
38 <--x 34
|
||||
39 <--x 34
|
||||
40 <--x 34
|
||||
41 <--x 34
|
||||
42 <--x 34
|
||||
43 <--x 36
|
||||
```
|
@ -1,43 +0,0 @@
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
sketch000 = startSketchOn(XY)
|
||||
|
||||
sketch000Profile000 = startProfile(sketch000, at = [0.072169, 0.125])
|
||||
|> xLine(length = -0.144338)
|
||||
|> line(end = [-0.072169, -0.125])
|
||||
|> line(end = [0.072169, -0.125])
|
||||
|> xLine(length = 0.144338)
|
||||
|> line(end = [0.072169, 0.125])
|
||||
|> line(end = [-0.072169, 0.125])
|
||||
|> close()
|
||||
|
||||
sketch000Profile001 = circle(
|
||||
sketch000,
|
||||
center = [0, 0],
|
||||
radius = 0.0795
|
||||
)
|
||||
|
||||
sketch000Profile000Holes = sketch000Profile000
|
||||
|> subtract2d(tool = sketch000Profile001)
|
||||
|
||||
extrude000 = extrude(sketch000Profile000Holes, length = 0.1875, bidirectionalLength = 0.1875)
|
||||
|
||||
sketch001 = startSketchOn(offsetPlane(XY, offset = 0.25))
|
||||
|
||||
sketch001Profile000 = circle(
|
||||
sketch001,
|
||||
center = [0, 0],
|
||||
radius = 0.0945
|
||||
)
|
||||
|
||||
sketch002 = startSketchOn(offsetPlane(XY, offset = 0.1))
|
||||
|
||||
sketch002Profile000 = circle(
|
||||
sketch002,
|
||||
center = [0, 0],
|
||||
radius = 0.08
|
||||
)
|
||||
|
||||
draftCut000Extrude = loft([sketch002Profile000, sketch001Profile000])
|
||||
|
||||
draftCut000 = subtract(extrude000, tools = draftCut000Extrude)
|
@ -1,229 +0,0 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Operations executed subtract_regression07.kcl
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Plane",
|
||||
"artifact_id": "[uuid]"
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"tool": {
|
||||
"value": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
"name": "subtract2d",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"bidirectionalLength": {
|
||||
"value": {
|
||||
"type": "Number",
|
||||
"value": 0.1875,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Inches"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
},
|
||||
"length": {
|
||||
"value": {
|
||||
"type": "Number",
|
||||
"value": 0.1875,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Inches"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"labeledArgs": {},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Plane",
|
||||
"artifact_id": "[uuid]"
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "KclStdLibCall",
|
||||
"name": "offsetPlane",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Plane",
|
||||
"artifact_id": "[uuid]"
|
||||
},
|
||||
"sourceRange": []
|
||||
},
|
||||
"labeledArgs": {
|
||||
"offset": {
|
||||
"value": {
|
||||
"type": "Number",
|
||||
"value": 0.25,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Inches"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
},
|
||||
{
|
||||
"labeledArgs": {},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Plane",
|
||||
"artifact_id": "[uuid]"
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "KclStdLibCall",
|
||||
"name": "offsetPlane",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Plane",
|
||||
"artifact_id": "[uuid]"
|
||||
},
|
||||
"sourceRange": []
|
||||
},
|
||||
"labeledArgs": {
|
||||
"offset": {
|
||||
"value": {
|
||||
"type": "Number",
|
||||
"value": 0.1,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Inches"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
},
|
||||
{
|
||||
"labeledArgs": {},
|
||||
"name": "loft",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Array",
|
||||
"value": [
|
||||
{
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"tools": {
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
},
|
||||
"name": "subtract",
|
||||
"sourceRange": [],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"value": {
|
||||
"artifactId": "[uuid]"
|
||||
}
|
||||
},
|
||||
"sourceRange": []
|
||||
}
|
||||
}
|
||||
]
|