Compare commits
	
		
			162 Commits
		
	
	
		
			v0.15.0
			...
			lee/native
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 8b0510a244 | |||
| 5c6483ae67 | |||
| 7700d01403 | |||
| b212ff4470 | |||
| f40cdabfdf | |||
| 13cd3e179b | |||
| a2176d9a1b | |||
| fab5c47978 | |||
| 61d7950ca3 | |||
| 0579ccd53b | |||
| cede44aacf | |||
| e8149fca97 | |||
| c571b15318 | |||
| d3d2612a3b | |||
| 17b7c687d4 | |||
| 5d7d15a385 | |||
| 4be9f70965 | |||
| a60bdd4cc3 | |||
| 6bab45a56a | |||
| 2d979b56f5 | |||
| dfc51e6c30 | |||
| 7e40464d10 | |||
| 83fcdd52a2 | |||
| 8a30d5ec8f | |||
| 637c4a7d97 | |||
| 604446dba3 | |||
| ed3952900b | |||
| f934a17417 | |||
| 59fa7b13a5 | |||
| 8b2bf00641 | |||
| 73b7d3cc9d | |||
| 82fb227868 | |||
| db5657a298 | |||
| cd158f8db0 | |||
| 0342d1a5b4 | |||
| cad64fb780 | |||
| fbc458b6e6 | |||
| dd852c2652 | |||
| 3395f34552 | |||
| 4ac40d5a78 | |||
| 8ccbb3a419 | |||
| 77e9a35c4d | |||
| 0d1852bbc3 | |||
| ff9229f55a | |||
| 5a7f12a06d | |||
| 06f1257071 | |||
| 328e7faea9 | |||
| 5792d3eb2b | |||
| 15effddf6c | |||
| 5354ce140a | |||
| a994338541 | |||
| 6c22154df1 | |||
| 4c18255b70 | |||
| 42b247bc99 | |||
| 7d7b176bb7 | |||
| 9aada41a0d | |||
| 23971465ce | |||
| 23e294930b | |||
| 22cc4c9a98 | |||
| fe6478f568 | |||
| 1989734c3b | |||
| f36984f52a | |||
| 5437538892 | |||
| 97bd60ae87 | |||
| 9116d79c50 | |||
| b3b5dff60f | |||
| 55f842d3bd | |||
| 778478757e | |||
| bc303fbaab | |||
| d422f09045 | |||
| adcf80331a | |||
| 4fbd7ace98 | |||
| 0df858b9ca | |||
| c6f080c440 | |||
| c1a14a107a | |||
| 3c721f2b29 | |||
| 61e2a1eddc | |||
| 6406e27794 | |||
| 1e382a76dd | |||
| 06cdaa9ae8 | |||
| 85c30be333 | |||
| 4d4a1d66e8 | |||
| 223b5952aa | |||
| fedffbb384 | |||
| ed4e3df3b2 | |||
| 18d200e790 | |||
| 0c50a5996d | |||
| 73bca2dcfc | |||
| c6a50a3cdf | |||
| b81c9d04cc | |||
| 9d8a7064da | |||
| b0e6140e9f | |||
| f9df7ff885 | |||
| aec9637d7a | |||
| e4c5fad8c7 | |||
| cc0d601294 | |||
| 69cefafc19 | |||
| b187ca3422 | |||
| 1edadcaa0f | |||
| 95c0ded8cf | |||
| 0ebb4e2cad | |||
| f3e0939057 | |||
| f5e233d8a0 | |||
| 1cab3e628f | |||
| 2ca6ba52b6 | |||
| f741ea2e09 | |||
| 9f2a7781fc | |||
| 990f2b4154 | |||
| 0af0f15281 | |||
| b558548b94 | |||
| 29e0f9a270 | |||
| 9385c32cfb | |||
| ce3fb5c353 | |||
| f920490518 | |||
| d681e667ee | |||
| 5c6515a60e | |||
| eb8a33312d | |||
| d351b3bbe4 | |||
| 47d40eb801 | |||
| adc4b6148d | |||
| 27d0d4a28b | |||
| fb609c19ef | |||
| 8666989c85 | |||
| bdf49c2084 | |||
| a06b9d560a | |||
| b81ff66f2b | |||
| c0e6947170 | |||
| 65ebde0b34 | |||
| 0d6618b60a | |||
| f0c44d11b3 | |||
| 44e71cd4bc | |||
| a9f716dad8 | |||
| a2455832e7 | |||
| 8f5034f997 | |||
| af1c2c7ae1 | |||
| ff38ae091e | |||
| 1dd7c95b8c | |||
| 20042ec87c | |||
| fccf3508a7 | |||
| 8dab5527b8 | |||
| f72eb0e8a7 | |||
| 40479d177f | |||
| b88359dee2 | |||
| f4c0347104 | |||
| ad36b5f5fa | |||
| b798cf19d3 | |||
| 7cfa897561 | |||
| 0d8804005a | |||
| cbd26d29fa | |||
| e501a542ac | |||
| 7cb4f4d101 | |||
| 1162f5f4c4 | |||
| 3975e6d8f5 | |||
| d68d7a7e00 | |||
| b135b97de6 | |||
| de5885ce0b | |||
| ad7c544754 | |||
| 4d77875bdc | |||
| 3377923dcb | |||
| c6005660c8 | |||
| 66e62c6037 | |||
| 0a4a517bb4 | 
| @ -3,4 +3,3 @@ VITE_KC_API_BASE_URL=https://api.dev.zoo.dev | |||||||
| VITE_KC_SITE_BASE_URL=https://dev.zoo.dev | VITE_KC_SITE_BASE_URL=https://dev.zoo.dev | ||||||
| VITE_KC_SKIP_AUTH=false | VITE_KC_SKIP_AUTH=false | ||||||
| VITE_KC_CONNECTION_TIMEOUT_MS=5000 | VITE_KC_CONNECTION_TIMEOUT_MS=5000 | ||||||
| VITE_KC_SENTRY_DSN= |  | ||||||
|  | |||||||
| @ -3,4 +3,3 @@ VITE_KC_API_BASE_URL=https://api.zoo.dev | |||||||
| VITE_KC_SITE_BASE_URL=https://zoo.dev | VITE_KC_SITE_BASE_URL=https://zoo.dev | ||||||
| VITE_KC_SKIP_AUTH=false | VITE_KC_SKIP_AUTH=false | ||||||
| VITE_KC_CONNECTION_TIMEOUT_MS=15000 | VITE_KC_CONNECTION_TIMEOUT_MS=15000 | ||||||
| VITE_KC_SENTRY_DSN=https://a814f2f66734989a90367f48feee28ca@o1042111.ingest.sentry.io/4505789425844224 |  | ||||||
|  | |||||||
							
								
								
									
										85
									
								
								.github/ISSUE_TEMPLATE/bug_report.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,85 @@ | |||||||
|  | name: Bug Report | ||||||
|  | description: File a bug report for the Zoo Modeling App | ||||||
|  | title: "[BUG]: " | ||||||
|  | labels: ["bug"] | ||||||
|  | assignees: [] | ||||||
|  | body: | ||||||
|  |   - type: markdown | ||||||
|  |     attributes: | ||||||
|  |       value: "Thank you for taking the time to report a bug. Please provide as much information as possible to help us resolve it." | ||||||
|  |  | ||||||
|  |   - type: textarea | ||||||
|  |     id: describe-bug | ||||||
|  |     attributes: | ||||||
|  |       label: Describe the bug | ||||||
|  |       description: A clear and concise description of what the bug is. | ||||||
|  |       placeholder: "Explain the bug..." | ||||||
|  |     validations: | ||||||
|  |       required: true | ||||||
|  |  | ||||||
|  |   - type: textarea | ||||||
|  |     id: reproduce-bug | ||||||
|  |     attributes: | ||||||
|  |       label: Steps to Reproduce | ||||||
|  |       description: Steps to reproduce the behavior. | ||||||
|  |       placeholder: | | ||||||
|  |         1. Go to '...' | ||||||
|  |         2. Click on '....' | ||||||
|  |         3. Scroll down to '....' | ||||||
|  |         4. See error | ||||||
|  |     validations: | ||||||
|  |       required: true | ||||||
|  |  | ||||||
|  |   - type: textarea | ||||||
|  |     id: expected-behavior | ||||||
|  |     attributes: | ||||||
|  |       label: Expected Behavior | ||||||
|  |       description: Description of what you expected to happen. | ||||||
|  |       placeholder: "I expected that..." | ||||||
|  |     validations: | ||||||
|  |       required: true | ||||||
|  |  | ||||||
|  |   - type: textarea | ||||||
|  |     id: screenshots | ||||||
|  |     attributes: | ||||||
|  |       label: Screenshots and Recordings  | ||||||
|  |       description: If applicable, add screenshots to help explain your problem. Maximum upload size is 10MB. | ||||||
|  |       placeholder: "You can attach images or video recordings here." | ||||||
|  |     validations: | ||||||
|  |       required: false | ||||||
|  |  | ||||||
|  |   - type: input | ||||||
|  |     id: desktop-os | ||||||
|  |     attributes: | ||||||
|  |       label: Desktop OS | ||||||
|  |       description: "Your operating system" | ||||||
|  |       placeholder: "example: Windows 10, MacOS Big Sur" | ||||||
|  |     validations: | ||||||
|  |       required: true | ||||||
|  |  | ||||||
|  |   - type: input | ||||||
|  |     id: browser | ||||||
|  |     attributes: | ||||||
|  |       label: Browser | ||||||
|  |       description: "If you are using the web version, please specify the browser you are using." | ||||||
|  |       placeholder: "example: Chrome, Safari" | ||||||
|  |     validations: | ||||||
|  |       required: false | ||||||
|  |  | ||||||
|  |   - type: input | ||||||
|  |     id: version | ||||||
|  |     attributes: | ||||||
|  |       label: Version | ||||||
|  |       description: "The version of the Zoo Modeling App you're using." | ||||||
|  |       placeholder: "example: v0.15.0. You can find this in the settings." | ||||||
|  |     validations: | ||||||
|  |       required: true | ||||||
|  |  | ||||||
|  |   - type: textarea | ||||||
|  |     id: additional-context | ||||||
|  |     attributes: | ||||||
|  |       label: Additional Context | ||||||
|  |       description: Add any other context about the problem here. | ||||||
|  |       placeholder: "Anything else you want to add..." | ||||||
|  |     validations: | ||||||
|  |       required: false | ||||||
							
								
								
									
										29
									
								
								.github/workflows/announce_release.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						| @ -1,29 +0,0 @@ | |||||||
| name: Announce Release |  | ||||||
|  |  | ||||||
| on: |  | ||||||
|   release: |  | ||||||
|     types: [published] |  | ||||||
|  |  | ||||||
| jobs: |  | ||||||
|   announce_release: |  | ||||||
|     runs-on: ubuntu-latest |  | ||||||
|     steps: |  | ||||||
|     - name: Check out code |  | ||||||
|       uses: actions/checkout@v4 |  | ||||||
|  |  | ||||||
|     - name: Set up Python |  | ||||||
|       uses: actions/setup-python@v5 |  | ||||||
|       with: |  | ||||||
|         python-version: '3.x' |  | ||||||
|  |  | ||||||
|     - name: Install dependencies |  | ||||||
|       run: | |  | ||||||
|         python -m pip install --upgrade pip |  | ||||||
|         pip install requests |  | ||||||
|  |  | ||||||
|     - name: Announce Release |  | ||||||
|       env: |  | ||||||
|         DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} |  | ||||||
|         RELEASE_VERSION: ${{ github.event.release.tag_name }} |  | ||||||
|         RELEASE_BODY: ${{ github.event.release.body}} |  | ||||||
|       run: python public/announce_release.py |  | ||||||
							
								
								
									
										31
									
								
								.github/workflows/cargo-test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						| @ -3,14 +3,15 @@ on: | |||||||
|     branches: |     branches: | ||||||
|       - main |       - main | ||||||
|     paths: |     paths: | ||||||
|       - '**.rs' |       - src/wasm-lib/**.rs' | ||||||
|       - '**/Cargo.toml' |       - '**/Cargo.toml' | ||||||
|       - '**/Cargo.lock' |       - '**/Cargo.lock' | ||||||
|       - '**/rust-toolchain.toml' |       - '**/rust-toolchain.toml' | ||||||
|       - .github/workflows/cargo-test.yml |       - .github/workflows/cargo-test.yml | ||||||
|  |  | ||||||
|   pull_request: |   pull_request: | ||||||
|     paths: |     paths: | ||||||
|       - '**.rs' |       - src/wasm-lib/**.rs' | ||||||
|       - '**/Cargo.toml' |       - '**/Cargo.toml' | ||||||
|       - '**/Cargo.lock' |       - '**/Cargo.lock' | ||||||
|       - '**/rust-toolchain.toml' |       - '**/rust-toolchain.toml' | ||||||
| @ -20,7 +21,7 @@ permissions: read-all | |||||||
| concurrency: | concurrency: | ||||||
|   group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |   group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||||||
|   cancel-in-progress: true |   cancel-in-progress: true | ||||||
| name: cargo test | name: cargo test of wasm-lib | ||||||
| jobs: | jobs: | ||||||
|   cargotest: |   cargotest: | ||||||
|     name: cargo test |     name: cargo test | ||||||
| @ -40,6 +41,20 @@ jobs: | |||||||
|         run: | |         run: | | ||||||
|           sudo apt-get update |           sudo apt-get update | ||||||
|           sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf |           sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf | ||||||
|  |       - name: Install vector | ||||||
|  |         run: | | ||||||
|  |           curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev > /tmp/vector.sh | ||||||
|  |           chmod +x /tmp/vector.sh | ||||||
|  |           /tmp/vector.sh -y -no-modify-path | ||||||
|  |           mkdir -p /tmp/vector | ||||||
|  |           cp .github/workflows/vector.toml /tmp/vector.toml | ||||||
|  |           sed -i "s#GITHUB_WORKFLOW#${GITHUB_WORKFLOW}#g" /tmp/vector.toml | ||||||
|  |           sed -i "s#GITHUB_REPOSITORY#${GITHUB_REPOSITORY}#g" /tmp/vector.toml | ||||||
|  |           sed -i "s#GITHUB_SHA#${GITHUB_SHA}#g" /tmp/vector.toml | ||||||
|  |           sed -i "s#GITHUB_REF_NAME#${GITHUB_REF_NAME}#g" /tmp/vector.toml | ||||||
|  |           sed -i "s#GH_ACTIONS_AXIOM_TOKEN#${{secrets.GH_ACTIONS_AXIOM_TOKEN}}#g" /tmp/vector.toml | ||||||
|  |           cat /tmp/vector.toml | ||||||
|  |           ${HOME}/.vector/bin/vector --config /tmp/vector.toml & | ||||||
|       - uses: taiki-e/install-action@cargo-llvm-cov |       - uses: taiki-e/install-action@cargo-llvm-cov | ||||||
|       - uses: taiki-e/install-action@nextest |       - uses: taiki-e/install-action@nextest | ||||||
|       - name: Rust Cache |       - name: Rust Cache | ||||||
| @ -48,8 +63,16 @@ jobs: | |||||||
|         shell: bash |         shell: bash | ||||||
|         run: |- |         run: |- | ||||||
|           cd "${{ matrix.dir }}" |           cd "${{ matrix.dir }}" | ||||||
|           cargo nextest run --workspace --no-fail-fast -P ci |           cargo llvm-cov nextest --all --lcov --output-path lcov.info --test-threads=1 --no-fail-fast -P ci 2>&1 | tee /tmp/github-actions.log | ||||||
|         env: |         env: | ||||||
|           KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}} |           KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}} | ||||||
|           RUST_MIN_STACK: 10485760000 |           RUST_MIN_STACK: 10485760000 | ||||||
|  |       - name: Upload to codecov.io | ||||||
|  |         uses: codecov/codecov-action@v4 | ||||||
|  |         with: | ||||||
|  |           token: ${{secrets.CODECOV_TOKEN}} | ||||||
|  |           fail_ci_if_error: true | ||||||
|  |           flags: wasm-lib | ||||||
|  |           verbose: true | ||||||
|  |           files: lcov.info | ||||||
|  |  | ||||||
|  | |||||||
							
								
								
									
										31
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						| @ -86,8 +86,6 @@ jobs: | |||||||
|  |  | ||||||
|       - run: yarn test:nowatch |       - run: yarn test:nowatch | ||||||
|  |  | ||||||
|       - run: yarn test:cov |  | ||||||
|  |  | ||||||
|  |  | ||||||
|   prepare-json-files: |   prepare-json-files: | ||||||
|     runs-on: ubuntu-latest  # seperate job on Ubuntu for easy string manipulations (compared to Windows) |     runs-on: ubuntu-latest  # seperate job on Ubuntu for easy string manipulations (compared to Windows) | ||||||
| @ -338,7 +336,7 @@ jobs: | |||||||
|             cat last_download.json |             cat last_download.json | ||||||
|  |  | ||||||
|       - name: Authenticate to Google Cloud |       - name: Authenticate to Google Cloud | ||||||
|         uses: 'google-github-actions/auth@v2.1.1' |         uses: 'google-github-actions/auth@v2.1.2' | ||||||
|         with: |         with: | ||||||
|           credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}' |           credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}' | ||||||
|  |  | ||||||
| @ -369,6 +367,31 @@ jobs: | |||||||
|  |  | ||||||
|       - name: Upload release files to Github |       - name: Upload release files to Github | ||||||
|         if: ${{ github.event_name == 'release' }} |         if: ${{ github.event_name == 'release' }} | ||||||
|         uses: softprops/action-gh-release@v1 |         uses: softprops/action-gh-release@v2 | ||||||
|         with: |         with: | ||||||
|           files: 'artifact/*/Zoo*' |           files: 'artifact/*/Zoo*' | ||||||
|  |            | ||||||
|  |   announce_release: | ||||||
|  |     needs: [publish-apps-release] | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     if: github.event_name == 'release' | ||||||
|  |     steps: | ||||||
|  |       - name: Check out code | ||||||
|  |         uses: actions/checkout@v4 | ||||||
|  |            | ||||||
|  |       - name: Set up Python | ||||||
|  |         uses: actions/setup-python@v5 | ||||||
|  |         with: | ||||||
|  |           python-version: '3.x' | ||||||
|  |    | ||||||
|  |       - name: Install dependencies | ||||||
|  |         run: | | ||||||
|  |           python -m pip install --upgrade pip | ||||||
|  |           pip install requests | ||||||
|  |    | ||||||
|  |       - name: Announce Release | ||||||
|  |         env: | ||||||
|  |           DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | ||||||
|  |           RELEASE_VERSION: ${{ github.event.release.tag_name }} | ||||||
|  |           RELEASE_BODY: ${{ github.event.release.body}} | ||||||
|  |         run: python public/announce_release.py | ||||||
|  | |||||||
							
								
								
									
										62
									
								
								.github/workflows/generate-website-docs.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,62 @@ | |||||||
|  | on: | ||||||
|  |   push: | ||||||
|  |     branches: | ||||||
|  |       - main | ||||||
|  |     paths: | ||||||
|  |       - .github/workflows/generate-website-docs.yml | ||||||
|  |       - 'docs/**' | ||||||
|  |   pull_request: | ||||||
|  |     paths: | ||||||
|  |       - .github/workflows/generate-website-docs.yml | ||||||
|  |   workflow_dispatch: | ||||||
|  | name: generate-website-docs | ||||||
|  | concurrency: | ||||||
|  |   group: docs-${{ github.ref }} | ||||||
|  |   cancel-in-progress: true | ||||||
|  | jobs: | ||||||
|  |   generate-website-docs: | ||||||
|  |     name: generate-website-docs  | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     steps: | ||||||
|  |       - uses: actions/checkout@v4 | ||||||
|  |       - uses: actions/create-github-app-token@v1 | ||||||
|  |         id: app-token | ||||||
|  |         with: | ||||||
|  |           # required | ||||||
|  |           app-id: ${{ secrets.GH_ORG_APP_ID }} | ||||||
|  |           private-key: ${{ secrets.GH_ORG_APP_PRIVATE_KEY }} | ||||||
|  |           owner: ${{ github.repository_owner }} | ||||||
|  |       # Checkout the docs repo since we will want to update the files there. | ||||||
|  |       - uses: actions/checkout@v4 | ||||||
|  |         with: | ||||||
|  |           repository: 'kittycad/documentation' | ||||||
|  |           path: 'documentation' | ||||||
|  |           token: ${{ steps.app-token.outputs.token }} | ||||||
|  |       - name: move docs to docs | ||||||
|  |         shell: bash | ||||||
|  |         run: | | ||||||
|  |           mkdir -p documentation/content/pages/docs/kcl/ | ||||||
|  |           # cleanup old | ||||||
|  |           rm -rf documentation/content/pages/docs/kcl/*.md | ||||||
|  |           # move new | ||||||
|  |           mv -f docs/kcl/*.md documentation/content/pages/docs/kcl/ | ||||||
|  |       - name: commit the changes in the docs repo | ||||||
|  |         shell: bash | ||||||
|  |         run: | | ||||||
|  |           cd documentation | ||||||
|  |           git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||||||
|  |           git config --local user.name "github-actions[bot]" | ||||||
|  |           git add . | ||||||
|  |           git commit -am "YOYO NEW KCL DOCS!!" || exit 0 | ||||||
|  |           git fetch origin | ||||||
|  |           git rebase origin/main || exit 0 | ||||||
|  |           export NEW_BRANCH="update-kcl-docs" | ||||||
|  |           git checkout -b "$NEW_BRANCH" | ||||||
|  |           git push -f origin "$NEW_BRANCH" | ||||||
|  |           gh pr create --title "Update KCL docs" \ | ||||||
|  |               --body "Updating the generated kcl docs cc @jessfraz @franknoirot merge this" \ | ||||||
|  |               --head "$NEW_BRANCH" \ | ||||||
|  |               --base main || true | ||||||
|  |         env: | ||||||
|  |           GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | ||||||
|  |  | ||||||
							
								
								
									
										12
									
								
								.github/workflows/playwright.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						| @ -4,17 +4,22 @@ on: | |||||||
|     branches: [ main ] |     branches: [ main ] | ||||||
|   pull_request: |   pull_request: | ||||||
|     branches: [ main ] |     branches: [ main ] | ||||||
|  |  | ||||||
|  | concurrency: | ||||||
|  |   group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||||||
|  |   cancel-in-progress: true | ||||||
|  |  | ||||||
| jobs: | jobs: | ||||||
|   playwright-ubuntu: |   playwright-ubuntu: | ||||||
|     timeout-minutes: 60 |     timeout-minutes: 60 | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest-8-cores | ||||||
|     steps: |     steps: | ||||||
|     - uses: actions/checkout@v4 |     - uses: actions/checkout@v4 | ||||||
|     - uses: actions/setup-node@v4 |     - uses: actions/setup-node@v4 | ||||||
|       with: |       with: | ||||||
|         node-version-file: '.nvmrc' |         node-version-file: '.nvmrc' | ||||||
|         cache: 'yarn' |         cache: 'yarn' | ||||||
|     - uses: KittyCAD/action-install-cli@v0.2.16 |     - uses: KittyCAD/action-install-cli@main | ||||||
|     - name: Install dependencies |     - name: Install dependencies | ||||||
|       run: yarn |       run: yarn | ||||||
|     - name: Install Playwright Browsers |     - name: Install Playwright Browsers | ||||||
| @ -79,8 +84,7 @@ jobs: | |||||||
|  |  | ||||||
|   playwright-macos: |   playwright-macos: | ||||||
|     timeout-minutes: 60 |     timeout-minutes: 60 | ||||||
|     runs-on: macos-latest |     runs-on: macos-14 | ||||||
|     needs: playwright-ubuntu |  | ||||||
|     steps: |     steps: | ||||||
|     - uses: actions/checkout@v4 |     - uses: actions/checkout@v4 | ||||||
|     - uses: actions/setup-node@v4 |     - uses: actions/setup-node@v4 | ||||||
|  | |||||||
							
								
								
									
										21
									
								
								.github/workflows/vector.toml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,21 @@ | |||||||
|  | [sources.github-actions-file] | ||||||
|  | type = "file" | ||||||
|  | data_dir = "/tmp/vector" | ||||||
|  | include = ["/tmp/github-actions.log"] | ||||||
|  |  | ||||||
|  | # Modify the logs to include the action name. | ||||||
|  | [transforms.add-action-name] | ||||||
|  | type = "remap" | ||||||
|  | inputs = [ "github-actions-file" ] | ||||||
|  | source = ''' | ||||||
|  | .action = "GITHUB_WORKFLOW" | ||||||
|  | .repo = "GITHUB_REPOSITORY" | ||||||
|  | .sha = "GITHUB_SHA" | ||||||
|  | .ref = "GITHUB_REF_NAME" | ||||||
|  | ''' | ||||||
|  |  | ||||||
|  | [sinks.axiom] | ||||||
|  | type = "axiom" | ||||||
|  | inputs = ["add-action-name"] | ||||||
|  | token = "GH_ACTIONS_AXIOM_TOKEN" | ||||||
|  | dataset = "github-actions" | ||||||
							
								
								
									
										13
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						| @ -33,17 +33,14 @@ src/wasm-lib/bindings | |||||||
| src/wasm-lib/kcl/bindings | src/wasm-lib/kcl/bindings | ||||||
| public/wasm_lib_bg.wasm | public/wasm_lib_bg.wasm | ||||||
| src/wasm-lib/lcov.info | src/wasm-lib/lcov.info | ||||||
|  | src/wasm-lib/grackle/test_json_output | ||||||
|  |  | ||||||
| e2e/playwright/playwright-secrets.env | e2e/playwright/playwright-secrets.env | ||||||
| e2e/playwright/temp1.png | e2e/playwright/temp1.png | ||||||
| e2e/playwright/temp2.png | e2e/playwright/temp2.png | ||||||
| # exports from snapshot-tests.spec.ts | # exports from snapshot-tests.spec.ts "exports of each format should work" | ||||||
| e2e/playwright/export-snapshots/*.ply | e2e/playwright/export-snapshots/* | ||||||
| e2e/playwright/export-snapshots/*.obj | !e2e/playwright/export-snapshots/*.png | ||||||
| e2e/playwright/export-snapshots/*.step |  | ||||||
| e2e/playwright/export-snapshots/*.stl |  | ||||||
| e2e/playwright/export-snapshots/*binary.gltf |  | ||||||
| e2e/playwright/export-snapshots/*embedded.gltf |  | ||||||
|  |  | ||||||
|  |  | ||||||
| /test-results/ | /test-results/ | ||||||
| @ -54,3 +51,5 @@ e2e/playwright/export-snapshots/*embedded.gltf | |||||||
|  |  | ||||||
| ## generated files | ## generated files | ||||||
| src/**/*.typegen.ts | src/**/*.typegen.ts | ||||||
|  |  | ||||||
|  | src/wasm-lib/grackle/stdlib_cube_partial.json | ||||||
|  | |||||||
| @ -136,7 +136,12 @@ Before you submit a contribution PR to this repo, please ensure that: | |||||||
| VERSION=x.y.z yarn run bump-jsons | VERSION=x.y.z yarn run bump-jsons | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| The PR may serve as a place to discuss the human-readable changelog and extra QA. A quick way of getting PR's merged since the last bump is to [use this PR filter](https://github.com/KittyCAD/modeling-app/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Amerged+), open up the browser console and past in the following | Alternatively you can try the experimental `make-release.sh` bash script that will create the branch with the updated json files for you. | ||||||
|  | run `./make-release.sh` for a patch update | ||||||
|  | run `./make-release.sh "minor"` for minor | ||||||
|  | run `./make-release.sh "major"` for major | ||||||
|  |  | ||||||
|  | The PR may serve as a place to discuss the human-readable changelog and extra QA. A quick way of getting PR's merged since the last bump is to [use this PR filter](https://github.com/KittyCAD/modeling-app/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Amerged+), open up the browser console and paste in the following | ||||||
|  |  | ||||||
| ```typescript | ```typescript | ||||||
| console.log( | console.log( | ||||||
|  | |||||||
| @ -1,4 +1,8 @@ | |||||||
| # Known Issues | --- | ||||||
|  | title: "KCL Known Issues" | ||||||
|  | excerpt: "Known issues with the KCL standard library for the Zoo Modeling App." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
| The following are bugs that are not in modeling-app or kcl itself. These bugs | The following are bugs that are not in modeling-app or kcl itself. These bugs | ||||||
| once fixed in engine will just start working here with no language changes. | once fixed in engine will just start working here with no language changes. | ||||||
| @ -6,11 +10,11 @@ once fixed in engine will just start working here with no language changes. | |||||||
| - **Sketch on Face**: If your sketch is outside the edges of the face (on which you | - **Sketch on Face**: If your sketch is outside the edges of the face (on which you | ||||||
|     are sketching) you will get multiple models returned instead of one single |     are sketching) you will get multiple models returned instead of one single | ||||||
|     model for that sketch and its underlying 3D object. |     model for that sketch and its underlying 3D object. | ||||||
|  |     If you see a red line around your model, it means this is happening. | ||||||
|  |  | ||||||
| - **Patterns**: If you try and pass a pattern to `hole` currently only the first |  | ||||||
|     item in the pattern is being subtracted. This is an engine bug that is being |  | ||||||
|     worked on. |  | ||||||
|    |  | ||||||
| - **Import**: Right now you can import a file, even if that file has brep data | - **Import**: Right now you can import a file, even if that file has brep data | ||||||
|     you cannot edit it. You also cannot move or transform the imported objects at |     you cannot edit it, after v1, the engine will account for this. You also cannot | ||||||
|    all. In the future, after v1, the engine will account for this. |     currently move or transform the imported objects at all, once we have assemblies | ||||||
|  |     this will work. | ||||||
|  |  | ||||||
|  | - **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet cases work currently. | ||||||
|  | |||||||
							
								
								
									
										30
									
								
								docs/kcl/abs.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,30 @@ | |||||||
|  | --- | ||||||
|  | title: "abs" | ||||||
|  | excerpt: "Computes the absolute value of a number." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Computes the absolute value of a number. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | abs(num: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = abs(-4) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `num`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										30
									
								
								docs/kcl/acos.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,30 @@ | |||||||
|  | --- | ||||||
|  | title: "acos" | ||||||
|  | excerpt: "Computes the arccosine of a number (in radians)." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Computes the arccosine of a number (in radians). | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | acos(num: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = acos(0.5) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `num`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										202
									
								
								docs/kcl/angleToMatchLengthX.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,202 @@ | |||||||
|  | --- | ||||||
|  | title: "angleToMatchLengthX" | ||||||
|  | excerpt: "Returns the angle to match the given length for x." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Returns the angle to match the given length for x. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | angleToMatchLengthX(segment_name: string, to: number, sketch_group: SketchGroup) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const part001 = startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line({ to: [1, 3.82], tag: 'seg01' }, %) | ||||||
|  |   |> angledLineToX([ | ||||||
|  |        -angleToMatchLengthX('seg01', 10, %), | ||||||
|  |        5 | ||||||
|  |      ], %) | ||||||
|  |   |> close(%) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `segment_name`: `string` (REQUIRED) | ||||||
|  | * `to`: `number` (REQUIRED) | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										202
									
								
								docs/kcl/angleToMatchLengthY.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,202 @@ | |||||||
|  | --- | ||||||
|  | title: "angleToMatchLengthY" | ||||||
|  | excerpt: "Returns the angle to match the given length for y." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Returns the angle to match the given length for y. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | angleToMatchLengthY(segment_name: string, to: number, sketch_group: SketchGroup) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const part001 = startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line({ to: [1, 3.82], tag: 'seg01' }, %) | ||||||
|  |   |> angledLineToX([ | ||||||
|  |        -angleToMatchLengthY('seg01', 10, %), | ||||||
|  |        5 | ||||||
|  |      ], %) | ||||||
|  |   |> close(%) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `segment_name`: `string` (REQUIRED) | ||||||
|  | * `to`: `number` (REQUIRED) | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										374
									
								
								docs/kcl/angledLine.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,374 @@ | |||||||
|  | --- | ||||||
|  | title: "angledLine" | ||||||
|  | excerpt: "Draw an angled line." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Draw an angled line. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | angledLine(data: AngledLineData, sketch_group: SketchGroup) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> angledLine({ angle: 45, length: 10, tag: "edge1" }, %) | ||||||
|  |   |> line([10, 10], %) | ||||||
|  |   |> line([0, 10], %) | ||||||
|  |   |> close(%, "edge2") | ||||||
|  |   |> extrude(10, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The angle of the line. | ||||||
|  | 	angle: number, | ||||||
|  | 	// The length of the line. | ||||||
|  | 	length: number, | ||||||
|  | 	// The tag. | ||||||
|  | 	tag: string, | ||||||
|  | } | | ||||||
|  | [number, number] | ||||||
|  | ``` | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										374
									
								
								docs/kcl/angledLineOfXLength.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,374 @@ | |||||||
|  | --- | ||||||
|  | title: "angledLineOfXLength" | ||||||
|  | excerpt: "Draw an angled line of a given x length." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Draw an angled line of a given x length. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('XZ') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> angledLineOfXLength({ angle: 45, length: 10, tag: "edge1" }, %) | ||||||
|  |   |> line([10, 10], %) | ||||||
|  |   |> line([0, 10], %) | ||||||
|  |   |> close(%, "edge2") | ||||||
|  |   |> extrude(10, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The angle of the line. | ||||||
|  | 	angle: number, | ||||||
|  | 	// The length of the line. | ||||||
|  | 	length: number, | ||||||
|  | 	// The tag. | ||||||
|  | 	tag: string, | ||||||
|  | } | | ||||||
|  | [number, number] | ||||||
|  | ``` | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										375
									
								
								docs/kcl/angledLineOfYLength.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,375 @@ | |||||||
|  | --- | ||||||
|  | title: "angledLineOfYLength" | ||||||
|  | excerpt: "Draw an angled line of a given y length." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Draw an angled line of a given y length. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | angledLineOfYLength(data: AngledLineData, sketch_group: SketchGroup) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('YZ') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> angledLineOfYLength({ angle: 45, length: 10, tag: "edge1" }, %) | ||||||
|  |   |> line([10, 10], %) | ||||||
|  |   |> line([0, 10], %) | ||||||
|  |   |> close(%, "edge2") | ||||||
|  |   |> extrude(10, %) | ||||||
|  |   |> fillet({ radius: 2, tags: ["edge1"] }, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The angle of the line. | ||||||
|  | 	angle: number, | ||||||
|  | 	// The length of the line. | ||||||
|  | 	length: number, | ||||||
|  | 	// The tag. | ||||||
|  | 	tag: string, | ||||||
|  | } | | ||||||
|  | [number, number] | ||||||
|  | ``` | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										381
									
								
								docs/kcl/angledLineThatIntersects.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,381 @@ | |||||||
|  | --- | ||||||
|  | title: "angledLineThatIntersects" | ||||||
|  | excerpt: "Draw an angled line that intersects with a given line." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Draw an angled line that intersects with a given line. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const part001 = startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> lineTo({ to: [2, 2], tag: "yo" }, %) | ||||||
|  |   |> lineTo([3, 1], %) | ||||||
|  |   |> angledLineThatIntersects({ | ||||||
|  |        angle: 180, | ||||||
|  |        intersectTag: 'yo', | ||||||
|  |        offset: 12, | ||||||
|  |        tag: "yo2" | ||||||
|  |      }, %) | ||||||
|  |   |> line([4, 0], %) | ||||||
|  |   |> close(%, "yo3") | ||||||
|  |   |> extrude(10, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `AngledLineThatIntersectsData` - Data for drawing an angled line that intersects with a given line. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The angle of the line. | ||||||
|  | 	angle: number, | ||||||
|  | 	// The tag of the line to intersect with. | ||||||
|  | 	intersectTag: string, | ||||||
|  | 	// The offset from the intersecting line. | ||||||
|  | 	offset: number, | ||||||
|  | 	// The tag. | ||||||
|  | 	tag: string, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										375
									
								
								docs/kcl/angledLineToX.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,375 @@ | |||||||
|  | --- | ||||||
|  | title: "angledLineToX" | ||||||
|  | excerpt: "Draw an angled line to a given x coordinate." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Draw an angled line to a given x coordinate. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | angledLineToX(data: AngledLineToData, sketch_group: SketchGroup) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> angledLineToX({ angle: 45, to: 10, tag: "edge1" }, %) | ||||||
|  |   |> line([10, 10], %) | ||||||
|  |   |> line([0, 10], %) | ||||||
|  |   |> close(%, "edge2") | ||||||
|  |   |> extrude(10, %) | ||||||
|  |   |> fillet({ radius: 2, tags: ["edge1"] }, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `AngledLineToData` - Data to draw an angled line to a point. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The angle of the line. | ||||||
|  | 	angle: number, | ||||||
|  | 	// The tag. | ||||||
|  | 	tag: string, | ||||||
|  | 	// The point to draw to. | ||||||
|  | 	to: number, | ||||||
|  | } | | ||||||
|  | [number, number] | ||||||
|  | ``` | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										374
									
								
								docs/kcl/angledLineToY.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,374 @@ | |||||||
|  | --- | ||||||
|  | title: "angledLineToY" | ||||||
|  | excerpt: "Draw an angled line to a given y coordinate." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Draw an angled line to a given y coordinate. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | angledLineToY(data: AngledLineToData, sketch_group: SketchGroup) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> angledLineToY({ angle: 45, to: 10, tag: "edge1" }, %) | ||||||
|  |   |> line([10, 10], %) | ||||||
|  |   |> line([0, 10], %) | ||||||
|  |   |> close(%, "edge2") | ||||||
|  |   |> extrude(10, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `AngledLineToData` - Data to draw an angled line to a point. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The angle of the line. | ||||||
|  | 	angle: number, | ||||||
|  | 	// The tag. | ||||||
|  | 	tag: string, | ||||||
|  | 	// The point to draw to. | ||||||
|  | 	to: number, | ||||||
|  | } | | ||||||
|  | [number, number] | ||||||
|  | ``` | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										387
									
								
								docs/kcl/arc.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,387 @@ | |||||||
|  | --- | ||||||
|  | title: "arc" | ||||||
|  | excerpt: "Draw an arc." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Draw an arc. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | arc(data: ArcData, sketch_group: SketchGroup) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('-YZ') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> arc({ | ||||||
|  |        angle_start: 0, | ||||||
|  |        angle_end: 360, | ||||||
|  |        radius: 10, | ||||||
|  |        tag: "edge1" | ||||||
|  |      }, %) | ||||||
|  |   |> extrude(10, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `ArcData` - Data to draw an arc. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The end angle. | ||||||
|  | 	angle_end: number, | ||||||
|  | 	// The start angle. | ||||||
|  | 	angle_start: number, | ||||||
|  | 	// The radius. | ||||||
|  | 	radius: number, | ||||||
|  | 	// The tag. | ||||||
|  | 	tag: string, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The center. | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The radius. | ||||||
|  | 	radius: number, | ||||||
|  | 	// The tag. | ||||||
|  | 	tag: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										30
									
								
								docs/kcl/asin.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,30 @@ | |||||||
|  | --- | ||||||
|  | title: "asin" | ||||||
|  | excerpt: "Computes the arcsine of a number (in radians)." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Computes the arcsine of a number (in radians). | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | asin(num: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = asin(0.5) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `num`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										30
									
								
								docs/kcl/atan.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,30 @@ | |||||||
|  | --- | ||||||
|  | title: "atan" | ||||||
|  | excerpt: "Computes the arctangent of a number (in radians)." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Computes the arctangent of a number (in radians). | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | atan(num: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = atan(1.0) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `num`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										378
									
								
								docs/kcl/bezierCurve.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,378 @@ | |||||||
|  | --- | ||||||
|  | title: "bezierCurve" | ||||||
|  | excerpt: "Draw a bezier curve." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Draw a bezier curve. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | bezierCurve(data: BezierData, sketch_group: SketchGroup) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> bezierCurve({ | ||||||
|  |        to: [10, 10], | ||||||
|  |        control1: [5, 0], | ||||||
|  |        control2: [5, 10], | ||||||
|  |        tag: "edge1" | ||||||
|  |      }, %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(10, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `BezierData` - Data to draw a bezier curve. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The first control point. | ||||||
|  | 	control1: [number, number], | ||||||
|  | 	// The second control point. | ||||||
|  | 	control2: [number, number], | ||||||
|  | 	// The tag. | ||||||
|  | 	tag: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										30
									
								
								docs/kcl/ceil.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,30 @@ | |||||||
|  | --- | ||||||
|  | title: "ceil" | ||||||
|  | excerpt: "Computes the smallest integer greater than or equal to a number." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Computes the smallest integer greater than or equal to a number. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | ceil(num: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = ceil(4.5) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `num`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										431
									
								
								docs/kcl/circle.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,431 @@ | |||||||
|  | --- | ||||||
|  | title: "circle" | ||||||
|  | excerpt: "Sketch a circle." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Sketch a circle. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | circle(center: [number], radius: number, tag?: String, sketch_surface_or_group: SketchSurfaceOrGroup) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const circles = startSketchOn('XY') | ||||||
|  |   |> circle([5, 5], 1, %) | ||||||
|  |   |> patternLinear2d({ | ||||||
|  |        axis: [1, 1], | ||||||
|  |        repetitions: 12, | ||||||
|  |        distance: 3 | ||||||
|  |      }, %) | ||||||
|  |  | ||||||
|  | const rectangle = startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line([0, 50], %) | ||||||
|  |   |> line([50, 0], %) | ||||||
|  |   |> line([0, -50], %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> hole(circles, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `center`: `[number]` (REQUIRED) | ||||||
|  | * `radius`: `number` (REQUIRED) | ||||||
|  | * `tag`: `String` (OPTIONAL) | ||||||
|  | * `sketch_surface_or_group`: `SketchSurfaceOrGroup` - A sketch surface or a sketch group. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										369
									
								
								docs/kcl/close.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,369 @@ | |||||||
|  | --- | ||||||
|  | title: "close" | ||||||
|  | excerpt: "Close the current sketch." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Close the current sketch. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | close(sketch_group: SketchGroup, tag?: String) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('XZ') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line([10, 10], %) | ||||||
|  |   |> line([10, 0], %) | ||||||
|  |   |> close(%) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('YZ') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line([10, 10], %) | ||||||
|  |   |> line([10, 0], %) | ||||||
|  |   |> close(%, "edge1") | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  | * `tag`: `String` (OPTIONAL) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										30
									
								
								docs/kcl/cos.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,30 @@ | |||||||
|  | --- | ||||||
|  | title: "cos" | ||||||
|  | excerpt: "Computes the sine of a number (in radians)." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Computes the sine of a number (in radians). | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | cos(num: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const anotherVar = cos(2 * pi()) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `num`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										29
									
								
								docs/kcl/e.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,29 @@ | |||||||
|  | --- | ||||||
|  | title: "e" | ||||||
|  | excerpt: "Return the value of Euler’s number `e`." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Return the value of Euler’s number `e`. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | e() -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = e() | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										330
									
								
								docs/kcl/extrude.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,330 @@ | |||||||
|  | --- | ||||||
|  | title: "extrude" | ||||||
|  | excerpt: "Extrudes by a given amount." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Extrudes by a given amount. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | extrude(length: number, sketch_group: SketchGroup) -> ExtrudeGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line([0, 10], %) | ||||||
|  |   |> line([10, 0], %) | ||||||
|  |   |> line([0, -10], %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(5, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `length`: `number` (REQUIRED) | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The id of the extrusion end cap | ||||||
|  | 	endCapId: uuid, | ||||||
|  | 	// The height of the extrude group. | ||||||
|  | 	height: number, | ||||||
|  | 	// The id of the extrude group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The position of the extrude group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the extrude group. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The sketch group paths. | ||||||
|  | 	sketchGroupValues: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The id of the extrusion start cap | ||||||
|  | 	startCapId: uuid, | ||||||
|  | 	// The extrude surfaces. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudePlane", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudeArc", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the extrude group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the extrude group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the extrude group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										307
									
								
								docs/kcl/fillet.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,307 @@ | |||||||
|  | --- | ||||||
|  | title: "fillet" | ||||||
|  | excerpt: "Create fillets on tagged paths." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Create fillets on tagged paths. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | fillet(data: FilletData, extrude_group: ExtrudeGroup) -> ExtrudeGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const part001 = startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line({ to: [0, 10], tag: "thing" }, %) | ||||||
|  |   |> line([10, 0], %) | ||||||
|  |   |> line({ to: [0, -10], tag: "thing2" }, %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(10, %) | ||||||
|  |   |> fillet({ radius: 2, tags: ["thing", "thing2"] }, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `FilletData` - Data for fillets. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The radius of the fillet. | ||||||
|  | 	radius: number, | ||||||
|  | 	// The tags of the paths you want to fillet. | ||||||
|  | 	tags: [uuid | | ||||||
|  | string], | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  | * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The id of the extrusion end cap | ||||||
|  | 	endCapId: uuid, | ||||||
|  | 	// The height of the extrude group. | ||||||
|  | 	height: number, | ||||||
|  | 	// The id of the extrude group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The position of the extrude group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the extrude group. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The sketch group paths. | ||||||
|  | 	sketchGroupValues: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The id of the extrusion start cap | ||||||
|  | 	startCapId: uuid, | ||||||
|  | 	// The extrude surfaces. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudePlane", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudeArc", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the extrude group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the extrude group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the extrude group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The id of the extrusion end cap | ||||||
|  | 	endCapId: uuid, | ||||||
|  | 	// The height of the extrude group. | ||||||
|  | 	height: number, | ||||||
|  | 	// The id of the extrude group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The position of the extrude group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the extrude group. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The sketch group paths. | ||||||
|  | 	sketchGroupValues: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The id of the extrusion start cap | ||||||
|  | 	startCapId: uuid, | ||||||
|  | 	// The extrude surfaces. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudePlane", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudeArc", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the extrude group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the extrude group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the extrude group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										30
									
								
								docs/kcl/floor.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,30 @@ | |||||||
|  | --- | ||||||
|  | title: "floor" | ||||||
|  | excerpt: "Computes the largest integer less than or equal to a number." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Computes the largest integer less than or equal to a number. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | floor(num: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = floor(4.5) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `num`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										175
									
								
								docs/kcl/getExtrudeWallTransform.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,175 @@ | |||||||
|  | --- | ||||||
|  | title: "getExtrudeWallTransform" | ||||||
|  | excerpt: "Returns the extrude wall transform." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Returns the extrude wall transform. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | getExtrudeWallTransform(surface_name: string, extrude_group: ExtrudeGroup) -> ExtrudeTransform | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const box = startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line([0, 10], %) | ||||||
|  |   |> line([10, 0], %) | ||||||
|  |   |> line({ to: [0, -10], tag: "surface" }, %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(5, %) | ||||||
|  |  | ||||||
|  | const transform = getExtrudeWallTransform('surface', box) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `surface_name`: `string` (REQUIRED) | ||||||
|  | * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The id of the extrusion end cap | ||||||
|  | 	endCapId: uuid, | ||||||
|  | 	// The height of the extrude group. | ||||||
|  | 	height: number, | ||||||
|  | 	// The id of the extrude group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The position of the extrude group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the extrude group. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The sketch group paths. | ||||||
|  | 	sketchGroupValues: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The id of the extrusion start cap | ||||||
|  | 	startCapId: uuid, | ||||||
|  | 	// The extrude surfaces. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudePlane", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudeArc", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the extrude group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the extrude group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the extrude group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `ExtrudeTransform` | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										171
									
								
								docs/kcl/getNextAdjacentEdge.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,171 @@ | |||||||
|  | --- | ||||||
|  | title: "getNextAdjacentEdge" | ||||||
|  | excerpt: "Get the next adjacent edge to the edge given." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Get the next adjacent edge to the edge given. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | getNextAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const part001 = startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line({ to: [0, 10], tag: "thing" }, %) | ||||||
|  |   |> line({ to: [10, 0], tag: "thing1" }, %) | ||||||
|  |   |> line({ to: [0, -10], tag: "thing2" }, %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(10, %) | ||||||
|  |   |> fillet({ | ||||||
|  |        radius: 2, | ||||||
|  |        tags: [getNextAdjacentEdge("thing", %)] | ||||||
|  |      }, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `tag`: `String` (REQUIRED) | ||||||
|  | * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The id of the extrusion end cap | ||||||
|  | 	endCapId: uuid, | ||||||
|  | 	// The height of the extrude group. | ||||||
|  | 	height: number, | ||||||
|  | 	// The id of the extrude group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The position of the extrude group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the extrude group. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The sketch group paths. | ||||||
|  | 	sketchGroupValues: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The id of the extrusion start cap | ||||||
|  | 	startCapId: uuid, | ||||||
|  | 	// The extrude surfaces. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudePlane", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudeArc", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the extrude group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the extrude group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the extrude group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `Uuid` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										171
									
								
								docs/kcl/getOppositeEdge.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,171 @@ | |||||||
|  | --- | ||||||
|  | title: "getOppositeEdge" | ||||||
|  | excerpt: "Get the opposite edge to the edge given." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Get the opposite edge to the edge given. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | getOppositeEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const part001 = startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line({ to: [0, 10], tag: "thing" }, %) | ||||||
|  |   |> line([10, 0], %) | ||||||
|  |   |> line({ to: [0, -10], tag: "thing2" }, %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(10, %) | ||||||
|  |   |> fillet({ | ||||||
|  |        radius: 2, | ||||||
|  |        tags: ["thing", getOppositeEdge("thing", %)] | ||||||
|  |      }, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `tag`: `String` (REQUIRED) | ||||||
|  | * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The id of the extrusion end cap | ||||||
|  | 	endCapId: uuid, | ||||||
|  | 	// The height of the extrude group. | ||||||
|  | 	height: number, | ||||||
|  | 	// The id of the extrude group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The position of the extrude group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the extrude group. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The sketch group paths. | ||||||
|  | 	sketchGroupValues: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The id of the extrusion start cap | ||||||
|  | 	startCapId: uuid, | ||||||
|  | 	// The extrude surfaces. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudePlane", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudeArc", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the extrude group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the extrude group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the extrude group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `Uuid` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										171
									
								
								docs/kcl/getPreviousAdjacentEdge.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,171 @@ | |||||||
|  | --- | ||||||
|  | title: "getPreviousAdjacentEdge" | ||||||
|  | excerpt: "Get the previous adjacent edge to the edge given." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Get the previous adjacent edge to the edge given. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | getPreviousAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const part001 = startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line({ to: [0, 10], tag: "thing" }, %) | ||||||
|  |   |> line({ to: [10, 0], tag: "thing1" }, %) | ||||||
|  |   |> line({ to: [0, -10], tag: "thing2" }, %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(10, %) | ||||||
|  |   |> fillet({ | ||||||
|  |        radius: 2, | ||||||
|  |        tags: [getPreviousAdjacentEdge("thing2", %)] | ||||||
|  |      }, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `tag`: `String` (REQUIRED) | ||||||
|  | * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The id of the extrusion end cap | ||||||
|  | 	endCapId: uuid, | ||||||
|  | 	// The height of the extrude group. | ||||||
|  | 	height: number, | ||||||
|  | 	// The id of the extrude group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The position of the extrude group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the extrude group. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The sketch group paths. | ||||||
|  | 	sketchGroupValues: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The id of the extrusion start cap | ||||||
|  | 	startCapId: uuid, | ||||||
|  | 	// The extrude surfaces. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudePlane", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudeArc", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the extrude group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the extrude group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the extrude group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `Uuid` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										532
									
								
								docs/kcl/hole.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,532 @@ | |||||||
|  | --- | ||||||
|  | title: "hole" | ||||||
|  | excerpt: "Use a sketch to cut a hole in another sketch." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Use a sketch to cut a hole in another sketch. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | hole(hole_sketch_group: SketchGroupSet, sketch_group: SketchGroup) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const square = startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line([0, 10], %) | ||||||
|  |   |> line([10, 0], %) | ||||||
|  |   |> line([0, -10], %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> hole(circle([2, 2], .5, %), %) | ||||||
|  |   |> hole(circle([2, 8], .5, %), %) | ||||||
|  |   |> extrude(2, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `hole_sketch_group`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	type: "sketchGroup", | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	type: "sketchGroups", | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										136
									
								
								docs/kcl/import.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,136 @@ | |||||||
|  | --- | ||||||
|  | title: "import" | ||||||
|  | excerpt: "Import a CAD file." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Import a CAD file. | ||||||
|  |  | ||||||
|  | For formats lacking unit data (STL, OBJ, PLY), the default import unit is millimeters. Otherwise you can specify the unit by passing in the options parameter. If you import a gltf file, we will try to find the bin file and import it as well. | ||||||
|  | Import paths are relative to the current project directory. This only works in the desktop app not in browser. | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | import(file_path: String, options?: ImportFormat) -> ImportedGeometry | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const model = import("thing.obj") | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const model = import("cube.obj", { type: "obj", units: "m" }) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const model = import("my_model.gltf") | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const model = import("my_model.sldprt") | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const model = import("my_model.step") | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `file_path`: `String` (REQUIRED) | ||||||
|  | * `options`: `ImportFormat` - Import format specifier (OPTIONAL) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	type: "fbx", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	type: "gltf", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// Co-ordinate system of input data. Defaults to the [KittyCAD co-ordinate system. | ||||||
|  | 	coords: { | ||||||
|  | 	// Axis the front face of a model looks along. | ||||||
|  | 	forward: { | ||||||
|  | 	// Axis specifier. | ||||||
|  | 	axis: "y" | "z", | ||||||
|  | 	// Specifies which direction the axis is pointing. | ||||||
|  | 	direction: "positive" | "negative", | ||||||
|  | }, | ||||||
|  | 	// Axis pointing up and away from a model. | ||||||
|  | 	up: { | ||||||
|  | 	// Axis specifier. | ||||||
|  | 	axis: "y" | "z", | ||||||
|  | 	// Specifies which direction the axis is pointing. | ||||||
|  | 	direction: "positive" | "negative", | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	type: "obj", | ||||||
|  | 	// The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc. Defaults to millimeters. | ||||||
|  | 	units: "cm" | "ft" | "in" | "m" | "mm" | "yd", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// Co-ordinate system of input data. Defaults to the [KittyCAD co-ordinate system. | ||||||
|  | 	coords: { | ||||||
|  | 	// Axis the front face of a model looks along. | ||||||
|  | 	forward: { | ||||||
|  | 	// Axis specifier. | ||||||
|  | 	axis: "y" | "z", | ||||||
|  | 	// Specifies which direction the axis is pointing. | ||||||
|  | 	direction: "positive" | "negative", | ||||||
|  | }, | ||||||
|  | 	// Axis pointing up and away from a model. | ||||||
|  | 	up: { | ||||||
|  | 	// Axis specifier. | ||||||
|  | 	axis: "y" | "z", | ||||||
|  | 	// Specifies which direction the axis is pointing. | ||||||
|  | 	direction: "positive" | "negative", | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	type: "ply", | ||||||
|  | 	// The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc. Defaults to millimeters. | ||||||
|  | 	units: "cm" | "ft" | "in" | "m" | "mm" | "yd", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	type: "sldprt", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	type: "step", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// Co-ordinate system of input data. Defaults to the [KittyCAD co-ordinate system. | ||||||
|  | 	coords: { | ||||||
|  | 	// Axis the front face of a model looks along. | ||||||
|  | 	forward: { | ||||||
|  | 	// Axis specifier. | ||||||
|  | 	axis: "y" | "z", | ||||||
|  | 	// Specifies which direction the axis is pointing. | ||||||
|  | 	direction: "positive" | "negative", | ||||||
|  | }, | ||||||
|  | 	// Axis pointing up and away from a model. | ||||||
|  | 	up: { | ||||||
|  | 	// Axis specifier. | ||||||
|  | 	axis: "y" | "z", | ||||||
|  | 	// Specifies which direction the axis is pointing. | ||||||
|  | 	direction: "positive" | "negative", | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	type: "stl", | ||||||
|  | 	// The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc. Defaults to millimeters. | ||||||
|  | 	units: "cm" | "ft" | "in" | "m" | "mm" | "yd", | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `ImportedGeometry` - Data for an imported geometry. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The ID of the imported geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original file paths. | ||||||
|  | 	value: [string], | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										76
									
								
								docs/kcl/index.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,76 @@ | |||||||
|  | --- | ||||||
|  | title: "KCL Standard Library" | ||||||
|  | excerpt: "Documentation for the KCL standard library for the Zoo Modeling App." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | ## Table of Contents | ||||||
|  |  | ||||||
|  | * [Types](kcl/types) | ||||||
|  | * [Known Issues](kcl/KNOWN-ISSUES) | ||||||
|  | * [`abs`](kcl/abs) | ||||||
|  | * [`acos`](kcl/acos) | ||||||
|  | * [`angleToMatchLengthX`](kcl/angleToMatchLengthX) | ||||||
|  | * [`angleToMatchLengthY`](kcl/angleToMatchLengthY) | ||||||
|  | * [`angledLine`](kcl/angledLine) | ||||||
|  | * [`angledLineOfXLength`](kcl/angledLineOfXLength) | ||||||
|  | * [`angledLineOfYLength`](kcl/angledLineOfYLength) | ||||||
|  | * [`angledLineThatIntersects`](kcl/angledLineThatIntersects) | ||||||
|  | * [`angledLineToX`](kcl/angledLineToX) | ||||||
|  | * [`angledLineToY`](kcl/angledLineToY) | ||||||
|  | * [`arc`](kcl/arc) | ||||||
|  | * [`asin`](kcl/asin) | ||||||
|  | * [`atan`](kcl/atan) | ||||||
|  | * [`bezierCurve`](kcl/bezierCurve) | ||||||
|  | * [`ceil`](kcl/ceil) | ||||||
|  | * [`circle`](kcl/circle) | ||||||
|  | * [`close`](kcl/close) | ||||||
|  | * [`cos`](kcl/cos) | ||||||
|  | * [`e`](kcl/e) | ||||||
|  | * [`extrude`](kcl/extrude) | ||||||
|  | * [`fillet`](kcl/fillet) | ||||||
|  | * [`floor`](kcl/floor) | ||||||
|  | * [`getExtrudeWallTransform`](kcl/getExtrudeWallTransform) | ||||||
|  | * [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge) | ||||||
|  | * [`getOppositeEdge`](kcl/getOppositeEdge) | ||||||
|  | * [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge) | ||||||
|  | * [`hole`](kcl/hole) | ||||||
|  | * [`import`](kcl/import) | ||||||
|  | * [`lastSegX`](kcl/lastSegX) | ||||||
|  | * [`lastSegY`](kcl/lastSegY) | ||||||
|  | * [`legAngX`](kcl/legAngX) | ||||||
|  | * [`legAngY`](kcl/legAngY) | ||||||
|  | * [`legLen`](kcl/legLen) | ||||||
|  | * [`line`](kcl/line) | ||||||
|  | * [`lineTo`](kcl/lineTo) | ||||||
|  | * [`ln`](kcl/ln) | ||||||
|  | * [`log`](kcl/log) | ||||||
|  | * [`log10`](kcl/log10) | ||||||
|  | * [`log2`](kcl/log2) | ||||||
|  | * [`max`](kcl/max) | ||||||
|  | * [`min`](kcl/min) | ||||||
|  | * [`patternCircular2d`](kcl/patternCircular2d) | ||||||
|  | * [`patternCircular3d`](kcl/patternCircular3d) | ||||||
|  | * [`patternLinear2d`](kcl/patternLinear2d) | ||||||
|  | * [`patternLinear3d`](kcl/patternLinear3d) | ||||||
|  | * [`pi`](kcl/pi) | ||||||
|  | * [`pow`](kcl/pow) | ||||||
|  | * [`segAng`](kcl/segAng) | ||||||
|  | * [`segEndX`](kcl/segEndX) | ||||||
|  | * [`segEndY`](kcl/segEndY) | ||||||
|  | * [`segLen`](kcl/segLen) | ||||||
|  | * [`sin`](kcl/sin) | ||||||
|  | * [`sqrt`](kcl/sqrt) | ||||||
|  | * [`startProfileAt`](kcl/startProfileAt) | ||||||
|  | * [`startSketchAt`](kcl/startSketchAt) | ||||||
|  | * [`startSketchOn`](kcl/startSketchOn) | ||||||
|  | * [`tan`](kcl/tan) | ||||||
|  | * [`tangentialArc`](kcl/tangentialArc) | ||||||
|  | * [`tangentialArcTo`](kcl/tangentialArcTo) | ||||||
|  | * [`tau`](kcl/tau) | ||||||
|  | * [`toDegrees`](kcl/toDegrees) | ||||||
|  | * [`toRadians`](kcl/toRadians) | ||||||
|  | * [`xLine`](kcl/xLine) | ||||||
|  | * [`xLineTo`](kcl/xLineTo) | ||||||
|  | * [`yLine`](kcl/yLine) | ||||||
|  | * [`yLineTo`](kcl/yLineTo) | ||||||
							
								
								
									
										199
									
								
								docs/kcl/lastSegX.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,199 @@ | |||||||
|  | --- | ||||||
|  | title: "lastSegX" | ||||||
|  | excerpt: "Returns the last segment of x." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Returns the last segment of x. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | lastSegX(sketch_group: SketchGroup) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn("YZ") | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line({ to: [5, 0], tag: "thing" }, %) | ||||||
|  |   |> line([5, 5], %) | ||||||
|  |   |> line([0, lastSegX(%)], %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(5, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										199
									
								
								docs/kcl/lastSegY.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,199 @@ | |||||||
|  | --- | ||||||
|  | title: "lastSegY" | ||||||
|  | excerpt: "Returns the last segment of y." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Returns the last segment of y. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | lastSegY(sketch_group: SketchGroup) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn("YZ") | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line({ to: [5, 0], tag: "thing" }, %) | ||||||
|  |   |> line([5, 5], %) | ||||||
|  |   |> line([0, lastSegY(%)], %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(5, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										31
									
								
								docs/kcl/legAngX.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,31 @@ | |||||||
|  | --- | ||||||
|  | title: "legAngX" | ||||||
|  | excerpt: "Returns the angle of the given leg for x." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Returns the angle of the given leg for x. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | legAngX(hypotenuse: number, leg: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | legAngX(5, 3) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `hypotenuse`: `number` (REQUIRED) | ||||||
|  | * `leg`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										31
									
								
								docs/kcl/legAngY.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,31 @@ | |||||||
|  | --- | ||||||
|  | title: "legAngY" | ||||||
|  | excerpt: "Returns the angle of the given leg for y." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Returns the angle of the given leg for y. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | legAngY(hypotenuse: number, leg: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | legAngY(5, 3) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `hypotenuse`: `number` (REQUIRED) | ||||||
|  | * `leg`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										31
									
								
								docs/kcl/legLen.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,31 @@ | |||||||
|  | --- | ||||||
|  | title: "legLen" | ||||||
|  | excerpt: "Returns the length of the given leg." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Returns the length of the given leg. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | legLen(hypotenuse: number, leg: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | legLen(5, 3) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `hypotenuse`: `number` (REQUIRED) | ||||||
|  | * `leg`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										371
									
								
								docs/kcl/line.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,371 @@ | |||||||
|  | --- | ||||||
|  | title: "line" | ||||||
|  | excerpt: "Draw a line." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Draw a line. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | line(data: LineData, sketch_group: SketchGroup) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('-XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line([10, 10], %) | ||||||
|  |   |> line({ to: [20, 10], tag: "edge1" }, %) | ||||||
|  |   |> close(%, "edge2") | ||||||
|  |   |> extrude(10, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `LineData` - Data to draw a line. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The tag. | ||||||
|  | 	tag: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | } | | ||||||
|  | [number, number] | ||||||
|  | ``` | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										386
									
								
								docs/kcl/lineTo.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,386 @@ | |||||||
|  | --- | ||||||
|  | title: "lineTo" | ||||||
|  | excerpt: "Draw a line to a point." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Draw a line to a point. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | lineTo(data: LineToData, sketch_group: SketchGroup) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | fn rectShape = (pos, w, l) => { | ||||||
|  |   const rr = startSketchOn('YZ') | ||||||
|  |   |> startProfileAt([pos[0] - (w / 2), pos[1] - (l / 2)], %) | ||||||
|  |   |> lineTo({ | ||||||
|  |        to: [pos[0] + w / 2, pos[1] - (l / 2)], | ||||||
|  |        tag: "edge1" | ||||||
|  |      }, %) | ||||||
|  |   |> lineTo({ | ||||||
|  |        to: [pos[0] + w / 2, pos[1] + l / 2], | ||||||
|  |        tag: "edge2" | ||||||
|  |      }, %) | ||||||
|  |   |> lineTo({ | ||||||
|  |        to: [pos[0] - (w / 2), pos[1] + l / 2], | ||||||
|  |        tag: "edge3" | ||||||
|  |      }, %) | ||||||
|  |   |> close(%, "edge4") | ||||||
|  |   return rr | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // Create the mounting plate extrusion, holes, and fillets | ||||||
|  | const part = rectShape([0, 0], 20, 20) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `LineToData` - Data to draw a line to a point. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The tag. | ||||||
|  | 	tag: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | } | | ||||||
|  | [number, number] | ||||||
|  | ``` | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										30
									
								
								docs/kcl/ln.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,30 @@ | |||||||
|  | --- | ||||||
|  | title: "ln" | ||||||
|  | excerpt: "Computes the natural logarithm of the number." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Computes the natural logarithm of the number. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | ln(num: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = ln(4) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `num`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										31
									
								
								docs/kcl/log.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,31 @@ | |||||||
|  | --- | ||||||
|  | title: "log" | ||||||
|  | excerpt: "Computes the logarithm of the number with respect to an arbitrary base." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Computes the logarithm of the number with respect to an arbitrary base. | ||||||
|  |  | ||||||
|  | The result might not be correctly rounded owing to implementation details; `log2()` can produce more accurate results for base 2, and `log10()` can produce more accurate results for base 10. | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | log(num: number, base: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = log(4, 2) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `num`: `number` (REQUIRED) | ||||||
|  | * `base`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										30
									
								
								docs/kcl/log10.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,30 @@ | |||||||
|  | --- | ||||||
|  | title: "log10" | ||||||
|  | excerpt: "Computes the base 10 logarithm of the number." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Computes the base 10 logarithm of the number. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | log10(num: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = log10(4) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `num`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										30
									
								
								docs/kcl/log2.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,30 @@ | |||||||
|  | --- | ||||||
|  | title: "log2" | ||||||
|  | excerpt: "Computes the base 2 logarithm of the number." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Computes the base 2 logarithm of the number. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | log2(num: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = log2(4) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `num`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										30
									
								
								docs/kcl/max.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,30 @@ | |||||||
|  | --- | ||||||
|  | title: "max" | ||||||
|  | excerpt: "Computes the maximum of the given arguments." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Computes the maximum of the given arguments. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | max(args: [number]) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = max(4, 5, 6) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `args`: `[number]` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										30
									
								
								docs/kcl/min.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,30 @@ | |||||||
|  | --- | ||||||
|  | title: "min" | ||||||
|  | excerpt: "Computes the minimum of the given arguments." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Computes the minimum of the given arguments. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | min(args: [number]) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = min(4, 5, 6) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `args`: `[number]` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										213
									
								
								docs/kcl/patternCircular2d.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,213 @@ | |||||||
|  | --- | ||||||
|  | title: "patternCircular2d" | ||||||
|  | excerpt: "A circular pattern on a 2D sketch." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | A circular pattern on a 2D sketch. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | patternCircular2d(data: CircularPattern2dData, sketch_group: SketchGroup) -> [SketchGroup] | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const part = startSketchOn('XY') | ||||||
|  |   |> circle([0, 0], 2, %) | ||||||
|  |   |> patternCircular2d({ | ||||||
|  |        center: [20, 20], | ||||||
|  |        repetitions: 12, | ||||||
|  |        arcDegrees: 210, | ||||||
|  |        rotateDuplicates: true | ||||||
|  |      }, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `CircularPattern2dData` - Data for a circular pattern on a 2D sketch. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The arc angle (in degrees) to place the repetitions. Must be greater than 0. | ||||||
|  | 	arcDegrees: number, | ||||||
|  | 	// The center about which to make th pattern. This is a 2D vector. | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The number of repetitions. Must be greater than 0. This excludes the original entity. For example, if `repetitions` is 1, the original entity will be copied once. | ||||||
|  | 	repetitions: number, | ||||||
|  | 	// Whether or not to rotate the duplicates as they are copied. | ||||||
|  | 	rotateDuplicates: string, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `[SketchGroup]` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										188
									
								
								docs/kcl/patternCircular3d.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,188 @@ | |||||||
|  | --- | ||||||
|  | title: "patternCircular3d" | ||||||
|  | excerpt: "A circular pattern on a 3D model." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | A circular pattern on a 3D model. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | patternCircular3d(data: CircularPattern3dData, extrude_group: ExtrudeGroup) -> [ExtrudeGroup] | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const part = startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line([0, 1], %) | ||||||
|  |   |> line([1, 0], %) | ||||||
|  |   |> line([0, -1], %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(1, %) | ||||||
|  |   |> patternCircular3d({ | ||||||
|  |        axis: [1, 1, 0], | ||||||
|  |        center: [10, 0, 10], | ||||||
|  |        repetitions: 10, | ||||||
|  |        arcDegrees: 360, | ||||||
|  |        rotateDuplicates: true | ||||||
|  |      }, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `CircularPattern3dData` - Data for a circular pattern on a 3D model. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The arc angle (in degrees) to place the repetitions. Must be greater than 0. | ||||||
|  | 	arcDegrees: number, | ||||||
|  | 	// The axis around which to make the pattern. This is a 3D vector. | ||||||
|  | 	axis: [number, number, number], | ||||||
|  | 	// The center about which to make th pattern. This is a 3D vector. | ||||||
|  | 	center: [number, number, number], | ||||||
|  | 	// The number of repetitions. Must be greater than 0. This excludes the original entity. For example, if `repetitions` is 1, the original entity will be copied once. | ||||||
|  | 	repetitions: number, | ||||||
|  | 	// Whether or not to rotate the duplicates as they are copied. | ||||||
|  | 	rotateDuplicates: string, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  | * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The id of the extrusion end cap | ||||||
|  | 	endCapId: uuid, | ||||||
|  | 	// The height of the extrude group. | ||||||
|  | 	height: number, | ||||||
|  | 	// The id of the extrude group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The position of the extrude group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the extrude group. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The sketch group paths. | ||||||
|  | 	sketchGroupValues: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The id of the extrusion start cap | ||||||
|  | 	startCapId: uuid, | ||||||
|  | 	// The extrude surfaces. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudePlane", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudeArc", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the extrude group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the extrude group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the extrude group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `[ExtrudeGroup]` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										210
									
								
								docs/kcl/patternLinear2d.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,210 @@ | |||||||
|  | --- | ||||||
|  | title: "patternLinear2d" | ||||||
|  | excerpt: "A linear pattern on a 2D sketch." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | A linear pattern on a 2D sketch. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | patternLinear2d(data: LinearPattern2dData, sketch_group: SketchGroup) -> [SketchGroup] | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const part = startSketchOn('XY') | ||||||
|  |   |> circle([0, 0], 2, %) | ||||||
|  |   |> patternLinear2d({ | ||||||
|  |        axis: [0, 1], | ||||||
|  |        repetitions: 12, | ||||||
|  |        distance: 2 | ||||||
|  |      }, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `LinearPattern2dData` - Data for a linear pattern on a 2D sketch. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The axis of the pattern. This is a 2D vector. | ||||||
|  | 	axis: [number, number], | ||||||
|  | 	// The distance between each repetition. This can also be referred to as spacing. | ||||||
|  | 	distance: number, | ||||||
|  | 	// The number of repetitions. Must be greater than 0. This excludes the original entity. For example, if `repetitions` is 1, the original entity will be copied once. | ||||||
|  | 	repetitions: number, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `[SketchGroup]` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										182
									
								
								docs/kcl/patternLinear3d.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,182 @@ | |||||||
|  | --- | ||||||
|  | title: "patternLinear3d" | ||||||
|  | excerpt: "A linear pattern on a 3D model." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | A linear pattern on a 3D model. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | patternLinear3d(data: LinearPattern3dData, extrude_group: ExtrudeGroup) -> [ExtrudeGroup] | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const part = startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line([0, 1], %) | ||||||
|  |   |> line([1, 0], %) | ||||||
|  |   |> line([0, -1], %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(1, %) | ||||||
|  |   |> patternLinear3d({ | ||||||
|  |        axis: [1, 0, 1], | ||||||
|  |        repetitions: 3, | ||||||
|  |        distance: 6 | ||||||
|  |      }, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `LinearPattern3dData` - Data for a linear pattern on a 3D model. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The axis of the pattern. | ||||||
|  | 	axis: [number, number, number], | ||||||
|  | 	// The distance between each repetition. This can also be referred to as spacing. | ||||||
|  | 	distance: number, | ||||||
|  | 	// The number of repetitions. Must be greater than 0. This excludes the original entity. For example, if `repetitions` is 1, the original entity will be copied once. | ||||||
|  | 	repetitions: number, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  | * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The id of the extrusion end cap | ||||||
|  | 	endCapId: uuid, | ||||||
|  | 	// The height of the extrude group. | ||||||
|  | 	height: number, | ||||||
|  | 	// The id of the extrude group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The position of the extrude group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the extrude group. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The sketch group paths. | ||||||
|  | 	sketchGroupValues: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The id of the extrusion start cap | ||||||
|  | 	startCapId: uuid, | ||||||
|  | 	// The extrude surfaces. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudePlane", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudeArc", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the extrude group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the extrude group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the extrude group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `[ExtrudeGroup]` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										29
									
								
								docs/kcl/pi.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,29 @@ | |||||||
|  | --- | ||||||
|  | title: "pi" | ||||||
|  | excerpt: "Return the value of `pi`. Archimedes’ constant (π)." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Return the value of `pi`. Archimedes’ constant (π). | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | pi() -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = pi() * 3.0 | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										31
									
								
								docs/kcl/pow.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,31 @@ | |||||||
|  | --- | ||||||
|  | title: "pow" | ||||||
|  | excerpt: "Computes the number to a power." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Computes the number to a power. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | pow(num: number, pow: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = pow(4, 2) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `num`: `number` (REQUIRED) | ||||||
|  | * `pow`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										202
									
								
								docs/kcl/segAng.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,202 @@ | |||||||
|  | --- | ||||||
|  | title: "segAng" | ||||||
|  | excerpt: "Returns the angle of the segment." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Returns the angle of the segment. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | segAng(segment_name: string, sketch_group: SketchGroup) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const part001 = startSketchOn('XY') | ||||||
|  |   |> startProfileAt([4.83, 12.56], %) | ||||||
|  |   |> line([15.1, 2.48], %) | ||||||
|  |   |> line({ to: [3.15, -9.85], tag: 'seg01' }, %) | ||||||
|  |   |> line([-15.17, -4.1], %) | ||||||
|  |   |> angledLine([segAng('seg01', %), 12.35], %) | ||||||
|  |   |> line([-13.02, 10.03], %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(4, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `segment_name`: `string` (REQUIRED) | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										200
									
								
								docs/kcl/segEndX.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,200 @@ | |||||||
|  | --- | ||||||
|  | title: "segEndX" | ||||||
|  | excerpt: "Returns the segment end of x." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Returns the segment end of x. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | segEndX(segment_name: string, sketch_group: SketchGroup) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn("YZ") | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line({ to: [5, 0], tag: "thing" }, %) | ||||||
|  |   |> line([5, 5], %) | ||||||
|  |   |> line([segEndX("thing", %), 5], %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(5, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `segment_name`: `string` (REQUIRED) | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										200
									
								
								docs/kcl/segEndY.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,200 @@ | |||||||
|  | --- | ||||||
|  | title: "segEndY" | ||||||
|  | excerpt: "Returns the segment end of y." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Returns the segment end of y. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | segEndY(segment_name: string, sketch_group: SketchGroup) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn("YZ") | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line({ to: [5, 0], tag: "thing" }, %) | ||||||
|  |   |> line([5, 5], %) | ||||||
|  |   |> line([segEndY("thing", %), 5], %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(5, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `segment_name`: `string` (REQUIRED) | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										200
									
								
								docs/kcl/segLen.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,200 @@ | |||||||
|  | --- | ||||||
|  | title: "segLen" | ||||||
|  | excerpt: "Returns the length of the segment." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Returns the length of the segment. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | segLen(segment_name: string, sketch_group: SketchGroup) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn("YZ") | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line({ to: [5, 0], tag: "thing" }, %) | ||||||
|  |   |> line([5, 5], %) | ||||||
|  |   |> line([0, segLen("thing", %)], %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(5, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `segment_name`: `string` (REQUIRED) | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										30
									
								
								docs/kcl/sin.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,30 @@ | |||||||
|  | --- | ||||||
|  | title: "sin" | ||||||
|  | excerpt: "Computes the sine of a number (in radians)." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Computes the sine of a number (in radians). | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | sin(num: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = sin(2 * pi()) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `num`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										30
									
								
								docs/kcl/sqrt.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,30 @@ | |||||||
|  | --- | ||||||
|  | title: "sqrt" | ||||||
|  | excerpt: "Computes the square root of a number." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Computes the square root of a number. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | sqrt(num: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = sqrt(4) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `num`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										265
									
								
								docs/kcl/startProfileAt.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,265 @@ | |||||||
|  | --- | ||||||
|  | title: "startProfileAt" | ||||||
|  | excerpt: "Start a profile at a given point." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Start a profile at a given point. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startProfileAt(data: LineData, sketch_surface: SketchSurface) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line([10, 10], %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `LineData` - Data to draw a line. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The tag. | ||||||
|  | 	tag: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | } | | ||||||
|  | [number, number] | ||||||
|  | ``` | ||||||
|  | * `sketch_surface`: `SketchSurface` - A sketch group type. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										203
									
								
								docs/kcl/startSketchAt.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,203 @@ | |||||||
|  | --- | ||||||
|  | title: "startSketchAt" | ||||||
|  | excerpt: "Start a sketch at a given point on the 'XY' plane." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Start a sketch at a given point on the 'XY' plane. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchAt(data: LineData) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchAt([0, 0]) | ||||||
|  |   |> line([10, 10], %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `LineData` - Data to draw a line. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The tag. | ||||||
|  | 	tag: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | } | | ||||||
|  | [number, number] | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										286
									
								
								docs/kcl/startSketchOn.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,286 @@ | |||||||
|  | --- | ||||||
|  | title: "startSketchOn" | ||||||
|  | excerpt: "Start a sketch on a specific plane or face." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Start a sketch on a specific plane or face. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn(data: SketchData, tag?: SketchOnFaceTag) -> SketchSurface | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line([10, 10], %) | ||||||
|  |   |> line({ to: [20, 10], tag: "edge1" }, %) | ||||||
|  |   |> close(%, "edge2") | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | fn cube = (pos, scale) => { | ||||||
|  |   const sg = startSketchOn('XY') | ||||||
|  |   |> startProfileAt(pos, %) | ||||||
|  |   |> line([0, scale], %) | ||||||
|  |   |> line([scale, 0], %) | ||||||
|  |   |> line([0, -scale], %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(scale, %) | ||||||
|  |  | ||||||
|  |   return sg | ||||||
|  | } | ||||||
|  |  | ||||||
|  | const box = cube([0, 0], 20) | ||||||
|  |  | ||||||
|  | const part001 = startSketchOn(box, "start") | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line([10, 10], %) | ||||||
|  |   |> line({ to: [20, 10], tag: "edge1" }, %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(20, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `SketchData` - Data for start sketch on. You can start a sketch on a plane or an extrude group. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | "XY" | | ||||||
|  | "-XY" | | ||||||
|  | "XZ" | | ||||||
|  | "-XZ" | | ||||||
|  | "YZ" | | ||||||
|  | "-YZ" | | ||||||
|  | { | ||||||
|  | 	plane: { | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	x_axis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	y_axis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	z_axis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the extrusion end cap | ||||||
|  | 	endCapId: uuid, | ||||||
|  | 	// The height of the extrude group. | ||||||
|  | 	height: number, | ||||||
|  | 	// The id of the extrude group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The position of the extrude group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the extrude group. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The sketch group paths. | ||||||
|  | 	sketchGroupValues: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The id of the extrusion start cap | ||||||
|  | 	startCapId: uuid, | ||||||
|  | 	// The extrude surfaces. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudePlane", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudeArc", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the extrude group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the extrude group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the extrude group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  | * `tag`: `SketchOnFaceTag` - A tag for sketch on face. (OPTIONAL) | ||||||
|  | ```js | ||||||
|  | "start" | "end" | | ||||||
|  | string | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchSurface` - A sketch group type. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										24187
									
								
								docs/kcl/std.json
									
									
									
									
									
								
							
							
						
						
							
								
								
									
										9766
									
								
								docs/kcl/std.md
									
									
									
									
									
								
							
							
						
						
							
								
								
									
										30
									
								
								docs/kcl/tan.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,30 @@ | |||||||
|  | --- | ||||||
|  | title: "tan" | ||||||
|  | excerpt: "Computes the tangent of a number (in radians)." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Computes the tangent of a number (in radians). | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | tan(num: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = tan(2 * pi()) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `num`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										377
									
								
								docs/kcl/tangentialArc.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,377 @@ | |||||||
|  | --- | ||||||
|  | title: "tangentialArc" | ||||||
|  | excerpt: "Draw an arc." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Draw an arc. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | tangentialArc(data: TangentialArcData, sketch_group: SketchGroup) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('-YZ') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line({ to: [10, 10], tag: "edge0" }, %) | ||||||
|  |   |> tangentialArc({ radius: 10, offset: 90, tag: "edge1" }, %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(10, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `TangentialArcData` - Data to draw a tangential arc. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// Offset of the arc, in degrees. | ||||||
|  | 	offset: number, | ||||||
|  | 	// Radius of the arc. Not to be confused with Raiders of the Lost Ark. | ||||||
|  | 	radius: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The tag. | ||||||
|  | 	tag: string, | ||||||
|  | 	// Where the arc should end. Must lie in the same plane as the current path pen position. Must not be colinear with current path pen position. | ||||||
|  | 	to: [number, number], | ||||||
|  | } | | ||||||
|  | [number, number] | ||||||
|  | ``` | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										362
									
								
								docs/kcl/tangentialArcTo.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,362 @@ | |||||||
|  | --- | ||||||
|  | title: "tangentialArcTo" | ||||||
|  | excerpt: "Draw an arc." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Draw an arc. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('-YZ') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line({ to: [10, 10], tag: "edge0" }, %) | ||||||
|  |   |> tangentialArcTo([10, 0], %) | ||||||
|  |   |> close(%) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `to`: `[number]` (REQUIRED) | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  | * `tag`: `String` (OPTIONAL) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										29
									
								
								docs/kcl/tau.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,29 @@ | |||||||
|  | --- | ||||||
|  | title: "tau" | ||||||
|  | excerpt: "Return the value of `tau`. The full circle constant (τ). Equal to 2π." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Return the value of `tau`. The full circle constant (τ). Equal to 2π. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | tau() -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = tau() | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										30
									
								
								docs/kcl/toDegrees.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,30 @@ | |||||||
|  | --- | ||||||
|  | title: "toDegrees" | ||||||
|  | excerpt: "Converts a number from radians to degrees." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Converts a number from radians to degrees. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | toDegrees(num: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = toDegrees(2 * pi()) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `num`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										30
									
								
								docs/kcl/toRadians.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,30 @@ | |||||||
|  | --- | ||||||
|  | title: "toRadians" | ||||||
|  | excerpt: "Converts a number from degrees to radians." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Converts a number from degrees to radians. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | toRadians(num: number) -> number | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const myVar = toRadians(180) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `num`: `number` (REQUIRED) | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `number` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| @ -1,4 +1,8 @@ | |||||||
| # Types | --- | ||||||
|  | title: "KCL Types" | ||||||
|  | excerpt: "Documentation of types for the KCL standard library for the Zoo Modeling App." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
| `KCL` defines the following types and keywords the language. | `KCL` defines the following types and keywords the language. | ||||||
|  |  | ||||||
|  | |||||||
							
								
								
									
										371
									
								
								docs/kcl/xLine.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,371 @@ | |||||||
|  | --- | ||||||
|  | title: "xLine" | ||||||
|  | excerpt: "Draw a line on the x-axis." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Draw a line on the x-axis. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | xLine(data: AxisLineData, sketch_group: SketchGroup) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('YZ') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> xLine(10, %) | ||||||
|  |   |> line([10, 10], %) | ||||||
|  |   |> close(%, "edge1") | ||||||
|  |   |> extrude(10, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `AxisLineData` - Data to draw a line on an axis. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The length of the line. | ||||||
|  | 	length: number, | ||||||
|  | 	// The tag. | ||||||
|  | 	tag: string, | ||||||
|  | } | | ||||||
|  | number | ||||||
|  | ``` | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										371
									
								
								docs/kcl/xLineTo.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,371 @@ | |||||||
|  | --- | ||||||
|  | title: "xLineTo" | ||||||
|  | excerpt: "Draw a line to a point on the x-axis." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Draw a line to a point on the x-axis. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | xLineTo(data: AxisLineToData, sketch_group: SketchGroup) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> xLineTo({ to: 10, tag: "edge1" }, %) | ||||||
|  |   |> line([10, 10], %) | ||||||
|  |   |> close(%, "edge2") | ||||||
|  |   |> extrude(10, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `AxisLineToData` - Data to draw a line to a point on an axis. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The tag. | ||||||
|  | 	tag: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: number, | ||||||
|  | } | | ||||||
|  | number | ||||||
|  | ``` | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										371
									
								
								docs/kcl/yLine.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,371 @@ | |||||||
|  | --- | ||||||
|  | title: "yLine" | ||||||
|  | excerpt: "Draw a line on the y-axis." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Draw a line on the y-axis. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | yLine(data: AxisLineData, sketch_group: SketchGroup) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> yLine(10, %) | ||||||
|  |   |> line([10, 10], %) | ||||||
|  |   |> close(%, "edge1") | ||||||
|  |   |> extrude(10, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `AxisLineData` - Data to draw a line on an axis. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The length of the line. | ||||||
|  | 	length: number, | ||||||
|  | 	// The tag. | ||||||
|  | 	tag: string, | ||||||
|  | } | | ||||||
|  | number | ||||||
|  | ``` | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										372
									
								
								docs/kcl/yLineTo.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,372 @@ | |||||||
|  | --- | ||||||
|  | title: "yLineTo" | ||||||
|  | excerpt: "Draw a line to a point on the y-axis." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Draw a line to a point on the y-axis. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | yLineTo(data: AxisLineToData, sketch_group: SketchGroup) -> SketchGroup | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | startSketchOn('XZ') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> yLineTo({ to: 10, tag: "edge1" }, %) | ||||||
|  |   |> line([10, 10], %) | ||||||
|  |   |> close(%, "edge2") | ||||||
|  |   |> extrude(10, %) | ||||||
|  |   |> fillet({ radius: 2, tags: ["edge2"] }, %) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `data`: `AxisLineToData` - Data to draw a line to a point on an axis. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The tag. | ||||||
|  | 	tag: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: number, | ||||||
|  | } | | ||||||
|  | number | ||||||
|  | ``` | ||||||
|  | * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `SketchGroup` - A sketch group is a collection of paths. | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The plane id or face id of the sketch group. | ||||||
|  | 	entityId: uuid, | ||||||
|  | 	// The id of the sketch group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// What the sketch is on (can be a plane or a face). | ||||||
|  | 	on: { | ||||||
|  | 	// The id of the plane. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// Origin of the plane. | ||||||
|  | 	origin: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	type: "plane", | ||||||
|  | 	// Type for a plane. | ||||||
|  | 	value: "XY" | "XZ" | "YZ" | "Custom", | ||||||
|  | 	// What should the plane’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the plane’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The id of the face. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The original sketch group id of the object we are sketching on. | ||||||
|  | 	sketchGroupId: uuid, | ||||||
|  | 	type: "face", | ||||||
|  | 	// The tag of the face. | ||||||
|  | 	value: string, | ||||||
|  | 	// What should the face’s X axis be? | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// What should the face’s Y axis be? | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis (normal). | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | }, | ||||||
|  | 	// The position of the sketch group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the sketch group base plane. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The starting path. | ||||||
|  | 	start: { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | }, | ||||||
|  | 	// The paths in the sketch group. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the sketch group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the sketch group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the sketch group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 193 KiB | 
| Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 193 KiB | 
							
								
								
									
										
											BIN
										
									
								
								e2e/playwright/export-snapshots/gltf-standard.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 193 KiB | 
| Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 259 KiB | 
| Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 220 KiB | 
| Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 220 KiB | 
| Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 220 KiB | 
| Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 193 KiB | 
| @ -1,494 +0,0 @@ | |||||||
| ISO-10303-21; |  | ||||||
| HEADER; |  | ||||||
| FILE_DESCRIPTION((('zoo.dev export')), '2;1'); |  | ||||||
| FILE_NAME('dump.step', '1970-01-01T00:00:00.0+00:00', ('Author unknown'), ('Organization unknown'), 'zoo.dev beta', 'zoo.dev', 'Authorization unknown'); |  | ||||||
| FILE_SCHEMA(('AP203_CONFIGURATION_CONTROLLED_3D_DESIGN_OF_MECHANICAL_PARTS_AND_ASSEMBLIES_MIM_LF')); |  | ||||||
| ENDSEC; |  | ||||||
| DATA; |  | ||||||
| #1 = ( |  | ||||||
|   LENGTH_UNIT() |  | ||||||
|   NAMED_UNIT(*) |  | ||||||
|   SI_UNIT($, .METRE.) |  | ||||||
| ); |  | ||||||
| #2 = UNCERTAINTY_MEASURE_WITH_UNIT(0.00001, #1, 'DISTANCE_ACCURACY_VALUE', $); |  | ||||||
| #3 = ( |  | ||||||
|   GEOMETRIC_REPRESENTATION_CONTEXT(3) |  | ||||||
|   GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#2)) |  | ||||||
|   GLOBAL_UNIT_ASSIGNED_CONTEXT((#1)) |  | ||||||
|   REPRESENTATION_CONTEXT('', '3D') |  | ||||||
| ); |  | ||||||
| #4 = CARTESIAN_POINT('NONE', (0, 0, -0)); |  | ||||||
| #5 = VERTEX_POINT('NONE', #4); |  | ||||||
| #6 = CARTESIAN_POINT('NONE', (0, -0.0254, -0)); |  | ||||||
| #7 = VERTEX_POINT('NONE', #6); |  | ||||||
| #8 = CARTESIAN_POINT('NONE', (0, -0.0254, 0.1016)); |  | ||||||
| #9 = VERTEX_POINT('NONE', #8); |  | ||||||
| #10 = CARTESIAN_POINT('NONE', (0, 0, 0.1016)); |  | ||||||
| #11 = VERTEX_POINT('NONE', #10); |  | ||||||
| #12 = CARTESIAN_POINT('NONE', (0.07861346939195568, -0.0254, -0)); |  | ||||||
| #13 = VERTEX_POINT('NONE', #12); |  | ||||||
| #14 = CARTESIAN_POINT('NONE', (0.07861346939195568, -0.0254, 0.1016)); |  | ||||||
| #15 = VERTEX_POINT('NONE', #14); |  | ||||||
| #16 = CARTESIAN_POINT('NONE', (0.1511633881344551, -0.07619999999999998, -0)); |  | ||||||
| #17 = VERTEX_POINT('NONE', #16); |  | ||||||
| #18 = CARTESIAN_POINT('NONE', (0.1511633881344551, -0.07619999999999998, 0.1016)); |  | ||||||
| #19 = VERTEX_POINT('NONE', #18); |  | ||||||
| #20 = CARTESIAN_POINT('NONE', (0.2413, -0.0762, -0)); |  | ||||||
| #21 = VERTEX_POINT('NONE', #20); |  | ||||||
| #22 = CARTESIAN_POINT('NONE', (0.2413, -0.0762, 0.1016)); |  | ||||||
| #23 = VERTEX_POINT('NONE', #22); |  | ||||||
| #24 = CARTESIAN_POINT('NONE', (0.2413, -0.0635, -0)); |  | ||||||
| #25 = VERTEX_POINT('NONE', #24); |  | ||||||
| #26 = CARTESIAN_POINT('NONE', (0.2413, -0.0635, 0.1016)); |  | ||||||
| #27 = VERTEX_POINT('NONE', #26); |  | ||||||
| #28 = CARTESIAN_POINT('NONE', (0.1551676827532182, -0.0635, -0)); |  | ||||||
| #29 = VERTEX_POINT('NONE', #28); |  | ||||||
| #30 = CARTESIAN_POINT('NONE', (0.1551676827532182, -0.0635, 0.1016)); |  | ||||||
| #31 = VERTEX_POINT('NONE', #30); |  | ||||||
| #32 = CARTESIAN_POINT('NONE', (0.06448028432509392, 0, -0)); |  | ||||||
| #33 = VERTEX_POINT('NONE', #32); |  | ||||||
| #34 = CARTESIAN_POINT('NONE', (0.06448028432509392, 0, 0.1016)); |  | ||||||
| #35 = VERTEX_POINT('NONE', #34); |  | ||||||
| #36 = CARTESIAN_POINT('NONE', (0.14618599799650817, 0.03810000000000001, -0)); |  | ||||||
| #37 = VERTEX_POINT('NONE', #36); |  | ||||||
| #38 = CARTESIAN_POINT('NONE', (0.14618599799650817, 0.03810000000000001, 0.1016)); |  | ||||||
| #39 = VERTEX_POINT('NONE', #38); |  | ||||||
| #40 = CARTESIAN_POINT('NONE', (0.2413, 0.0381, -0)); |  | ||||||
| #41 = VERTEX_POINT('NONE', #40); |  | ||||||
| #42 = CARTESIAN_POINT('NONE', (0.2413, 0.0381, 0.1016)); |  | ||||||
| #43 = VERTEX_POINT('NONE', #42); |  | ||||||
| #44 = CARTESIAN_POINT('NONE', (0.2413, 0.0508, -0)); |  | ||||||
| #45 = VERTEX_POINT('NONE', #44); |  | ||||||
| #46 = CARTESIAN_POINT('NONE', (0.2413, 0.0508, 0.1016)); |  | ||||||
| #47 = VERTEX_POINT('NONE', #46); |  | ||||||
| #48 = CARTESIAN_POINT('NONE', (0.14337047578094278, 0.0508, -0)); |  | ||||||
| #49 = VERTEX_POINT('NONE', #48); |  | ||||||
| #50 = CARTESIAN_POINT('NONE', (0.14337047578094278, 0.0508, 0.1016)); |  | ||||||
| #51 = VERTEX_POINT('NONE', #50); |  | ||||||
| #52 = CARTESIAN_POINT('NONE', (0.08889999999999999, 0.0254, -0)); |  | ||||||
| #53 = VERTEX_POINT('NONE', #52); |  | ||||||
| #54 = CARTESIAN_POINT('NONE', (0.08889999999999999, 0.0254, 0.1016)); |  | ||||||
| #55 = VERTEX_POINT('NONE', #54); |  | ||||||
| #56 = CARTESIAN_POINT('NONE', (0, 0.0254, -0)); |  | ||||||
| #57 = VERTEX_POINT('NONE', #56); |  | ||||||
| #58 = CARTESIAN_POINT('NONE', (0, 0.0254, 0.1016)); |  | ||||||
| #59 = VERTEX_POINT('NONE', #58); |  | ||||||
| #60 = DIRECTION('NONE', (0, -1, 0)); |  | ||||||
| #61 = VECTOR('NONE', #60, 1); |  | ||||||
| #62 = CARTESIAN_POINT('NONE', (0, 0, -0)); |  | ||||||
| #63 = LINE('NONE', #62, #61); |  | ||||||
| #64 = DIRECTION('NONE', (0, 0, 1)); |  | ||||||
| #65 = VECTOR('NONE', #64, 1); |  | ||||||
| #66 = CARTESIAN_POINT('NONE', (0, -0.0254, -0)); |  | ||||||
| #67 = LINE('NONE', #66, #65); |  | ||||||
| #68 = DIRECTION('NONE', (0, -1, 0)); |  | ||||||
| #69 = VECTOR('NONE', #68, 1); |  | ||||||
| #70 = CARTESIAN_POINT('NONE', (0, 0, 0.1016)); |  | ||||||
| #71 = LINE('NONE', #70, #69); |  | ||||||
| #72 = DIRECTION('NONE', (0, 0, 1)); |  | ||||||
| #73 = VECTOR('NONE', #72, 1); |  | ||||||
| #74 = CARTESIAN_POINT('NONE', (0, 0, -0)); |  | ||||||
| #75 = LINE('NONE', #74, #73); |  | ||||||
| #76 = DIRECTION('NONE', (1, 0, 0)); |  | ||||||
| #77 = VECTOR('NONE', #76, 1); |  | ||||||
| #78 = CARTESIAN_POINT('NONE', (0, -0.0254, -0)); |  | ||||||
| #79 = LINE('NONE', #78, #77); |  | ||||||
| #80 = DIRECTION('NONE', (0, 0, 1)); |  | ||||||
| #81 = VECTOR('NONE', #80, 1); |  | ||||||
| #82 = CARTESIAN_POINT('NONE', (0.07861346939195568, -0.0254, -0)); |  | ||||||
| #83 = LINE('NONE', #82, #81); |  | ||||||
| #84 = DIRECTION('NONE', (1, 0, 0)); |  | ||||||
| #85 = VECTOR('NONE', #84, 1); |  | ||||||
| #86 = CARTESIAN_POINT('NONE', (0, -0.0254, 0.1016)); |  | ||||||
| #87 = LINE('NONE', #86, #85); |  | ||||||
| #88 = DIRECTION('NONE', (0.8191520442889919, -0.5735764363510459, 0)); |  | ||||||
| #89 = VECTOR('NONE', #88, 1); |  | ||||||
| #90 = CARTESIAN_POINT('NONE', (0.07861346939195568, -0.0254, -0)); |  | ||||||
| #91 = LINE('NONE', #90, #89); |  | ||||||
| #92 = DIRECTION('NONE', (0, 0, 1)); |  | ||||||
| #93 = VECTOR('NONE', #92, 1); |  | ||||||
| #94 = CARTESIAN_POINT('NONE', (0.1511633881344551, -0.07619999999999998, -0)); |  | ||||||
| #95 = LINE('NONE', #94, #93); |  | ||||||
| #96 = DIRECTION('NONE', (0.8191520442889919, -0.5735764363510459, 0)); |  | ||||||
| #97 = VECTOR('NONE', #96, 1); |  | ||||||
| #98 = CARTESIAN_POINT('NONE', (0.07861346939195568, -0.0254, 0.1016)); |  | ||||||
| #99 = LINE('NONE', #98, #97); |  | ||||||
| #100 = DIRECTION('NONE', (1, -0.0000000000000003079278779307945, 0)); |  | ||||||
| #101 = VECTOR('NONE', #100, 1); |  | ||||||
| #102 = CARTESIAN_POINT('NONE', (0.1511633881344551, -0.07619999999999998, -0)); |  | ||||||
| #103 = LINE('NONE', #102, #101); |  | ||||||
| #104 = DIRECTION('NONE', (0, 0, 1)); |  | ||||||
| #105 = VECTOR('NONE', #104, 1); |  | ||||||
| #106 = CARTESIAN_POINT('NONE', (0.2413, -0.0762, -0)); |  | ||||||
| #107 = LINE('NONE', #106, #105); |  | ||||||
| #108 = DIRECTION('NONE', (1, -0.0000000000000003079278779307945, 0)); |  | ||||||
| #109 = VECTOR('NONE', #108, 1); |  | ||||||
| #110 = CARTESIAN_POINT('NONE', (0.1511633881344551, -0.07619999999999998, 0.1016)); |  | ||||||
| #111 = LINE('NONE', #110, #109); |  | ||||||
| #112 = DIRECTION('NONE', (0, 1, 0)); |  | ||||||
| #113 = VECTOR('NONE', #112, 1); |  | ||||||
| #114 = CARTESIAN_POINT('NONE', (0.2413, -0.0762, -0)); |  | ||||||
| #115 = LINE('NONE', #114, #113); |  | ||||||
| #116 = DIRECTION('NONE', (0, 0, 1)); |  | ||||||
| #117 = VECTOR('NONE', #116, 1); |  | ||||||
| #118 = CARTESIAN_POINT('NONE', (0.2413, -0.0635, -0)); |  | ||||||
| #119 = LINE('NONE', #118, #117); |  | ||||||
| #120 = DIRECTION('NONE', (0, 1, 0)); |  | ||||||
| #121 = VECTOR('NONE', #120, 1); |  | ||||||
| #122 = CARTESIAN_POINT('NONE', (0.2413, -0.0762, 0.1016)); |  | ||||||
| #123 = LINE('NONE', #122, #121); |  | ||||||
| #124 = DIRECTION('NONE', (-1, 0, 0)); |  | ||||||
| #125 = VECTOR('NONE', #124, 1); |  | ||||||
| #126 = CARTESIAN_POINT('NONE', (0.2413, -0.0635, -0)); |  | ||||||
| #127 = LINE('NONE', #126, #125); |  | ||||||
| #128 = DIRECTION('NONE', (0, 0, 1)); |  | ||||||
| #129 = VECTOR('NONE', #128, 1); |  | ||||||
| #130 = CARTESIAN_POINT('NONE', (0.1551676827532182, -0.0635, -0)); |  | ||||||
| #131 = LINE('NONE', #130, #129); |  | ||||||
| #132 = DIRECTION('NONE', (-1, 0, 0)); |  | ||||||
| #133 = VECTOR('NONE', #132, 1); |  | ||||||
| #134 = CARTESIAN_POINT('NONE', (0.2413, -0.0635, 0.1016)); |  | ||||||
| #135 = LINE('NONE', #134, #133); |  | ||||||
| #136 = DIRECTION('NONE', (-0.8191520442889919, 0.573576436351046, 0)); |  | ||||||
| #137 = VECTOR('NONE', #136, 1); |  | ||||||
| #138 = CARTESIAN_POINT('NONE', (0.1551676827532182, -0.0635, -0)); |  | ||||||
| #139 = LINE('NONE', #138, #137); |  | ||||||
| #140 = DIRECTION('NONE', (0, 0, 1)); |  | ||||||
| #141 = VECTOR('NONE', #140, 1); |  | ||||||
| #142 = CARTESIAN_POINT('NONE', (0.06448028432509392, 0, -0)); |  | ||||||
| #143 = LINE('NONE', #142, #141); |  | ||||||
| #144 = DIRECTION('NONE', (-0.8191520442889919, 0.573576436351046, 0)); |  | ||||||
| #145 = VECTOR('NONE', #144, 1); |  | ||||||
| #146 = CARTESIAN_POINT('NONE', (0.1551676827532182, -0.0635, 0.1016)); |  | ||||||
| #147 = LINE('NONE', #146, #145); |  | ||||||
| #148 = DIRECTION('NONE', (0.90630778703665, 0.4226182617406993, 0)); |  | ||||||
| #149 = VECTOR('NONE', #148, 1); |  | ||||||
| #150 = CARTESIAN_POINT('NONE', (0.06448028432509392, 0, -0)); |  | ||||||
| #151 = LINE('NONE', #150, #149); |  | ||||||
| #152 = DIRECTION('NONE', (0, 0, 1)); |  | ||||||
| #153 = VECTOR('NONE', #152, 1); |  | ||||||
| #154 = CARTESIAN_POINT('NONE', (0.14618599799650817, 0.03810000000000001, -0)); |  | ||||||
| #155 = LINE('NONE', #154, #153); |  | ||||||
| #156 = DIRECTION('NONE', (0.90630778703665, 0.4226182617406993, 0)); |  | ||||||
| #157 = VECTOR('NONE', #156, 1); |  | ||||||
| #158 = CARTESIAN_POINT('NONE', (0.06448028432509392, 0, 0.1016)); |  | ||||||
| #159 = LINE('NONE', #158, #157); |  | ||||||
| #160 = DIRECTION('NONE', (1, -0.00000000000000007295344279228718, 0)); |  | ||||||
| #161 = VECTOR('NONE', #160, 1); |  | ||||||
| #162 = CARTESIAN_POINT('NONE', (0.14618599799650817, 0.03810000000000001, -0)); |  | ||||||
| #163 = LINE('NONE', #162, #161); |  | ||||||
| #164 = DIRECTION('NONE', (0, 0, 1)); |  | ||||||
| #165 = VECTOR('NONE', #164, 1); |  | ||||||
| #166 = CARTESIAN_POINT('NONE', (0.2413, 0.0381, -0)); |  | ||||||
| #167 = LINE('NONE', #166, #165); |  | ||||||
| #168 = DIRECTION('NONE', (1, -0.00000000000000007295344279228718, 0)); |  | ||||||
| #169 = VECTOR('NONE', #168, 1); |  | ||||||
| #170 = CARTESIAN_POINT('NONE', (0.14618599799650817, 0.03810000000000001, 0.1016)); |  | ||||||
| #171 = LINE('NONE', #170, #169); |  | ||||||
| #172 = DIRECTION('NONE', (0, 1, 0)); |  | ||||||
| #173 = VECTOR('NONE', #172, 1); |  | ||||||
| #174 = CARTESIAN_POINT('NONE', (0.2413, 0.0381, -0)); |  | ||||||
| #175 = LINE('NONE', #174, #173); |  | ||||||
| #176 = DIRECTION('NONE', (0, 0, 1)); |  | ||||||
| #177 = VECTOR('NONE', #176, 1); |  | ||||||
| #178 = CARTESIAN_POINT('NONE', (0.2413, 0.0508, -0)); |  | ||||||
| #179 = LINE('NONE', #178, #177); |  | ||||||
| #180 = DIRECTION('NONE', (0, 1, 0)); |  | ||||||
| #181 = VECTOR('NONE', #180, 1); |  | ||||||
| #182 = CARTESIAN_POINT('NONE', (0.2413, 0.0381, 0.1016)); |  | ||||||
| #183 = LINE('NONE', #182, #181); |  | ||||||
| #184 = DIRECTION('NONE', (-1, 0, 0)); |  | ||||||
| #185 = VECTOR('NONE', #184, 1); |  | ||||||
| #186 = CARTESIAN_POINT('NONE', (0.2413, 0.0508, -0)); |  | ||||||
| #187 = LINE('NONE', #186, #185); |  | ||||||
| #188 = DIRECTION('NONE', (0, 0, 1)); |  | ||||||
| #189 = VECTOR('NONE', #188, 1); |  | ||||||
| #190 = CARTESIAN_POINT('NONE', (0.14337047578094278, 0.0508, -0)); |  | ||||||
| #191 = LINE('NONE', #190, #189); |  | ||||||
| #192 = DIRECTION('NONE', (-1, 0, 0)); |  | ||||||
| #193 = VECTOR('NONE', #192, 1); |  | ||||||
| #194 = CARTESIAN_POINT('NONE', (0.2413, 0.0508, 0.1016)); |  | ||||||
| #195 = LINE('NONE', #194, #193); |  | ||||||
| #196 = DIRECTION('NONE', (-0.90630778703665, -0.42261826174069944, 0)); |  | ||||||
| #197 = VECTOR('NONE', #196, 1); |  | ||||||
| #198 = CARTESIAN_POINT('NONE', (0.14337047578094278, 0.0508, -0)); |  | ||||||
| #199 = LINE('NONE', #198, #197); |  | ||||||
| #200 = DIRECTION('NONE', (0, 0, 1)); |  | ||||||
| #201 = VECTOR('NONE', #200, 1); |  | ||||||
| #202 = CARTESIAN_POINT('NONE', (0.08889999999999999, 0.0254, -0)); |  | ||||||
| #203 = LINE('NONE', #202, #201); |  | ||||||
| #204 = DIRECTION('NONE', (-0.90630778703665, -0.42261826174069944, 0)); |  | ||||||
| #205 = VECTOR('NONE', #204, 1); |  | ||||||
| #206 = CARTESIAN_POINT('NONE', (0.14337047578094278, 0.0508, 0.1016)); |  | ||||||
| #207 = LINE('NONE', #206, #205); |  | ||||||
| #208 = DIRECTION('NONE', (-1, 0, 0)); |  | ||||||
| #209 = VECTOR('NONE', #208, 1); |  | ||||||
| #210 = CARTESIAN_POINT('NONE', (0.08889999999999999, 0.0254, -0)); |  | ||||||
| #211 = LINE('NONE', #210, #209); |  | ||||||
| #212 = DIRECTION('NONE', (0, 0, 1)); |  | ||||||
| #213 = VECTOR('NONE', #212, 1); |  | ||||||
| #214 = CARTESIAN_POINT('NONE', (0, 0.0254, -0)); |  | ||||||
| #215 = LINE('NONE', #214, #213); |  | ||||||
| #216 = DIRECTION('NONE', (-1, 0, 0)); |  | ||||||
| #217 = VECTOR('NONE', #216, 1); |  | ||||||
| #218 = CARTESIAN_POINT('NONE', (0.08889999999999999, 0.0254, 0.1016)); |  | ||||||
| #219 = LINE('NONE', #218, #217); |  | ||||||
| #220 = DIRECTION('NONE', (0, -1, 0)); |  | ||||||
| #221 = VECTOR('NONE', #220, 1); |  | ||||||
| #222 = CARTESIAN_POINT('NONE', (0, 0.0254, -0)); |  | ||||||
| #223 = LINE('NONE', #222, #221); |  | ||||||
| #224 = DIRECTION('NONE', (0, -1, 0)); |  | ||||||
| #225 = VECTOR('NONE', #224, 1); |  | ||||||
| #226 = CARTESIAN_POINT('NONE', (0, 0.0254, 0.1016)); |  | ||||||
| #227 = LINE('NONE', #226, #225); |  | ||||||
| #228 = EDGE_CURVE('NONE', #5, #7, #63, .T.); |  | ||||||
| #229 = EDGE_CURVE('NONE', #7, #9, #67, .T.); |  | ||||||
| #230 = EDGE_CURVE('NONE', #11, #9, #71, .T.); |  | ||||||
| #231 = EDGE_CURVE('NONE', #5, #11, #75, .T.); |  | ||||||
| #232 = EDGE_CURVE('NONE', #7, #13, #79, .T.); |  | ||||||
| #233 = EDGE_CURVE('NONE', #13, #15, #83, .T.); |  | ||||||
| #234 = EDGE_CURVE('NONE', #9, #15, #87, .T.); |  | ||||||
| #235 = EDGE_CURVE('NONE', #13, #17, #91, .T.); |  | ||||||
| #236 = EDGE_CURVE('NONE', #17, #19, #95, .T.); |  | ||||||
| #237 = EDGE_CURVE('NONE', #15, #19, #99, .T.); |  | ||||||
| #238 = EDGE_CURVE('NONE', #17, #21, #103, .T.); |  | ||||||
| #239 = EDGE_CURVE('NONE', #21, #23, #107, .T.); |  | ||||||
| #240 = EDGE_CURVE('NONE', #19, #23, #111, .T.); |  | ||||||
| #241 = EDGE_CURVE('NONE', #21, #25, #115, .T.); |  | ||||||
| #242 = EDGE_CURVE('NONE', #25, #27, #119, .T.); |  | ||||||
| #243 = EDGE_CURVE('NONE', #23, #27, #123, .T.); |  | ||||||
| #244 = EDGE_CURVE('NONE', #25, #29, #127, .T.); |  | ||||||
| #245 = EDGE_CURVE('NONE', #29, #31, #131, .T.); |  | ||||||
| #246 = EDGE_CURVE('NONE', #27, #31, #135, .T.); |  | ||||||
| #247 = EDGE_CURVE('NONE', #29, #33, #139, .T.); |  | ||||||
| #248 = EDGE_CURVE('NONE', #33, #35, #143, .T.); |  | ||||||
| #249 = EDGE_CURVE('NONE', #31, #35, #147, .T.); |  | ||||||
| #250 = EDGE_CURVE('NONE', #33, #37, #151, .T.); |  | ||||||
| #251 = EDGE_CURVE('NONE', #37, #39, #155, .T.); |  | ||||||
| #252 = EDGE_CURVE('NONE', #35, #39, #159, .T.); |  | ||||||
| #253 = EDGE_CURVE('NONE', #37, #41, #163, .T.); |  | ||||||
| #254 = EDGE_CURVE('NONE', #41, #43, #167, .T.); |  | ||||||
| #255 = EDGE_CURVE('NONE', #39, #43, #171, .T.); |  | ||||||
| #256 = EDGE_CURVE('NONE', #41, #45, #175, .T.); |  | ||||||
| #257 = EDGE_CURVE('NONE', #45, #47, #179, .T.); |  | ||||||
| #258 = EDGE_CURVE('NONE', #43, #47, #183, .T.); |  | ||||||
| #259 = EDGE_CURVE('NONE', #45, #49, #187, .T.); |  | ||||||
| #260 = EDGE_CURVE('NONE', #49, #51, #191, .T.); |  | ||||||
| #261 = EDGE_CURVE('NONE', #47, #51, #195, .T.); |  | ||||||
| #262 = EDGE_CURVE('NONE', #49, #53, #199, .T.); |  | ||||||
| #263 = EDGE_CURVE('NONE', #53, #55, #203, .T.); |  | ||||||
| #264 = EDGE_CURVE('NONE', #51, #55, #207, .T.); |  | ||||||
| #265 = EDGE_CURVE('NONE', #53, #57, #211, .T.); |  | ||||||
| #266 = EDGE_CURVE('NONE', #57, #59, #215, .T.); |  | ||||||
| #267 = EDGE_CURVE('NONE', #55, #59, #219, .T.); |  | ||||||
| #268 = EDGE_CURVE('NONE', #57, #5, #223, .T.); |  | ||||||
| #269 = EDGE_CURVE('NONE', #59, #11, #227, .T.); |  | ||||||
| #270 = ORIENTED_EDGE('NONE', *, *, #228, .T.); |  | ||||||
| #271 = ORIENTED_EDGE('NONE', *, *, #229, .T.); |  | ||||||
| #272 = ORIENTED_EDGE('NONE', *, *, #230, .F.); |  | ||||||
| #273 = ORIENTED_EDGE('NONE', *, *, #231, .F.); |  | ||||||
| #274 = EDGE_LOOP('NONE', (#270, #271, #272, #273)); |  | ||||||
| #275 = ORIENTED_EDGE('NONE', *, *, #232, .T.); |  | ||||||
| #276 = ORIENTED_EDGE('NONE', *, *, #233, .T.); |  | ||||||
| #277 = ORIENTED_EDGE('NONE', *, *, #234, .F.); |  | ||||||
| #278 = ORIENTED_EDGE('NONE', *, *, #229, .F.); |  | ||||||
| #279 = EDGE_LOOP('NONE', (#275, #276, #277, #278)); |  | ||||||
| #280 = ORIENTED_EDGE('NONE', *, *, #235, .T.); |  | ||||||
| #281 = ORIENTED_EDGE('NONE', *, *, #236, .T.); |  | ||||||
| #282 = ORIENTED_EDGE('NONE', *, *, #237, .F.); |  | ||||||
| #283 = ORIENTED_EDGE('NONE', *, *, #233, .F.); |  | ||||||
| #284 = EDGE_LOOP('NONE', (#280, #281, #282, #283)); |  | ||||||
| #285 = ORIENTED_EDGE('NONE', *, *, #238, .T.); |  | ||||||
| #286 = ORIENTED_EDGE('NONE', *, *, #239, .T.); |  | ||||||
| #287 = ORIENTED_EDGE('NONE', *, *, #240, .F.); |  | ||||||
| #288 = ORIENTED_EDGE('NONE', *, *, #236, .F.); |  | ||||||
| #289 = EDGE_LOOP('NONE', (#285, #286, #287, #288)); |  | ||||||
| #290 = ORIENTED_EDGE('NONE', *, *, #241, .T.); |  | ||||||
| #291 = ORIENTED_EDGE('NONE', *, *, #242, .T.); |  | ||||||
| #292 = ORIENTED_EDGE('NONE', *, *, #243, .F.); |  | ||||||
| #293 = ORIENTED_EDGE('NONE', *, *, #239, .F.); |  | ||||||
| #294 = EDGE_LOOP('NONE', (#290, #291, #292, #293)); |  | ||||||
| #295 = ORIENTED_EDGE('NONE', *, *, #244, .T.); |  | ||||||
| #296 = ORIENTED_EDGE('NONE', *, *, #245, .T.); |  | ||||||
| #297 = ORIENTED_EDGE('NONE', *, *, #246, .F.); |  | ||||||
| #298 = ORIENTED_EDGE('NONE', *, *, #242, .F.); |  | ||||||
| #299 = EDGE_LOOP('NONE', (#295, #296, #297, #298)); |  | ||||||
| #300 = ORIENTED_EDGE('NONE', *, *, #247, .T.); |  | ||||||
| #301 = ORIENTED_EDGE('NONE', *, *, #248, .T.); |  | ||||||
| #302 = ORIENTED_EDGE('NONE', *, *, #249, .F.); |  | ||||||
| #303 = ORIENTED_EDGE('NONE', *, *, #245, .F.); |  | ||||||
| #304 = EDGE_LOOP('NONE', (#300, #301, #302, #303)); |  | ||||||
| #305 = ORIENTED_EDGE('NONE', *, *, #250, .T.); |  | ||||||
| #306 = ORIENTED_EDGE('NONE', *, *, #251, .T.); |  | ||||||
| #307 = ORIENTED_EDGE('NONE', *, *, #252, .F.); |  | ||||||
| #308 = ORIENTED_EDGE('NONE', *, *, #248, .F.); |  | ||||||
| #309 = EDGE_LOOP('NONE', (#305, #306, #307, #308)); |  | ||||||
| #310 = ORIENTED_EDGE('NONE', *, *, #253, .T.); |  | ||||||
| #311 = ORIENTED_EDGE('NONE', *, *, #254, .T.); |  | ||||||
| #312 = ORIENTED_EDGE('NONE', *, *, #255, .F.); |  | ||||||
| #313 = ORIENTED_EDGE('NONE', *, *, #251, .F.); |  | ||||||
| #314 = EDGE_LOOP('NONE', (#310, #311, #312, #313)); |  | ||||||
| #315 = ORIENTED_EDGE('NONE', *, *, #256, .T.); |  | ||||||
| #316 = ORIENTED_EDGE('NONE', *, *, #257, .T.); |  | ||||||
| #317 = ORIENTED_EDGE('NONE', *, *, #258, .F.); |  | ||||||
| #318 = ORIENTED_EDGE('NONE', *, *, #254, .F.); |  | ||||||
| #319 = EDGE_LOOP('NONE', (#315, #316, #317, #318)); |  | ||||||
| #320 = ORIENTED_EDGE('NONE', *, *, #259, .T.); |  | ||||||
| #321 = ORIENTED_EDGE('NONE', *, *, #260, .T.); |  | ||||||
| #322 = ORIENTED_EDGE('NONE', *, *, #261, .F.); |  | ||||||
| #323 = ORIENTED_EDGE('NONE', *, *, #257, .F.); |  | ||||||
| #324 = EDGE_LOOP('NONE', (#320, #321, #322, #323)); |  | ||||||
| #325 = ORIENTED_EDGE('NONE', *, *, #262, .T.); |  | ||||||
| #326 = ORIENTED_EDGE('NONE', *, *, #263, .T.); |  | ||||||
| #327 = ORIENTED_EDGE('NONE', *, *, #264, .F.); |  | ||||||
| #328 = ORIENTED_EDGE('NONE', *, *, #260, .F.); |  | ||||||
| #329 = EDGE_LOOP('NONE', (#325, #326, #327, #328)); |  | ||||||
| #330 = ORIENTED_EDGE('NONE', *, *, #265, .T.); |  | ||||||
| #331 = ORIENTED_EDGE('NONE', *, *, #266, .T.); |  | ||||||
| #332 = ORIENTED_EDGE('NONE', *, *, #267, .F.); |  | ||||||
| #333 = ORIENTED_EDGE('NONE', *, *, #263, .F.); |  | ||||||
| #334 = EDGE_LOOP('NONE', (#330, #331, #332, #333)); |  | ||||||
| #335 = ORIENTED_EDGE('NONE', *, *, #268, .T.); |  | ||||||
| #336 = ORIENTED_EDGE('NONE', *, *, #231, .T.); |  | ||||||
| #337 = ORIENTED_EDGE('NONE', *, *, #269, .F.); |  | ||||||
| #338 = ORIENTED_EDGE('NONE', *, *, #266, .F.); |  | ||||||
| #339 = EDGE_LOOP('NONE', (#335, #336, #337, #338)); |  | ||||||
| #340 = ORIENTED_EDGE('NONE', *, *, #228, .T.); |  | ||||||
| #341 = ORIENTED_EDGE('NONE', *, *, #232, .T.); |  | ||||||
| #342 = ORIENTED_EDGE('NONE', *, *, #235, .T.); |  | ||||||
| #343 = ORIENTED_EDGE('NONE', *, *, #238, .T.); |  | ||||||
| #344 = ORIENTED_EDGE('NONE', *, *, #241, .T.); |  | ||||||
| #345 = ORIENTED_EDGE('NONE', *, *, #244, .T.); |  | ||||||
| #346 = ORIENTED_EDGE('NONE', *, *, #247, .T.); |  | ||||||
| #347 = ORIENTED_EDGE('NONE', *, *, #250, .T.); |  | ||||||
| #348 = ORIENTED_EDGE('NONE', *, *, #253, .T.); |  | ||||||
| #349 = ORIENTED_EDGE('NONE', *, *, #256, .T.); |  | ||||||
| #350 = ORIENTED_EDGE('NONE', *, *, #259, .T.); |  | ||||||
| #351 = ORIENTED_EDGE('NONE', *, *, #262, .T.); |  | ||||||
| #352 = ORIENTED_EDGE('NONE', *, *, #265, .T.); |  | ||||||
| #353 = ORIENTED_EDGE('NONE', *, *, #268, .T.); |  | ||||||
| #354 = EDGE_LOOP('NONE', (#340, #341, #342, #343, #344, #345, #346, #347, #348, #349, #350, #351, #352, #353)); |  | ||||||
| #355 = ORIENTED_EDGE('NONE', *, *, #230, .T.); |  | ||||||
| #356 = ORIENTED_EDGE('NONE', *, *, #234, .T.); |  | ||||||
| #357 = ORIENTED_EDGE('NONE', *, *, #237, .T.); |  | ||||||
| #358 = ORIENTED_EDGE('NONE', *, *, #240, .T.); |  | ||||||
| #359 = ORIENTED_EDGE('NONE', *, *, #243, .T.); |  | ||||||
| #360 = ORIENTED_EDGE('NONE', *, *, #246, .T.); |  | ||||||
| #361 = ORIENTED_EDGE('NONE', *, *, #249, .T.); |  | ||||||
| #362 = ORIENTED_EDGE('NONE', *, *, #252, .T.); |  | ||||||
| #363 = ORIENTED_EDGE('NONE', *, *, #255, .T.); |  | ||||||
| #364 = ORIENTED_EDGE('NONE', *, *, #258, .T.); |  | ||||||
| #365 = ORIENTED_EDGE('NONE', *, *, #261, .T.); |  | ||||||
| #366 = ORIENTED_EDGE('NONE', *, *, #264, .T.); |  | ||||||
| #367 = ORIENTED_EDGE('NONE', *, *, #267, .T.); |  | ||||||
| #368 = ORIENTED_EDGE('NONE', *, *, #269, .T.); |  | ||||||
| #369 = EDGE_LOOP('NONE', (#355, #356, #357, #358, #359, #360, #361, #362, #363, #364, #365, #366, #367, #368)); |  | ||||||
| #370 = CARTESIAN_POINT('NONE', (0, -0.0127, 0.0508)); |  | ||||||
| #371 = DIRECTION('NONE', (-1, -0, 0)); |  | ||||||
| #372 = AXIS2_PLACEMENT_3D('NONE', #370, #371, $); |  | ||||||
| #373 = PLANE('NONE', #372); |  | ||||||
| #374 = CARTESIAN_POINT('NONE', (0.039306734695977924, -0.025399999999999995, 0.0508)); |  | ||||||
| #375 = DIRECTION('NONE', (0, -1, 0)); |  | ||||||
| #376 = AXIS2_PLACEMENT_3D('NONE', #374, #375, $); |  | ||||||
| #377 = PLANE('NONE', #376); |  | ||||||
| #378 = CARTESIAN_POINT('NONE', (0.11488842876320533, -0.05079999999999996, 0.05079999999999999)); |  | ||||||
| #379 = DIRECTION('NONE', (-0.5735764363510459, -0.8191520442889919, 0)); |  | ||||||
| #380 = AXIS2_PLACEMENT_3D('NONE', #378, #379, $); |  | ||||||
| #381 = PLANE('NONE', #380); |  | ||||||
| #382 = CARTESIAN_POINT('NONE', (0.19623169406722757, -0.07619999999999999, 0.0508)); |  | ||||||
| #383 = DIRECTION('NONE', (0, -1, 0)); |  | ||||||
| #384 = AXIS2_PLACEMENT_3D('NONE', #382, #383, $); |  | ||||||
| #385 = PLANE('NONE', #384); |  | ||||||
| #386 = CARTESIAN_POINT('NONE', (0.2413, -0.06985, 0.0508)); |  | ||||||
| #387 = DIRECTION('NONE', (1, -0, 0)); |  | ||||||
| #388 = AXIS2_PLACEMENT_3D('NONE', #386, #387, $); |  | ||||||
| #389 = PLANE('NONE', #388); |  | ||||||
| #390 = CARTESIAN_POINT('NONE', (0.19823384137660915, -0.0635, 0.0508)); |  | ||||||
| #391 = DIRECTION('NONE', (0, 1, -0)); |  | ||||||
| #392 = AXIS2_PLACEMENT_3D('NONE', #390, #391, $); |  | ||||||
| #393 = PLANE('NONE', #392); |  | ||||||
| #394 = CARTESIAN_POINT('NONE', (0.10982398353915601, -0.03174999999999997, 0.0508)); |  | ||||||
| #395 = DIRECTION('NONE', (0.5735764363510459, 0.8191520442889917, -0)); |  | ||||||
| #396 = AXIS2_PLACEMENT_3D('NONE', #394, #395, $); |  | ||||||
| #397 = PLANE('NONE', #396); |  | ||||||
| #398 = CARTESIAN_POINT('NONE', (0.105333141160801, 0.019049999999999987, 0.0508)); |  | ||||||
| #399 = DIRECTION('NONE', (0.4226182617406993, -0.90630778703665, 0)); |  | ||||||
| #400 = AXIS2_PLACEMENT_3D('NONE', #398, #399, $); |  | ||||||
| #401 = PLANE('NONE', #400); |  | ||||||
| #402 = CARTESIAN_POINT('NONE', (0.19374299899825406, 0.0381, 0.0508)); |  | ||||||
| #403 = DIRECTION('NONE', (0, -1, 0)); |  | ||||||
| #404 = AXIS2_PLACEMENT_3D('NONE', #402, #403, $); |  | ||||||
| #405 = PLANE('NONE', #404); |  | ||||||
| #406 = CARTESIAN_POINT('NONE', (0.2413, 0.044449999999999996, 0.0508)); |  | ||||||
| #407 = DIRECTION('NONE', (1, -0, 0)); |  | ||||||
| #408 = AXIS2_PLACEMENT_3D('NONE', #406, #407, $); |  | ||||||
| #409 = PLANE('NONE', #408); |  | ||||||
| #410 = CARTESIAN_POINT('NONE', (0.19233523789047138, 0.0508, 0.0508)); |  | ||||||
| #411 = DIRECTION('NONE', (0, 1, -0)); |  | ||||||
| #412 = AXIS2_PLACEMENT_3D('NONE', #410, #411, $); |  | ||||||
| #413 = PLANE('NONE', #412); |  | ||||||
| #414 = CARTESIAN_POINT('NONE', (0.11613523789047137, 0.0381, 0.05079999999999999)); |  | ||||||
| #415 = DIRECTION('NONE', (-0.42261826174069966, 0.90630778703665, -0)); |  | ||||||
| #416 = AXIS2_PLACEMENT_3D('NONE', #414, #415, $); |  | ||||||
| #417 = PLANE('NONE', #416); |  | ||||||
| #418 = CARTESIAN_POINT('NONE', (0.044449999999999996, 0.0254, 0.0508)); |  | ||||||
| #419 = DIRECTION('NONE', (0, 1, -0)); |  | ||||||
| #420 = AXIS2_PLACEMENT_3D('NONE', #418, #419, $); |  | ||||||
| #421 = PLANE('NONE', #420); |  | ||||||
| #422 = CARTESIAN_POINT('NONE', (0, 0.0127, 0.0508)); |  | ||||||
| #423 = DIRECTION('NONE', (-1, -0, 0)); |  | ||||||
| #424 = AXIS2_PLACEMENT_3D('NONE', #422, #423, $); |  | ||||||
| #425 = PLANE('NONE', #424); |  | ||||||
| #426 = CARTESIAN_POINT('NONE', (0, 0, -0)); |  | ||||||
| #427 = DIRECTION('NONE', (0, 0, 1)); |  | ||||||
| #428 = AXIS2_PLACEMENT_3D('NONE', #426, #427, $); |  | ||||||
| #429 = PLANE('NONE', #428); |  | ||||||
| #430 = CARTESIAN_POINT('NONE', (0, 0, 0.1016)); |  | ||||||
| #431 = DIRECTION('NONE', (0, 0, 1)); |  | ||||||
| #432 = AXIS2_PLACEMENT_3D('NONE', #430, #431, $); |  | ||||||
| #433 = PLANE('NONE', #432); |  | ||||||
| #434 = FACE_OUTER_BOUND('NONE', #274, .T.); |  | ||||||
| #435 = ADVANCED_FACE('NONE', (#434), #373, .T.); |  | ||||||
| #436 = FACE_OUTER_BOUND('NONE', #279, .T.); |  | ||||||
| #437 = ADVANCED_FACE('NONE', (#436), #377, .T.); |  | ||||||
| #438 = FACE_OUTER_BOUND('NONE', #284, .T.); |  | ||||||
| #439 = ADVANCED_FACE('NONE', (#438), #381, .T.); |  | ||||||
| #440 = FACE_OUTER_BOUND('NONE', #289, .T.); |  | ||||||
| #441 = ADVANCED_FACE('NONE', (#440), #385, .T.); |  | ||||||
| #442 = FACE_OUTER_BOUND('NONE', #294, .T.); |  | ||||||
| #443 = ADVANCED_FACE('NONE', (#442), #389, .T.); |  | ||||||
| #444 = FACE_OUTER_BOUND('NONE', #299, .T.); |  | ||||||
| #445 = ADVANCED_FACE('NONE', (#444), #393, .T.); |  | ||||||
| #446 = FACE_OUTER_BOUND('NONE', #304, .T.); |  | ||||||
| #447 = ADVANCED_FACE('NONE', (#446), #397, .T.); |  | ||||||
| #448 = FACE_OUTER_BOUND('NONE', #309, .T.); |  | ||||||
| #449 = ADVANCED_FACE('NONE', (#448), #401, .T.); |  | ||||||
| #450 = FACE_OUTER_BOUND('NONE', #314, .T.); |  | ||||||
| #451 = ADVANCED_FACE('NONE', (#450), #405, .T.); |  | ||||||
| #452 = FACE_OUTER_BOUND('NONE', #319, .T.); |  | ||||||
| #453 = ADVANCED_FACE('NONE', (#452), #409, .T.); |  | ||||||
| #454 = FACE_OUTER_BOUND('NONE', #324, .T.); |  | ||||||
| #455 = ADVANCED_FACE('NONE', (#454), #413, .T.); |  | ||||||
| #456 = FACE_OUTER_BOUND('NONE', #329, .T.); |  | ||||||
| #457 = ADVANCED_FACE('NONE', (#456), #417, .T.); |  | ||||||
| #458 = FACE_OUTER_BOUND('NONE', #334, .T.); |  | ||||||
| #459 = ADVANCED_FACE('NONE', (#458), #421, .T.); |  | ||||||
| #460 = FACE_OUTER_BOUND('NONE', #339, .T.); |  | ||||||
| #461 = ADVANCED_FACE('NONE', (#460), #425, .T.); |  | ||||||
| #462 = FACE_OUTER_BOUND('NONE', #354, .F.); |  | ||||||
| #463 = ADVANCED_FACE('NONE', (#462), #429, .F.); |  | ||||||
| #464 = FACE_OUTER_BOUND('NONE', #369, .T.); |  | ||||||
| #465 = ADVANCED_FACE('NONE', (#464), #433, .T.); |  | ||||||
| #466 = CLOSED_SHELL('NONE', (#435, #437, #439, #441, #443, #445, #447, #449, #451, #453, #455, #457, #459, #461, #463, #465)); |  | ||||||
| #467 = ORIENTED_CLOSED_SHELL('NONE', *, #466, .T.); |  | ||||||
| #468 = MANIFOLD_SOLID_BREP('NONE', #467); |  | ||||||
| #469 = APPLICATION_CONTEXT('configuration controlled 3D design of mechanical parts and assemblies'); |  | ||||||
| #470 = PRODUCT_DEFINITION_CONTEXT('part definition', #469, 'design'); |  | ||||||
| #471 = PRODUCT('UNIDENTIFIED_PRODUCT', 'NONE', $, ()); |  | ||||||
| #472 = PRODUCT_DEFINITION_FORMATION('', $, #471); |  | ||||||
| #473 = PRODUCT_DEFINITION('design', $, #472, #470); |  | ||||||
| #474 = PRODUCT_DEFINITION_SHAPE('NONE', $, #473); |  | ||||||
| #475 = ADVANCED_BREP_SHAPE_REPRESENTATION('NONE', (#468), #3); |  | ||||||
| #476 = SHAPE_DEFINITION_REPRESENTATION(#474, #475); |  | ||||||
| ENDSEC; |  | ||||||
| END-ISO-10303-21; |  | ||||||
| Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 221 KiB | 
| @ -1,478 +0,0 @@ | |||||||
| solid unnamed |  | ||||||
| facet normal -1 0 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 0 -4 0 |  | ||||||
|         vertex 0 -0 0 |  | ||||||
|         vertex 0 -4 -1 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal -1 0 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 0 -4 -1 |  | ||||||
|         vertex 0 -0 0 |  | ||||||
|         vertex 0 -0 -1 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 0 -1 |  | ||||||
|     outer loop |  | ||||||
|         vertex 0 -4 -1 |  | ||||||
|         vertex 0 -0 -1 |  | ||||||
|         vertex 3.0950184 -4 -1 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 0 -1 |  | ||||||
|     outer loop |  | ||||||
|         vertex 3.0950184 -4 -1 |  | ||||||
|         vertex 0 -0 -1 |  | ||||||
|         vertex 3.0950184 -0 -1 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal -0.57357645 0 -0.81915206 |  | ||||||
|     outer loop |  | ||||||
|         vertex 3.0950184 -4 -1 |  | ||||||
|         vertex 3.0950184 -0 -1 |  | ||||||
|         vertex 5.9513144 -4 -3 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal -0.57357645 0 -0.81915206 |  | ||||||
|     outer loop |  | ||||||
|         vertex 5.9513144 -4 -3 |  | ||||||
|         vertex 3.0950184 -0 -1 |  | ||||||
|         vertex 5.9513144 -0 -3 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 0 -1 |  | ||||||
|     outer loop |  | ||||||
|         vertex 5.9513144 -4 -3 |  | ||||||
|         vertex 5.9513144 -0 -3 |  | ||||||
|         vertex 9.5 -4 -3 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 0 -1 |  | ||||||
|     outer loop |  | ||||||
|         vertex 9.5 -4 -3 |  | ||||||
|         vertex 5.9513144 -0 -3 |  | ||||||
|         vertex 9.5 -0 -3 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 1 0 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 9.5 -4 -3 |  | ||||||
|         vertex 9.5 -0 -3 |  | ||||||
|         vertex 9.5 -4 -2.5 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 1 -0 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 9.5 -4 -2.5 |  | ||||||
|         vertex 9.5 -0 -3 |  | ||||||
|         vertex 9.5 -0 -2.5 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 -0 0.99999994 |  | ||||||
|     outer loop |  | ||||||
|         vertex 9.5 -4 -2.5 |  | ||||||
|         vertex 9.5 -0 -2.5 |  | ||||||
|         vertex 6.108964 -4 -2.5 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 0 0.99999994 |  | ||||||
|     outer loop |  | ||||||
|         vertex 6.108964 -4 -2.5 |  | ||||||
|         vertex 9.5 -0 -2.5 |  | ||||||
|         vertex 6.108964 -0 -2.5 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0.5735763 0 0.8191522 |  | ||||||
|     outer loop |  | ||||||
|         vertex 3.4311862 -4 -0.625 |  | ||||||
|         vertex 4.323779 -4 -1.25 |  | ||||||
|         vertex 4.323779 -0 -1.25 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0.57357645 0 0.819152 |  | ||||||
|     outer loop |  | ||||||
|         vertex 4.323779 -4 -1.25 |  | ||||||
|         vertex 6.108964 -4 -2.5 |  | ||||||
|         vertex 6.108964 -0 -2.5 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0.57357645 0 0.819152 |  | ||||||
|     outer loop |  | ||||||
|         vertex 3.4311862 -0 -0.625 |  | ||||||
|         vertex 2.5385938 -4 0 |  | ||||||
|         vertex 3.4311862 -4 -0.625 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0.5735763 0 0.8191522 |  | ||||||
|     outer loop |  | ||||||
|         vertex 4.323779 -0 -1.25 |  | ||||||
|         vertex 3.4311862 -0 -0.625 |  | ||||||
|         vertex 3.4311862 -4 -0.625 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0.57357645 -0 0.819152 |  | ||||||
|     outer loop |  | ||||||
|         vertex 4.323779 -4 -1.25 |  | ||||||
|         vertex 6.108964 -0 -2.5 |  | ||||||
|         vertex 4.323779 -0 -1.25 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0.57357645 -0 0.819152 |  | ||||||
|     outer loop |  | ||||||
|         vertex 2.5385938 -4 0 |  | ||||||
|         vertex 3.4311862 -0 -0.625 |  | ||||||
|         vertex 2.5385938 -0 0 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0.42261824 0 -0.9063078 |  | ||||||
|     outer loop |  | ||||||
|         vertex 3.342784 -4 0.375 |  | ||||||
|         vertex 2.5385938 -4 0 |  | ||||||
|         vertex 2.5385938 -0 0 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0.42261824 0 -0.9063078 |  | ||||||
|     outer loop |  | ||||||
|         vertex 4.146974 -4 0.75 |  | ||||||
|         vertex 3.342784 -4 0.375 |  | ||||||
|         vertex 3.342784 -0 0.375 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0.42261824 0 -0.9063078 |  | ||||||
|     outer loop |  | ||||||
|         vertex 3.342784 -0 0.375 |  | ||||||
|         vertex 3.342784 -4 0.375 |  | ||||||
|         vertex 2.5385938 -0 0 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0.42261833 0 -0.90630776 |  | ||||||
|     outer loop |  | ||||||
|         vertex 4.146974 -0 0.75 |  | ||||||
|         vertex 5.755354 -4 1.5 |  | ||||||
|         vertex 4.146974 -4 0.75 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0.42261824 0 -0.9063078 |  | ||||||
|     outer loop |  | ||||||
|         vertex 4.146974 -4 0.75 |  | ||||||
|         vertex 3.342784 -0 0.375 |  | ||||||
|         vertex 4.146974 -0 0.75 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0.42261833 0 -0.90630776 |  | ||||||
|     outer loop |  | ||||||
|         vertex 5.755354 -4 1.5 |  | ||||||
|         vertex 4.146974 -0 0.75 |  | ||||||
|         vertex 5.755354 -0 1.5 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 0 -1 |  | ||||||
|     outer loop |  | ||||||
|         vertex 5.755354 -4 1.5 |  | ||||||
|         vertex 5.755354 -0 1.5 |  | ||||||
|         vertex 9.5 -4 1.5 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 0 -1 |  | ||||||
|     outer loop |  | ||||||
|         vertex 9.5 -4 1.5 |  | ||||||
|         vertex 5.755354 -0 1.5 |  | ||||||
|         vertex 9.5 -0 1.5 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 1 0 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 9.5 -4 1.5 |  | ||||||
|         vertex 9.5 -0 1.5 |  | ||||||
|         vertex 9.5 -4 2 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 1 -0 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 9.5 -4 2 |  | ||||||
|         vertex 9.5 -0 1.5 |  | ||||||
|         vertex 9.5 -0 2 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 -0 1 |  | ||||||
|     outer loop |  | ||||||
|         vertex 9.5 -4 2 |  | ||||||
|         vertex 9.5 -0 2 |  | ||||||
|         vertex 5.644507 -4 2 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 0 1 |  | ||||||
|     outer loop |  | ||||||
|         vertex 5.644507 -4 2 |  | ||||||
|         vertex 9.5 -0 2 |  | ||||||
|         vertex 5.644507 -0 2 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal -0.42261824 0 0.90630776 |  | ||||||
|     outer loop |  | ||||||
|         vertex 5.644507 -4 2 |  | ||||||
|         vertex 5.644507 -0 2 |  | ||||||
|         vertex 3.5 -4 1 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal -0.42261824 0 0.90630776 |  | ||||||
|     outer loop |  | ||||||
|         vertex 3.5 -4 1 |  | ||||||
|         vertex 5.644507 -0 2 |  | ||||||
|         vertex 3.5 -0 1 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 -0 1 |  | ||||||
|     outer loop |  | ||||||
|         vertex 3.5 -4 1 |  | ||||||
|         vertex 3.5 -0 1 |  | ||||||
|         vertex 0 -4 1 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 0 1 |  | ||||||
|     outer loop |  | ||||||
|         vertex 0 -4 1 |  | ||||||
|         vertex 3.5 -0 1 |  | ||||||
|         vertex 0 -0 1 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal -1 0 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 0 -4 1 |  | ||||||
|         vertex 0 -0 1 |  | ||||||
|         vertex 0 -4 0 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal -1 0 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 0 -4 0 |  | ||||||
|         vertex 0 -0 1 |  | ||||||
|         vertex 0 -0 0 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 1 -0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 3.342784 -0 0.375 |  | ||||||
|         vertex 2.5385938 -0 0 |  | ||||||
|         vertex 3.5 -0 1 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 1 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 4.146974 -0 0.75 |  | ||||||
|         vertex 3.342784 -0 0.375 |  | ||||||
|         vertex 3.5 -0 1 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 1 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 3.4311862 -0 -0.625 |  | ||||||
|         vertex 4.323779 -0 -1.25 |  | ||||||
|         vertex 3.0950184 -0 -1 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 0.99999994 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 4.146974 -0 0.75 |  | ||||||
|         vertex 5.644507 -0 2 |  | ||||||
|         vertex 5.755354 -0 1.5 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal -0 1 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 0 -0 1 |  | ||||||
|         vertex 3.5 -0 1 |  | ||||||
|         vertex 2.5385938 -0 0 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 1 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 0 -0 1 |  | ||||||
|         vertex 2.5385938 -0 0 |  | ||||||
|         vertex 0 -0 0 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal -0 1 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 5.644507 -0 2 |  | ||||||
|         vertex 9.5 -0 2 |  | ||||||
|         vertex 5.755354 -0 1.5 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 1 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 9.5 -0 2 |  | ||||||
|         vertex 9.5 -0 1.5 |  | ||||||
|         vertex 5.755354 -0 1.5 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 1 -0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 4.146974 -0 0.75 |  | ||||||
|         vertex 3.5 -0 1 |  | ||||||
|         vertex 5.644507 -0 2 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 0.99999994 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 2.5385938 -0 0 |  | ||||||
|         vertex 3.4311862 -0 -0.625 |  | ||||||
|         vertex 3.0950184 -0 -1 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 0.99999994 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 4.323779 -0 -1.25 |  | ||||||
|         vertex 5.9513144 -0 -3 |  | ||||||
|         vertex 3.0950184 -0 -1 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 1 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 6.108964 -0 -2.5 |  | ||||||
|         vertex 5.9513144 -0 -3 |  | ||||||
|         vertex 4.323779 -0 -1.25 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 0.99999994 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 9.5 -0 -2.5 |  | ||||||
|         vertex 9.5 -0 -3 |  | ||||||
|         vertex 6.108964 -0 -2.5 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 1 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 6.108964 -0 -2.5 |  | ||||||
|         vertex 9.5 -0 -3 |  | ||||||
|         vertex 5.9513144 -0 -3 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 1 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 2.5385938 -0 0 |  | ||||||
|         vertex 3.0950184 -0 -1 |  | ||||||
|         vertex 0 -0 -1 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 1 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 0 -0 -1 |  | ||||||
|         vertex 0 -0 0 |  | ||||||
|         vertex 2.5385938 -0 0 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal -0 -1 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 3.342784 -4 0.375 |  | ||||||
|         vertex 3.5 -4 1 |  | ||||||
|         vertex 2.5385938 -4 0 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal -0 -1 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 4.146974 -4 0.75 |  | ||||||
|         vertex 3.5 -4 1 |  | ||||||
|         vertex 3.342784 -4 0.375 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 -1 -0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 3.4311862 -4 -0.625 |  | ||||||
|         vertex 3.0950184 -4 -1 |  | ||||||
|         vertex 4.323779 -4 -1.25 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 -0.99999994 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 4.146974 -4 0.75 |  | ||||||
|         vertex 5.755354 -4 1.5 |  | ||||||
|         vertex 5.644507 -4 2 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 -1 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 0 -4 1 |  | ||||||
|         vertex 2.5385938 -4 0 |  | ||||||
|         vertex 3.5 -4 1 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 -1 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 0 -4 1 |  | ||||||
|         vertex 0 -4 0 |  | ||||||
|         vertex 2.5385938 -4 0 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 -1 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 5.644507 -4 2 |  | ||||||
|         vertex 5.755354 -4 1.5 |  | ||||||
|         vertex 9.5 -4 2 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 -1 -0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 9.5 -4 2 |  | ||||||
|         vertex 5.755354 -4 1.5 |  | ||||||
|         vertex 9.5 -4 1.5 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 -1 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 4.146974 -4 0.75 |  | ||||||
|         vertex 5.644507 -4 2 |  | ||||||
|         vertex 3.5 -4 1 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 -0.99999994 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 2.5385938 -4 0 |  | ||||||
|         vertex 3.0950184 -4 -1 |  | ||||||
|         vertex 3.4311862 -4 -0.625 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal -0 -0.99999994 -0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 4.323779 -4 -1.25 |  | ||||||
|         vertex 3.0950184 -4 -1 |  | ||||||
|         vertex 5.9513144 -4 -3 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal -0 -1 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 6.108964 -4 -2.5 |  | ||||||
|         vertex 4.323779 -4 -1.25 |  | ||||||
|         vertex 5.9513144 -4 -3 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal -0 -0.99999994 -0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 9.5 -4 -2.5 |  | ||||||
|         vertex 6.108964 -4 -2.5 |  | ||||||
|         vertex 9.5 -4 -3 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 -1 -0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 6.108964 -4 -2.5 |  | ||||||
|         vertex 5.9513144 -4 -3 |  | ||||||
|         vertex 9.5 -4 -3 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 -1 -0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 2.5385938 -4 0 |  | ||||||
|         vertex 0 -4 -1 |  | ||||||
|         vertex 3.0950184 -4 -1 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| facet normal 0 -1 0 |  | ||||||
|     outer loop |  | ||||||
|         vertex 0 -4 -1 |  | ||||||
|         vertex 2.5385938 -4 0 |  | ||||||
|         vertex 0 -4 0 |  | ||||||
|     endloop |  | ||||||
| endfacet |  | ||||||
| endsolid unnamed |  | ||||||
| Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 221 KiB | 
| @ -3,6 +3,8 @@ import { secrets } from './secrets' | |||||||
| import { getUtils } from './test-utils' | import { getUtils } from './test-utils' | ||||||
| import waitOn from 'wait-on' | import waitOn from 'wait-on' | ||||||
| import { Themes } from '../../src/lib/theme' | import { Themes } from '../../src/lib/theme' | ||||||
|  | import { initialSettings } from '../../src/lib/settings/initialSettings' | ||||||
|  | import { roundOff } from 'lib/utils' | ||||||
|  |  | ||||||
| /* | /* | ||||||
| debug helper: unfortunately we do rely on exact coord mouse clicks in a few places | debug helper: unfortunately we do rely on exact coord mouse clicks in a few places | ||||||
| @ -14,6 +16,12 @@ document.addEventListener('mousemove', (e) => | |||||||
| ) | ) | ||||||
| */ | */ | ||||||
|  |  | ||||||
|  | const commonPoints = { | ||||||
|  |   startAt: '[9.06, -12.22]', | ||||||
|  |   num1: 9.14, | ||||||
|  |   num2: 18.2, | ||||||
|  | } | ||||||
|  |  | ||||||
| test.beforeEach(async ({ context, page }) => { | test.beforeEach(async ({ context, page }) => { | ||||||
|   // wait for Vite preview server to be up |   // wait for Vite preview server to be up | ||||||
|   await waitOn({ |   await waitOn({ | ||||||
| @ -52,14 +60,15 @@ test('Basic sketch', async ({ page }) => { | |||||||
|   await u.waitForAuthSkipAppStart() |   await u.waitForAuthSkipAppStart() | ||||||
|   await u.openDebugPanel() |   await u.openDebugPanel() | ||||||
|  |  | ||||||
|  |   await expect( | ||||||
|  |     page.getByRole('button', { name: 'Start Sketch' }) | ||||||
|  |   ).not.toBeDisabled() | ||||||
|   await expect(page.getByRole('button', { name: 'Start Sketch' })).toBeVisible() |   await expect(page.getByRole('button', { name: 'Start Sketch' })).toBeVisible() | ||||||
|  |  | ||||||
|   // click on "Start Sketch" button |   // click on "Start Sketch" button | ||||||
|   await u.clearCommandLogs() |   await u.clearCommandLogs() | ||||||
|   await u.doAndWaitForImageDiff( |   await page.getByRole('button', { name: 'Start Sketch' }).click() | ||||||
|     () => page.getByRole('button', { name: 'Start Sketch' }).click(), |   await page.waitForTimeout(100) | ||||||
|     200 |  | ||||||
|   ) |  | ||||||
|  |  | ||||||
|   // select a plane |   // select a plane | ||||||
|   await page.mouse.click(700, 200) |   await page.mouse.click(700, 200) | ||||||
| @ -68,39 +77,37 @@ test('Basic sketch', async ({ page }) => { | |||||||
|     `const part001 = startSketchOn('-XZ')` |     `const part001 = startSketchOn('-XZ')` | ||||||
|   ) |   ) | ||||||
|  |  | ||||||
|   await page.waitForTimeout(500) // TODO detect animation ending, or disable animation |   await page.waitForTimeout(300) // TODO detect animation ending, or disable animation | ||||||
|  |  | ||||||
|   const startXPx = 600 |   const startXPx = 600 | ||||||
|   await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10) |   await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10) | ||||||
|   const startAt = '[23.89, -32.23]' |  | ||||||
|   await expect(page.locator('.cm-content')) |   await expect(page.locator('.cm-content')) | ||||||
|     .toHaveText(`const part001 = startSketchOn('-XZ') |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|   |> startProfileAt(${startAt}, %)`) |   |> startProfileAt(${commonPoints.startAt}, %)`) | ||||||
|   await page.waitForTimeout(100) |   await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|   await u.closeDebugPanel() |   await u.closeDebugPanel() | ||||||
|   await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10) |   await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10) | ||||||
|   await page.waitForTimeout(100) |   await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|   const num = 24.11 |  | ||||||
|   await expect(page.locator('.cm-content')) |   await expect(page.locator('.cm-content')) | ||||||
|     .toHaveText(`const part001 = startSketchOn('-XZ') |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|   |> startProfileAt(${startAt}, %) |   |> startProfileAt(${commonPoints.startAt}, %) | ||||||
|   |> line([${num}, 0], %)`) |   |> line([${commonPoints.num1}, 0], %)`) | ||||||
|  |  | ||||||
|   await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20) |   await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20) | ||||||
|   await expect(page.locator('.cm-content')) |   await expect(page.locator('.cm-content')) | ||||||
|     .toHaveText(`const part001 = startSketchOn('-XZ') |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|   |> startProfileAt(${startAt}, %) |   |> startProfileAt(${commonPoints.startAt}, %) | ||||||
|   |> line([${num}, 0], %) |   |> line([${commonPoints.num1}, 0], %) | ||||||
|   |> line([0, ${num + 0.01}], %)`) |   |> line([0, ${commonPoints.num1}], %)`) | ||||||
|   await page.mouse.click(startXPx, 500 - PUR * 20) |   await page.mouse.click(startXPx, 500 - PUR * 20) | ||||||
|   await expect(page.locator('.cm-content')) |   await expect(page.locator('.cm-content')) | ||||||
|     .toHaveText(`const part001 = startSketchOn('-XZ') |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|   |> startProfileAt(${startAt}, %) |   |> startProfileAt(${commonPoints.startAt}, %) | ||||||
|   |> line([${num}, 0], %) |   |> line([${commonPoints.num1}, 0], %) | ||||||
|   |> line([0, ${num + 0.01}], %) |   |> line([0, ${commonPoints.num1}], %) | ||||||
|   |> line([-48, 0], %)`) |   |> line([-${commonPoints.num2}, 0], %)`) | ||||||
|  |  | ||||||
|   // deselect line tool |   // deselect line tool | ||||||
|   await page.getByRole('button', { name: 'Line' }).click() |   await page.getByRole('button', { name: 'Line' }).click() | ||||||
| @ -122,12 +129,132 @@ test('Basic sketch', async ({ page }) => { | |||||||
|  |  | ||||||
|   await expect(page.locator('.cm-content')) |   await expect(page.locator('.cm-content')) | ||||||
|     .toHaveText(`const part001 = startSketchOn('-XZ') |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|   |> startProfileAt(${startAt}, %) |   |> startProfileAt(${commonPoints.startAt}, %) | ||||||
|   |> line({ to: [${num}, 0], tag: 'seg01' }, %) |   |> line({ to: [${commonPoints.num1}, 0], tag: 'seg01' }, %) | ||||||
|   |> line([0, ${num + 0.01}], %) |   |> line([0, ${commonPoints.num1}], %) | ||||||
|   |> angledLine([180, segLen('seg01', %)], %)`) |   |> angledLine([180, segLen('seg01', %)], %)`) | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | test('Can moving camera', async ({ page, context }) => { | ||||||
|  |   test.skip(process.platform === 'darwin', 'Can moving camera') | ||||||
|  |   const u = getUtils(page) | ||||||
|  |   await page.setViewportSize({ width: 1200, height: 500 }) | ||||||
|  |   await page.goto('/') | ||||||
|  |   await u.waitForAuthSkipAppStart() | ||||||
|  |   await u.openAndClearDebugPanel() | ||||||
|  |  | ||||||
|  |   const camPos: [number, number, number] = [0, 85, 85] | ||||||
|  |   const bakeInRetries = async ( | ||||||
|  |     mouseActions: any, | ||||||
|  |     xyz: [number, number, number], | ||||||
|  |     cnt = 0 | ||||||
|  |   ) => { | ||||||
|  |     // hack that we're implemented our own retry instead of using retries built into playwright. | ||||||
|  |     // however each of these camera drags can be flaky, because of udp | ||||||
|  |     // and so putting them together means only one needs to fail to make this test extra flaky. | ||||||
|  |     // this way we can retry within the test | ||||||
|  |     // We could break them out into separate tests, but the longest past of the test is waiting | ||||||
|  |     // for the stream to start, so it can be good to bundle related things together. | ||||||
|  |  | ||||||
|  |     await u.updateCamPosition(camPos) | ||||||
|  |     await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|  |     // rotate | ||||||
|  |     await u.closeDebugPanel() | ||||||
|  |     await page.getByRole('button', { name: 'Start Sketch' }).click() | ||||||
|  |     await page.waitForTimeout(100) | ||||||
|  |     // const yo = page.getByTestId('cam-x-position').inputValue() | ||||||
|  |  | ||||||
|  |     await u.doAndWaitForImageDiff(async () => { | ||||||
|  |       await mouseActions() | ||||||
|  |  | ||||||
|  |       await u.openAndClearDebugPanel() | ||||||
|  |  | ||||||
|  |       await u.closeDebugPanel() | ||||||
|  |       await page.waitForTimeout(100) | ||||||
|  |     }, 300) | ||||||
|  |  | ||||||
|  |     await u.openAndClearDebugPanel() | ||||||
|  |     const vals = await Promise.all([ | ||||||
|  |       page.getByTestId('cam-x-position').inputValue(), | ||||||
|  |       page.getByTestId('cam-y-position').inputValue(), | ||||||
|  |       page.getByTestId('cam-z-position').inputValue(), | ||||||
|  |     ]) | ||||||
|  |     const xError = Math.abs(Number(vals[0]) + xyz[0]) | ||||||
|  |     const yError = Math.abs(Number(vals[1]) + xyz[1]) | ||||||
|  |     const zError = Math.abs(Number(vals[2]) + xyz[2]) | ||||||
|  |  | ||||||
|  |     let shouldRetry = false | ||||||
|  |  | ||||||
|  |     if (xError > 5 || yError > 5 || zError > 5) { | ||||||
|  |       if (cnt > 2) { | ||||||
|  |         console.log('xVal', vals[0], 'xError', xError) | ||||||
|  |         console.log('yVal', vals[1], 'yError', yError) | ||||||
|  |         console.log('zVal', vals[2], 'zError', zError) | ||||||
|  |  | ||||||
|  |         throw new Error('Camera position not as expected') | ||||||
|  |       } | ||||||
|  |       shouldRetry = true | ||||||
|  |     } | ||||||
|  |     await page.getByRole('button', { name: 'Exit Sketch' }).click() | ||||||
|  |     await page.waitForTimeout(100) | ||||||
|  |     if (shouldRetry) await bakeInRetries(mouseActions, xyz, cnt + 1) | ||||||
|  |   } | ||||||
|  |   await bakeInRetries(async () => { | ||||||
|  |     await page.mouse.move(700, 200) | ||||||
|  |     await page.mouse.down({ button: 'right' }) | ||||||
|  |     await page.mouse.move(600, 303) | ||||||
|  |     await page.mouse.up({ button: 'right' }) | ||||||
|  |   }, [4, -10.5, -120]) | ||||||
|  |  | ||||||
|  |   await bakeInRetries(async () => { | ||||||
|  |     await page.keyboard.down('Shift') | ||||||
|  |     await page.mouse.move(600, 200) | ||||||
|  |     await page.mouse.down({ button: 'right' }) | ||||||
|  |     await page.mouse.move(700, 200, { steps: 2 }) | ||||||
|  |     await page.mouse.up({ button: 'right' }) | ||||||
|  |     await page.keyboard.up('Shift') | ||||||
|  |   }, [-10, -85, -85]) | ||||||
|  |  | ||||||
|  |   await u.updateCamPosition(camPos) | ||||||
|  |  | ||||||
|  |   await u.clearCommandLogs() | ||||||
|  |   await u.closeDebugPanel() | ||||||
|  |  | ||||||
|  |   await page.getByRole('button', { name: 'Start Sketch' }).click() | ||||||
|  |   await page.waitForTimeout(200) | ||||||
|  |  | ||||||
|  |   // zoom | ||||||
|  |   await u.doAndWaitForImageDiff(async () => { | ||||||
|  |     await page.keyboard.down('Control') | ||||||
|  |     await page.mouse.move(700, 400) | ||||||
|  |     await page.mouse.down({ button: 'right' }) | ||||||
|  |     await page.mouse.move(700, 300) | ||||||
|  |     await page.mouse.up({ button: 'right' }) | ||||||
|  |     await page.keyboard.up('Control') | ||||||
|  |  | ||||||
|  |     await u.openDebugPanel() | ||||||
|  |     await page.waitForTimeout(300) | ||||||
|  |     await u.clearCommandLogs() | ||||||
|  |  | ||||||
|  |     await u.closeDebugPanel() | ||||||
|  |   }, 300) | ||||||
|  |  | ||||||
|  |   // zoom with scroll | ||||||
|  |   await u.openAndClearDebugPanel() | ||||||
|  |   // TODO, it appears we don't get the cam setting back from the engine when the interaction is zoom into `backInRetries` once the information is sent back on zoom | ||||||
|  |   // await expect(Math.abs(Number(await page.getByTestId('cam-x-position').inputValue()) + 12)).toBeLessThan(1.5) | ||||||
|  |   // await expect(Math.abs(Number(await page.getByTestId('cam-y-position').inputValue()) - 85)).toBeLessThan(1.5) | ||||||
|  |   // await expect(Math.abs(Number(await page.getByTestId('cam-z-position').inputValue()) - 85)).toBeLessThan(1.5) | ||||||
|  |  | ||||||
|  |   await page.getByRole('button', { name: 'Exit Sketch' }).click() | ||||||
|  |  | ||||||
|  |   await bakeInRetries(async () => { | ||||||
|  |     await page.mouse.move(700, 400) | ||||||
|  |     await page.mouse.wheel(0, -100) | ||||||
|  |   }, [1, -94, -94]) | ||||||
|  | }) | ||||||
|  |  | ||||||
| test('if you write invalid kcl you get inlined errors', async ({ page }) => { | test('if you write invalid kcl you get inlined errors', async ({ page }) => { | ||||||
|   const u = getUtils(page) |   const u = getUtils(page) | ||||||
|   await page.setViewportSize({ width: 1000, height: 500 }) |   await page.setViewportSize({ width: 1000, height: 500 }) | ||||||
| @ -276,10 +403,9 @@ test('Can create sketches on all planes and their back sides', async ({ | |||||||
|   }) => { |   }) => { | ||||||
|     await u.openDebugPanel() |     await u.openDebugPanel() | ||||||
|  |  | ||||||
|     await u.updateCamPosition(viewCmd) |  | ||||||
|  |  | ||||||
|     await u.clearCommandLogs() |     await u.clearCommandLogs() | ||||||
|     await page.getByRole('button', { name: 'Start Sketch' }).click() |     await page.getByRole('button', { name: 'Start Sketch' }).click() | ||||||
|  |     await u.updateCamPosition(viewCmd) | ||||||
|  |  | ||||||
|     await u.closeDebugPanel() |     await u.closeDebugPanel() | ||||||
|     await page.mouse.click(clickCoords.x, clickCoords.y) |     await page.mouse.click(clickCoords.x, clickCoords.y) | ||||||
| @ -305,11 +431,9 @@ test('Can create sketches on all planes and their back sides', async ({ | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   const codeTemplate = ( |   const codeTemplate = ( | ||||||
|     plane = 'XY', |     plane = 'XY' | ||||||
|     rounded = false, |  | ||||||
|     otherThing = '1' |  | ||||||
|   ) => `const part001 = startSketchOn('${plane}') |   ) => `const part001 = startSketchOn('${plane}') | ||||||
|   |> startProfileAt([28.9${otherThing}, -39${rounded ? '' : '.01'}], %)` |   |> startProfileAt([1.14, -1.54], %)` | ||||||
|   await TestSinglePlane({ |   await TestSinglePlane({ | ||||||
|     viewCmd: camPos, |     viewCmd: camPos, | ||||||
|     expectedCode: codeTemplate('XY'), |     expectedCode: codeTemplate('XY'), | ||||||
| @ -318,8 +442,8 @@ test('Can create sketches on all planes and their back sides', async ({ | |||||||
|   }) |   }) | ||||||
|   await TestSinglePlane({ |   await TestSinglePlane({ | ||||||
|     viewCmd: camPos, |     viewCmd: camPos, | ||||||
|     expectedCode: codeTemplate('YZ', true), |     expectedCode: codeTemplate('YZ'), | ||||||
|     clickCoords: { x: 700, y: 300 }, // green plane |     clickCoords: { x: 700, y: 250 }, // green plane | ||||||
|   }) |   }) | ||||||
|   await TestSinglePlane({ |   await TestSinglePlane({ | ||||||
|     viewCmd: camPos, |     viewCmd: camPos, | ||||||
| @ -329,7 +453,7 @@ test('Can create sketches on all planes and their back sides', async ({ | |||||||
|   const camCmdBackSide: [number, number, number] = [-100, -100, -100] |   const camCmdBackSide: [number, number, number] = [-100, -100, -100] | ||||||
|   await TestSinglePlane({ |   await TestSinglePlane({ | ||||||
|     viewCmd: camCmdBackSide, |     viewCmd: camCmdBackSide, | ||||||
|     expectedCode: codeTemplate('-XY', false, '3'), |     expectedCode: codeTemplate('-XY'), | ||||||
|     clickCoords: { x: 601, y: 118 }, // back of red plane |     clickCoords: { x: 601, y: 118 }, // back of red plane | ||||||
|   }) |   }) | ||||||
|   await TestSinglePlane({ |   await TestSinglePlane({ | ||||||
| @ -339,7 +463,7 @@ test('Can create sketches on all planes and their back sides', async ({ | |||||||
|   }) |   }) | ||||||
|   await TestSinglePlane({ |   await TestSinglePlane({ | ||||||
|     viewCmd: camCmdBackSide, |     viewCmd: camCmdBackSide, | ||||||
|     expectedCode: codeTemplate('-XZ', true), |     expectedCode: codeTemplate('-XZ'), | ||||||
|     clickCoords: { x: 680, y: 427 }, // back of blue plane |     clickCoords: { x: 680, y: 427 }, // back of blue plane | ||||||
|   }) |   }) | ||||||
| }) | }) | ||||||
| @ -367,6 +491,7 @@ test('Auto complete works', async ({ page }) => { | |||||||
|   await page.keyboard.type('  |> startProfi') |   await page.keyboard.type('  |> startProfi') | ||||||
|   // expect there be a single auto complete option that we can just hit enter on |   // expect there be a single auto complete option that we can just hit enter on | ||||||
|   await expect(page.locator('.cm-completionLabel')).toBeVisible() |   await expect(page.locator('.cm-completionLabel')).toBeVisible() | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|   await page.keyboard.press('Enter') // accepting the auto complete, not a new line |   await page.keyboard.press('Enter') // accepting the auto complete, not a new line | ||||||
|  |  | ||||||
|   await page.keyboard.type('([0,0], %)') |   await page.keyboard.type('([0,0], %)') | ||||||
| @ -374,16 +499,70 @@ test('Auto complete works', async ({ page }) => { | |||||||
|   await page.keyboard.type('  |> lin') |   await page.keyboard.type('  |> lin') | ||||||
|  |  | ||||||
|   await expect(page.locator('.cm-tooltip-autocomplete')).toBeVisible() |   await expect(page.locator('.cm-tooltip-autocomplete')).toBeVisible() | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|   // press arrow down twice then enter to accept xLine |   // press arrow down twice then enter to accept xLine | ||||||
|   await page.keyboard.press('ArrowDown') |   await page.keyboard.press('ArrowDown') | ||||||
|   await page.keyboard.press('ArrowDown') |   await page.keyboard.press('ArrowDown') | ||||||
|   await page.keyboard.press('Enter') |   await page.keyboard.press('Enter') | ||||||
|   await page.keyboard.type('(5, %)') |   // finish line with comment | ||||||
|  |   await page.keyboard.type('(5, %) // lin') | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |   // there shouldn't be any auto complete options for 'lin' in the comment | ||||||
|  |   await expect(page.locator('.cm-completionLabel')).not.toBeVisible() | ||||||
|  |  | ||||||
|   await expect(page.locator('.cm-content')) |   await expect(page.locator('.cm-content')) | ||||||
|     .toHaveText(`const part001 = startSketchOn('XY') |     .toHaveText(`const part001 = startSketchOn('XY') | ||||||
|   |> startProfileAt([0,0], %) |   |> startProfileAt([0,0], %) | ||||||
|   |> xLine(5, %)`) |   |> xLine(5, %) // lin`) | ||||||
|  | }) | ||||||
|  |  | ||||||
|  | // Stored settings validation test | ||||||
|  | test('Stored settings are validated and fall back to defaults', async ({ | ||||||
|  |   page, | ||||||
|  |   context, | ||||||
|  | }) => { | ||||||
|  |   // Override beforeEach test setup | ||||||
|  |   // with corrupted settings | ||||||
|  |   await context.addInitScript(async () => { | ||||||
|  |     const storedSettings = JSON.parse( | ||||||
|  |       localStorage.getItem('SETTINGS_PERSIST_KEY') || '{}' | ||||||
|  |     ) | ||||||
|  |  | ||||||
|  |     // Corrupt the settings | ||||||
|  |     storedSettings.baseUnit = 'invalid' | ||||||
|  |     storedSettings.cameraControls = `() => alert('hack the planet')` | ||||||
|  |     storedSettings.defaultDirectory = 123 | ||||||
|  |     storedSettings.defaultProjectName = false | ||||||
|  |  | ||||||
|  |     localStorage.setItem('SETTINGS_PERSIST_KEY', JSON.stringify(storedSettings)) | ||||||
|  |   }) | ||||||
|  |  | ||||||
|  |   await page.setViewportSize({ width: 1200, height: 500 }) | ||||||
|  |   await page.goto('/', { waitUntil: 'domcontentloaded' }) | ||||||
|  |  | ||||||
|  |   // Check the toast appeared | ||||||
|  |   await expect( | ||||||
|  |     page.getByText(`Error validating persisted settings:`, { | ||||||
|  |       exact: false, | ||||||
|  |     }) | ||||||
|  |   ).toBeVisible() | ||||||
|  |  | ||||||
|  |   // Check the settings were reset | ||||||
|  |   const storedSettings = JSON.parse( | ||||||
|  |     await page.evaluate( | ||||||
|  |       () => localStorage.getItem('SETTINGS_PERSIST_KEY') || '{}' | ||||||
|  |     ) | ||||||
|  |   ) | ||||||
|  |   await expect(storedSettings.baseUnit).toBe(initialSettings.baseUnit) | ||||||
|  |   await expect(storedSettings.cameraControls).toBe( | ||||||
|  |     initialSettings.cameraControls | ||||||
|  |   ) | ||||||
|  |   await expect(storedSettings.defaultDirectory).toBe( | ||||||
|  |     initialSettings.defaultDirectory | ||||||
|  |   ) | ||||||
|  |   await expect(storedSettings.defaultProjectName).toBe( | ||||||
|  |     initialSettings.defaultProjectName | ||||||
|  |   ) | ||||||
| }) | }) | ||||||
|  |  | ||||||
| // Onboarding tests | // Onboarding tests | ||||||
| @ -451,6 +630,9 @@ test('Selections work on fresh and edited sketch', async ({ page }) => { | |||||||
|     page.mouse.click(767, 396).then(() => page.waitForTimeout(100)) |     page.mouse.click(767, 396).then(() => page.waitForTimeout(100)) | ||||||
|  |  | ||||||
|   await u.clearCommandLogs() |   await u.clearCommandLogs() | ||||||
|  |   await expect( | ||||||
|  |     page.getByRole('button', { name: 'Start Sketch' }) | ||||||
|  |   ).not.toBeDisabled() | ||||||
|   await page.getByRole('button', { name: 'Start Sketch' }).click() |   await page.getByRole('button', { name: 'Start Sketch' }).click() | ||||||
|  |  | ||||||
|   // select a plane |   // select a plane | ||||||
| @ -459,35 +641,32 @@ test('Selections work on fresh and edited sketch', async ({ page }) => { | |||||||
|  |  | ||||||
|   const startXPx = 600 |   const startXPx = 600 | ||||||
|   await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10) |   await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10) | ||||||
|   const startAt = '[23.89, -32.23]' |  | ||||||
|   await expect(page.locator('.cm-content')) |   await expect(page.locator('.cm-content')) | ||||||
|     .toHaveText(`const part001 = startSketchOn('-XZ') |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|   |> startProfileAt(${startAt}, %)`) |   |> startProfileAt(${commonPoints.startAt}, %)`) | ||||||
|  |  | ||||||
|   await u.closeDebugPanel() |   await u.closeDebugPanel() | ||||||
|  |  | ||||||
|   await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10) |   await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10) | ||||||
|  |  | ||||||
|   const num = 24.11 |  | ||||||
|   const num2 = '48' |  | ||||||
|   await expect(page.locator('.cm-content')) |   await expect(page.locator('.cm-content')) | ||||||
|     .toHaveText(`const part001 = startSketchOn('-XZ') |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|   |> startProfileAt(${startAt}, %) |   |> startProfileAt(${commonPoints.startAt}, %) | ||||||
|   |> line([${num}, 0], %)`) |   |> line([${commonPoints.num1}, 0], %)`) | ||||||
|  |  | ||||||
|   await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20) |   await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20) | ||||||
|   await expect(page.locator('.cm-content')) |   await expect(page.locator('.cm-content')) | ||||||
|     .toHaveText(`const part001 = startSketchOn('-XZ') |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|   |> startProfileAt(${startAt}, %) |   |> startProfileAt(${commonPoints.startAt}, %) | ||||||
|   |> line([${num}, 0], %) |   |> line([${commonPoints.num1}, 0], %) | ||||||
|   |> line([0, ${num + 0.01}], %)`) |   |> line([0, ${commonPoints.num1}], %)`) | ||||||
|   await page.mouse.click(startXPx, 500 - PUR * 20) |   await page.mouse.click(startXPx, 500 - PUR * 20) | ||||||
|   await expect(page.locator('.cm-content')) |   await expect(page.locator('.cm-content')) | ||||||
|     .toHaveText(`const part001 = startSketchOn('-XZ') |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|   |> startProfileAt(${startAt}, %) |   |> startProfileAt(${commonPoints.startAt}, %) | ||||||
|   |> line([${num}, 0], %) |   |> line([${commonPoints.num1}, 0], %) | ||||||
|   |> line([0, ${num + 0.01}], %) |   |> line([0, ${commonPoints.num1}], %) | ||||||
|   |> line([-${num2}, 0], %)`) |   |> line([-${commonPoints.num2}, 0], %)`) | ||||||
|  |  | ||||||
|   // deselect line tool |   // deselect line tool | ||||||
|   await page.getByRole('button', { name: 'Line' }).click() |   await page.getByRole('button', { name: 'Line' }).click() | ||||||
| @ -537,7 +716,7 @@ test('Selections work on fresh and edited sketch', async ({ page }) => { | |||||||
|     await emptySpaceClick() |     await emptySpaceClick() | ||||||
|  |  | ||||||
|     // check the same selection again by putting cursor in code first then selecting axis |     // check the same selection again by putting cursor in code first then selecting axis | ||||||
|     await page.getByText(`  |> line([-${num2}, 0], %)`).click() |     await page.getByText(`  |> line([-${commonPoints.num2}, 0], %)`).click() | ||||||
|     await page.keyboard.down('Shift') |     await page.keyboard.down('Shift') | ||||||
|     await expect(absYButton).toBeDisabled() |     await expect(absYButton).toBeDisabled() | ||||||
|     await xAxisClick() |     await xAxisClick() | ||||||
| @ -548,7 +727,7 @@ test('Selections work on fresh and edited sketch', async ({ page }) => { | |||||||
|     await emptySpaceClick() |     await emptySpaceClick() | ||||||
|  |  | ||||||
|     // select segment in editor than another segment in scene and check there are two cursors |     // select segment in editor than another segment in scene and check there are two cursors | ||||||
|     await page.getByText(`  |> line([-${num2}, 0], %)`).click() |     await page.getByText(`  |> line([-${commonPoints.num2}, 0], %)`).click() | ||||||
|     await page.waitForTimeout(300) |     await page.waitForTimeout(300) | ||||||
|     await page.keyboard.down('Shift') |     await page.keyboard.down('Shift') | ||||||
|     await expect(page.locator('.cm-cursor')).toHaveCount(1) |     await expect(page.locator('.cm-cursor')).toHaveCount(1) | ||||||
| @ -572,12 +751,13 @@ test('Selections work on fresh and edited sketch', async ({ page }) => { | |||||||
|   await u.closeDebugPanel() |   await u.closeDebugPanel() | ||||||
|  |  | ||||||
|   // select a line |   // select a line | ||||||
|   await topHorzSegmentClick() |   // await topHorzSegmentClick() | ||||||
|   await page.waitForTimeout(200) |   await page.getByText(commonPoints.startAt).click() // TODO remove this and reinstate // await topHorzSegmentClick() | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|   // enter sketch again |   // enter sketch again | ||||||
|   await page.getByRole('button', { name: 'Start Sketch' }).click() |   await page.getByRole('button', { name: 'Edit Sketch' }).click() | ||||||
|   await page.waitForTimeout(700) // wait for animation |   await page.waitForTimeout(300) // wait for animation | ||||||
|  |  | ||||||
|   // hover again and check it works |   // hover again and check it works | ||||||
|   await selectionSequence() |   await selectionSequence() | ||||||
| @ -612,12 +792,12 @@ test('Command bar works and can change a setting', async ({ page }) => { | |||||||
|   const themeOption = page.getByRole('option', { name: 'Set Theme' }) |   const themeOption = page.getByRole('option', { name: 'Set Theme' }) | ||||||
|   await expect(themeOption).toBeVisible() |   await expect(themeOption).toBeVisible() | ||||||
|   await themeOption.click() |   await themeOption.click() | ||||||
|   const themeInput = page.getByPlaceholder('Select an option') |   const themeInput = page.getByPlaceholder('system') | ||||||
|   await expect(themeInput).toBeVisible() |   await expect(themeInput).toBeVisible() | ||||||
|   await expect(themeInput).toBeFocused() |   await expect(themeInput).toBeFocused() | ||||||
|   // Select dark theme |   // Select dark theme | ||||||
|   await page.keyboard.press('ArrowDown') |   await page.keyboard.press('ArrowDown') | ||||||
|   await page.keyboard.press('ArrowDown') |   await page.keyboard.press('ArrowUp') | ||||||
|   await expect(page.getByRole('option', { name: Themes.Dark })).toHaveAttribute( |   await expect(page.getByRole('option', { name: Themes.Dark })).toHaveAttribute( | ||||||
|     'data-headlessui-state', |     'data-headlessui-state', | ||||||
|     'active' |     'active' | ||||||
| @ -634,12 +814,15 @@ test('Can extrude from the command bar', async ({ page, context }) => { | |||||||
|   await context.addInitScript(async (token) => { |   await context.addInitScript(async (token) => { | ||||||
|     localStorage.setItem( |     localStorage.setItem( | ||||||
|       'persistCode', |       'persistCode', | ||||||
|       `const part001 = startSketchOn('-XZ') |       ` | ||||||
|     |> startProfileAt([-6.95, 4.98], %) |       const distance = sqrt(20) | ||||||
|     |> line([25.1, 0.41], %) |       const part001 = startSketchOn('-XZ') | ||||||
|     |> line([0.73, -14.93], %) |         |> startProfileAt([-6.95, 4.98], %) | ||||||
|     |> line([-23.44, 0.52], %) |         |> line([25.1, 0.41], %) | ||||||
|     |> close(%)` |         |> line([0.73, -14.93], %) | ||||||
|  |         |> line([-23.44, 0.52], %) | ||||||
|  |         |> close(%) | ||||||
|  |       ` | ||||||
|     ) |     ) | ||||||
|   }) |   }) | ||||||
|  |  | ||||||
| @ -664,24 +847,44 @@ test('Can extrude from the command bar', async ({ page, context }) => { | |||||||
|   // Click to select face and set distance |   // Click to select face and set distance | ||||||
|   await page.getByText('|> startProfileAt([-6.95, 4.98], %)').click() |   await page.getByText('|> startProfileAt([-6.95, 4.98], %)').click() | ||||||
|   await page.getByRole('button', { name: 'Continue' }).click() |   await page.getByRole('button', { name: 'Continue' }).click() | ||||||
|  |  | ||||||
|  |   // Assert that we're on the distance step | ||||||
|   await expect(page.getByRole('button', { name: 'distance' })).toBeDisabled() |   await expect(page.getByRole('button', { name: 'distance' })).toBeDisabled() | ||||||
|   await page.keyboard.press('Enter') |  | ||||||
|  |   // Assert that the an alternative variable name is chosen, | ||||||
|  |   // since the default variable name is already in use (distance) | ||||||
|  |   await page.getByRole('button', { name: 'Create new variable' }).click() | ||||||
|  |   await expect(page.getByPlaceholder('Variable name')).toHaveValue( | ||||||
|  |     'distance001' | ||||||
|  |   ) | ||||||
|  |   await expect(page.getByRole('button', { name: 'Continue' })).toBeEnabled() | ||||||
|  |   await page.getByRole('button', { name: 'Continue' }).click() | ||||||
|  |  | ||||||
|   // Review step and argument hotkeys |   // Review step and argument hotkeys | ||||||
|   await page.keyboard.press('2') |   await expect( | ||||||
|   await expect(page.getByRole('button', { name: '5' })).toBeDisabled() |     page.getByRole('button', { name: 'Submit command' }) | ||||||
|  |   ).toBeEnabled() | ||||||
|  |   await page.keyboard.press('Backspace') | ||||||
|  |   await expect( | ||||||
|  |     page.getByRole('button', { name: 'Distance 12', exact: false }) | ||||||
|  |   ).toBeDisabled() | ||||||
|   await page.keyboard.press('Enter') |   await page.keyboard.press('Enter') | ||||||
|  |  | ||||||
|  |   await expect(page.getByText('Confirm Extrude')).toBeVisible() | ||||||
|  |  | ||||||
|   // Check that the code was updated |   // Check that the code was updated | ||||||
|   await page.keyboard.press('Enter') |   await page.keyboard.press('Enter') | ||||||
|  |   // Unfortunately this indentation seems to matter for the test | ||||||
|   await expect(page.locator('.cm-content')).toHaveText( |   await expect(page.locator('.cm-content')).toHaveText( | ||||||
|     `const part001 = startSketchOn('-XZ') |     `const distance = sqrt(20) | ||||||
|     |> startProfileAt([-6.95, 4.98], %) | const distance001 = 5 + 7 | ||||||
|     |> line([25.1, 0.41], %) | const part001 = startSketchOn('-XZ') | ||||||
|     |> line([0.73, -14.93], %) |   |> startProfileAt([-6.95, 4.98], %) | ||||||
|     |> line([-23.44, 0.52], %) |   |> line([25.1, 0.41], %) | ||||||
|     |> close(%) |   |> line([0.73, -14.93], %) | ||||||
|     |> extrude(5, %)` |   |> line([-23.44, 0.52], %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(distance001, %)`.replace(/(\r\n|\n|\r)/gm, '') // remove newlines | ||||||
|   ) |   ) | ||||||
| }) | }) | ||||||
|  |  | ||||||
| @ -693,6 +896,9 @@ test('Can add multiple sketches', async ({ page }) => { | |||||||
|   await u.waitForAuthSkipAppStart() |   await u.waitForAuthSkipAppStart() | ||||||
|   await u.openDebugPanel() |   await u.openDebugPanel() | ||||||
|  |  | ||||||
|  |   await expect( | ||||||
|  |     page.getByRole('button', { name: 'Start Sketch' }) | ||||||
|  |   ).not.toBeDisabled() | ||||||
|   await expect(page.getByRole('button', { name: 'Start Sketch' })).toBeVisible() |   await expect(page.getByRole('button', { name: 'Start Sketch' })).toBeVisible() | ||||||
|  |  | ||||||
|   // click on "Start Sketch" button |   // click on "Start Sketch" button | ||||||
| @ -713,34 +919,32 @@ test('Can add multiple sketches', async ({ page }) => { | |||||||
|  |  | ||||||
|   const startXPx = 600 |   const startXPx = 600 | ||||||
|   await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10) |   await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10) | ||||||
|   const startAt = '[23.89, -32.23]' |  | ||||||
|   await expect(page.locator('.cm-content')) |   await expect(page.locator('.cm-content')) | ||||||
|     .toHaveText(`const part001 = startSketchOn('-XZ') |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|   |> startProfileAt(${startAt}, %)`) |   |> startProfileAt(${commonPoints.startAt}, %)`) | ||||||
|   await page.waitForTimeout(100) |   await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|   await u.closeDebugPanel() |   await u.closeDebugPanel() | ||||||
|   await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10) |   await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10) | ||||||
|   await page.waitForTimeout(100) |   await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|   const num = 24.11 |  | ||||||
|   await expect(page.locator('.cm-content')) |   await expect(page.locator('.cm-content')) | ||||||
|     .toHaveText(`const part001 = startSketchOn('-XZ') |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|   |> startProfileAt(${startAt}, %) |   |> startProfileAt(${commonPoints.startAt}, %) | ||||||
|   |> line([${num}, 0], %)`) |   |> line([${commonPoints.num1}, 0], %)`) | ||||||
|  |  | ||||||
|   await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20) |   await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20) | ||||||
|   await expect(page.locator('.cm-content')) |   await expect(page.locator('.cm-content')) | ||||||
|     .toHaveText(`const part001 = startSketchOn('-XZ') |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|   |> startProfileAt(${startAt}, %) |   |> startProfileAt(${commonPoints.startAt}, %) | ||||||
|   |> line([${num}, 0], %) |   |> line([${commonPoints.num1}, 0], %) | ||||||
|   |> line([0, ${num + 0.01}], %)`) |   |> line([0, ${commonPoints.num1}], %)`) | ||||||
|   await page.mouse.click(startXPx, 500 - PUR * 20) |   await page.mouse.click(startXPx, 500 - PUR * 20) | ||||||
|   const finalCodeFirstSketch = `const part001 = startSketchOn('-XZ') |   const finalCodeFirstSketch = `const part001 = startSketchOn('-XZ') | ||||||
|   |> startProfileAt(${startAt}, %) |   |> startProfileAt(${commonPoints.startAt}, %) | ||||||
|   |> line([${num}, 0], %) |   |> line([${commonPoints.num1}, 0], %) | ||||||
|   |> line([0, ${num + 0.01}], %) |   |> line([0, ${commonPoints.num1}], %) | ||||||
|   |> line([-48, 0], %)` |   |> line([-${commonPoints.num2}, 0], %)` | ||||||
|   await expect(page.locator('.cm-content')).toHaveText(finalCodeFirstSketch) |   await expect(page.locator('.cm-content')).toHaveText(finalCodeFirstSketch) | ||||||
|  |  | ||||||
|   // exit the sketch |   // exit the sketch | ||||||
| @ -762,7 +966,7 @@ test('Can add multiple sketches', async ({ page }) => { | |||||||
|   await u.clearAndCloseDebugPanel() |   await u.clearAndCloseDebugPanel() | ||||||
|  |  | ||||||
|   await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10) |   await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10) | ||||||
|   const startAt2 = '[23.61, -31.85]' |   const startAt2 = '[0.93,-1.25]' | ||||||
|   await expect( |   await expect( | ||||||
|     (await page.locator('.cm-content').innerText()).replace(/\s/g, '') |     (await page.locator('.cm-content').innerText()).replace(/\s/g, '') | ||||||
|   ).toBe( |   ).toBe( | ||||||
| @ -776,7 +980,7 @@ const part002 = startSketchOn('XY') | |||||||
|   await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10) |   await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10) | ||||||
|   await page.waitForTimeout(100) |   await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|   const num2 = 23.83 |   const num2 = 0.94 | ||||||
|   await expect( |   await expect( | ||||||
|     (await page.locator('.cm-content').innerText()).replace(/\s/g, '') |     (await page.locator('.cm-content').innerText()).replace(/\s/g, '') | ||||||
|   ).toBe( |   ).toBe( | ||||||
| @ -794,7 +998,7 @@ const part002 = startSketchOn('XY') | |||||||
| const part002 = startSketchOn('XY') | const part002 = startSketchOn('XY') | ||||||
|   |> startProfileAt(${startAt2}, %) |   |> startProfileAt(${startAt2}, %) | ||||||
|   |> line([${num2}, 0], %) |   |> line([${num2}, 0], %) | ||||||
|   |> line([0, ${num2}], %)`.replace(/\s/g, '') |   |> line([0, ${roundOff(num2 - 0.01)}], %)`.replace(/\s/g, '') | ||||||
|   ) |   ) | ||||||
|   await page.mouse.click(startXPx, 500 - PUR * 20) |   await page.mouse.click(startXPx, 500 - PUR * 20) | ||||||
|   await expect( |   await expect( | ||||||
| @ -804,14 +1008,14 @@ const part002 = startSketchOn('XY') | |||||||
| const part002 = startSketchOn('XY') | const part002 = startSketchOn('XY') | ||||||
|   |> startProfileAt(${startAt2}, %) |   |> startProfileAt(${startAt2}, %) | ||||||
|   |> line([${num2}, 0], %) |   |> line([${num2}, 0], %) | ||||||
|   |> line([0, ${num2}], %) |   |> line([0, ${roundOff(num2 - 0.01)}], %) | ||||||
|   |> line([-47.44, 0], %)`.replace(/\s/g, '') |   |> line([-1.87, 0], %)`.replace(/\s/g, '') | ||||||
|   ) |   ) | ||||||
| }) | }) | ||||||
|  |  | ||||||
| test('ProgramMemory can be serialised', async ({ page, context }) => { | test('ProgramMemory can be serialised', async ({ page, context }) => { | ||||||
|   const u = getUtils(page) |   const u = getUtils(page) | ||||||
|   await context.addInitScript(async (token) => { |   await context.addInitScript(async () => { | ||||||
|     localStorage.setItem( |     localStorage.setItem( | ||||||
|       'persistCode', |       'persistCode', | ||||||
|       `const part = startSketchOn('XY') |       `const part = startSketchOn('XY') | ||||||
| @ -847,3 +1051,331 @@ test('ProgramMemory can be serialised', async ({ page, context }) => { | |||||||
|     }) |     }) | ||||||
|   }) |   }) | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | test("Various pipe expressions should and shouldn't allow edit and or extrude", async ({ | ||||||
|  |   page, | ||||||
|  |   context, | ||||||
|  | }) => { | ||||||
|  |   const u = getUtils(page) | ||||||
|  |   const selectionsSnippets = { | ||||||
|  |     extrudeAndEditBlocked: '|> startProfileAt([10.81, 32.99], %)', | ||||||
|  |     extrudeAndEditBlockedInFunction: '|> startProfileAt(pos, %)', | ||||||
|  |     extrudeAndEditAllowed: '|> startProfileAt([15.72, 4.7], %)', | ||||||
|  |     editOnly: '|> startProfileAt([15.79, -14.6], %)', | ||||||
|  |   } | ||||||
|  |   await context.addInitScript( | ||||||
|  |     async ({ | ||||||
|  |       extrudeAndEditBlocked, | ||||||
|  |       extrudeAndEditBlockedInFunction, | ||||||
|  |       extrudeAndEditAllowed, | ||||||
|  |       editOnly, | ||||||
|  |     }: any) => { | ||||||
|  |       localStorage.setItem( | ||||||
|  |         'persistCode', | ||||||
|  |         `const part001 = startSketchOn('-XZ') | ||||||
|  |   ${extrudeAndEditBlocked} | ||||||
|  |   |> line([25.96, 2.93], %) | ||||||
|  |   |> line([5.25, -5.72], %) | ||||||
|  |   |> line([-2.01, -10.35], %) | ||||||
|  |   |> line([-27.65, -2.78], %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(5, %) | ||||||
|  | const part002 = startSketchOn('-XZ') | ||||||
|  |   ${extrudeAndEditAllowed} | ||||||
|  |   |> line([10.32, 6.47], %) | ||||||
|  |   |> line([9.71, -6.16], %) | ||||||
|  |   |> line([-3.08, -9.86], %) | ||||||
|  |   |> line([-12.02, -1.54], %) | ||||||
|  |   |> close(%) | ||||||
|  | const part003 = startSketchOn('-XZ') | ||||||
|  |   ${editOnly} | ||||||
|  |   |> line([27.55, -1.65], %) | ||||||
|  |   |> line([4.95, -8], %) | ||||||
|  |   |> line([-20.38, -10.12], %) | ||||||
|  |   |> line([-15.79, 17.08], %) | ||||||
|  |  | ||||||
|  | fn yohey = (pos) => { | ||||||
|  |   const part004 = startSketchOn('-XZ') | ||||||
|  |   ${extrudeAndEditBlockedInFunction} | ||||||
|  |   |> line([27.55, -1.65], %) | ||||||
|  |   |> line([4.95, -10.53], %) | ||||||
|  |   |> line([-20.38, -8], %) | ||||||
|  |   |> line([-15.79, 17.08], %) | ||||||
|  |   return '' | ||||||
|  | } | ||||||
|  |  | ||||||
|  |     yohey([15.79, -34.6]) | ||||||
|  | ` | ||||||
|  |       ) | ||||||
|  |     }, | ||||||
|  |     selectionsSnippets | ||||||
|  |   ) | ||||||
|  |   await page.setViewportSize({ width: 1200, height: 500 }) | ||||||
|  |   await page.goto('/') | ||||||
|  |   await u.waitForAuthSkipAppStart() | ||||||
|  |  | ||||||
|  |   // wait for execution done | ||||||
|  |   await u.openDebugPanel() | ||||||
|  |   await u.expectCmdLog('[data-message-type="execution-done"]') | ||||||
|  |   await u.closeDebugPanel() | ||||||
|  |  | ||||||
|  |   // wait for start sketch as a proxy for the stream being ready | ||||||
|  |   await expect( | ||||||
|  |     page.getByRole('button', { name: 'Start Sketch' }) | ||||||
|  |   ).not.toBeDisabled() | ||||||
|  |  | ||||||
|  |   await page.getByText(selectionsSnippets.extrudeAndEditBlocked).click() | ||||||
|  |   await expect(page.getByRole('button', { name: 'Extrude' })).toBeDisabled() | ||||||
|  |   await expect( | ||||||
|  |     page.getByRole('button', { name: 'Edit Sketch' }) | ||||||
|  |   ).not.toBeVisible() | ||||||
|  |  | ||||||
|  |   await page.getByText(selectionsSnippets.extrudeAndEditAllowed).click() | ||||||
|  |   await expect(page.getByRole('button', { name: 'Extrude' })).not.toBeDisabled() | ||||||
|  |   await expect( | ||||||
|  |     page.getByRole('button', { name: 'Edit Sketch' }) | ||||||
|  |   ).not.toBeDisabled() | ||||||
|  |  | ||||||
|  |   await page.getByText(selectionsSnippets.editOnly).click() | ||||||
|  |   await expect(page.getByRole('button', { name: 'Extrude' })).toBeDisabled() | ||||||
|  |   await expect( | ||||||
|  |     page.getByRole('button', { name: 'Edit Sketch' }) | ||||||
|  |   ).not.toBeDisabled() | ||||||
|  |  | ||||||
|  |   await page | ||||||
|  |     .getByText(selectionsSnippets.extrudeAndEditBlockedInFunction) | ||||||
|  |     .click() | ||||||
|  |   await expect(page.getByRole('button', { name: 'Extrude' })).toBeDisabled() | ||||||
|  |   await expect( | ||||||
|  |     page.getByRole('button', { name: 'Edit Sketch' }) | ||||||
|  |   ).not.toBeVisible() | ||||||
|  |  | ||||||
|  |   // selecting an editable sketch but clicking "start sktech" should start a new sketch and not edit the existing one | ||||||
|  |   await page.getByText(selectionsSnippets.extrudeAndEditAllowed).click() | ||||||
|  |   await page.getByRole('button', { name: 'Start Sketch' }).click() | ||||||
|  |   await page.mouse.click(700, 200) | ||||||
|  |   // expect main content to contain `part005` i.e. started a new sketch | ||||||
|  |   await expect(page.locator('.cm-content')).toHaveText( | ||||||
|  |     /part005 = startSketchOn\('-XZ'\)/ | ||||||
|  |   ) | ||||||
|  | }) | ||||||
|  |  | ||||||
|  | test('Deselecting line tool should mean nothing happens on click', async ({ | ||||||
|  |   page, | ||||||
|  | }) => { | ||||||
|  |   const u = getUtils(page) | ||||||
|  |   await page.setViewportSize({ width: 1200, height: 500 }) | ||||||
|  |   await page.goto('/') | ||||||
|  |   await u.waitForAuthSkipAppStart() | ||||||
|  |   await u.openDebugPanel() | ||||||
|  |  | ||||||
|  |   await expect( | ||||||
|  |     page.getByRole('button', { name: 'Start Sketch' }) | ||||||
|  |   ).not.toBeDisabled() | ||||||
|  |   await expect(page.getByRole('button', { name: 'Start Sketch' })).toBeVisible() | ||||||
|  |  | ||||||
|  |   // click on "Start Sketch" button | ||||||
|  |   await u.clearCommandLogs() | ||||||
|  |   await u.doAndWaitForImageDiff( | ||||||
|  |     () => page.getByRole('button', { name: 'Start Sketch' }).click(), | ||||||
|  |     200 | ||||||
|  |   ) | ||||||
|  |  | ||||||
|  |   await page.mouse.click(700, 200) | ||||||
|  |  | ||||||
|  |   await expect(page.locator('.cm-content')).toHaveText( | ||||||
|  |     `const part001 = startSketchOn('-XZ')` | ||||||
|  |   ) | ||||||
|  |  | ||||||
|  |   await page.waitForTimeout(300) | ||||||
|  |  | ||||||
|  |   let previousCodeContent = await page.locator('.cm-content').innerText() | ||||||
|  |  | ||||||
|  |   // deselect the line tool by clicking it | ||||||
|  |   await page.getByRole('button', { name: 'Line' }).click() | ||||||
|  |  | ||||||
|  |   await page.mouse.click(700, 200) | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |   await page.mouse.click(700, 250) | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |   await page.mouse.click(750, 200) | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|  |   // expect no change | ||||||
|  |   await expect(page.locator('.cm-content')).toHaveText(previousCodeContent) | ||||||
|  |  | ||||||
|  |   // select line tool again | ||||||
|  |   await page.getByRole('button', { name: 'Line' }).click() | ||||||
|  |  | ||||||
|  |   await u.closeDebugPanel() | ||||||
|  |  | ||||||
|  |   // line tool should work as expected again | ||||||
|  |   await page.mouse.click(700, 200) | ||||||
|  |   await expect(page.locator('.cm-content')).not.toHaveText(previousCodeContent) | ||||||
|  |   previousCodeContent = await page.locator('.cm-content').innerText() | ||||||
|  |  | ||||||
|  |   await page.mouse.click(700, 300) | ||||||
|  |   await expect(page.locator('.cm-content')).not.toHaveText(previousCodeContent) | ||||||
|  |   previousCodeContent = await page.locator('.cm-content').innerText() | ||||||
|  |  | ||||||
|  |   await page.mouse.click(750, 300) | ||||||
|  |   await expect(page.locator('.cm-content')).not.toHaveText(previousCodeContent) | ||||||
|  |   previousCodeContent = await page.locator('.cm-content').innerText() | ||||||
|  | }) | ||||||
|  |  | ||||||
|  | test('Can edit segments by dragging their handles', async ({ | ||||||
|  |   page, | ||||||
|  |   context, | ||||||
|  | }) => { | ||||||
|  |   const u = getUtils(page) | ||||||
|  |   await context.addInitScript(async () => { | ||||||
|  |     localStorage.setItem( | ||||||
|  |       'persistCode', | ||||||
|  |       `const part001 = startSketchOn('-XZ') | ||||||
|  |   |> startProfileAt([4.61, -14.01], %) | ||||||
|  |   |> line([12.73, -0.09], %) | ||||||
|  |   |> tangentialArcTo([24.95, -5.38], %)` | ||||||
|  |     ) | ||||||
|  |   }) | ||||||
|  |  | ||||||
|  |   await page.setViewportSize({ width: 1200, height: 500 }) | ||||||
|  |   await page.goto('/') | ||||||
|  |   await u.waitForAuthSkipAppStart() | ||||||
|  |   await expect( | ||||||
|  |     page.getByRole('button', { name: 'Start Sketch' }) | ||||||
|  |   ).not.toBeDisabled() | ||||||
|  |  | ||||||
|  |   const startPX = [652, 418] | ||||||
|  |   const lineEndPX = [794, 416] | ||||||
|  |   const arcEndPX = [893, 318] | ||||||
|  |  | ||||||
|  |   const dragPX = 30 | ||||||
|  |  | ||||||
|  |   await page.getByText('startProfileAt([4.61, -14.01], %)').click() | ||||||
|  |   await expect(page.getByRole('button', { name: 'Edit Sketch' })).toBeVisible() | ||||||
|  |   await page.getByRole('button', { name: 'Edit Sketch' }).click() | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |   let prevContent = await page.locator('.cm-content').innerText() | ||||||
|  |  | ||||||
|  |   const step5 = { steps: 5 } | ||||||
|  |  | ||||||
|  |   // drag startProfieAt handle | ||||||
|  |   await page.mouse.move(startPX[0], startPX[1]) | ||||||
|  |   await page.mouse.down() | ||||||
|  |   await page.mouse.move(startPX[0] + dragPX, startPX[1] - dragPX, step5) | ||||||
|  |   await page.mouse.up() | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |   await expect(page.locator('.cm-content')).not.toHaveText(prevContent) | ||||||
|  |   prevContent = await page.locator('.cm-content').innerText() | ||||||
|  |  | ||||||
|  |   // drag line handle | ||||||
|  |   await page.mouse.move(lineEndPX[0] + dragPX, lineEndPX[1] - dragPX) | ||||||
|  |   await page.mouse.down() | ||||||
|  |   await page.mouse.move( | ||||||
|  |     lineEndPX[0] + dragPX * 2, | ||||||
|  |     lineEndPX[1] - dragPX * 2, | ||||||
|  |     step5 | ||||||
|  |   ) | ||||||
|  |   await page.mouse.up() | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |   await expect(page.locator('.cm-content')).not.toHaveText(prevContent) | ||||||
|  |   prevContent = await page.locator('.cm-content').innerText() | ||||||
|  |  | ||||||
|  |   // drag tangentialArcTo handle | ||||||
|  |   await page.mouse.move(arcEndPX[0], arcEndPX[1]) | ||||||
|  |   await page.mouse.down() | ||||||
|  |   await page.mouse.move(arcEndPX[0] + dragPX, arcEndPX[1] - dragPX, step5) | ||||||
|  |   await page.mouse.up() | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |   await expect(page.locator('.cm-content')).not.toHaveText(prevContent) | ||||||
|  |  | ||||||
|  |   // expect the code to have changed | ||||||
|  |   await expect(page.locator('.cm-content')) | ||||||
|  |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|  |   |> startProfileAt([7.01, -11.79], %) | ||||||
|  |   |> line([14.69, 2.73], %) | ||||||
|  |   |> tangentialArcTo([27.6, -3.25], %)`) | ||||||
|  | }) | ||||||
|  |  | ||||||
|  | test('Snap to close works (at any scale)', async ({ page }) => { | ||||||
|  |   const u = getUtils(page) | ||||||
|  |   await page.setViewportSize({ width: 1200, height: 500 }) | ||||||
|  |   await page.goto('/') | ||||||
|  |   await u.waitForAuthSkipAppStart() | ||||||
|  |   await u.openDebugPanel() | ||||||
|  |  | ||||||
|  |   await expect( | ||||||
|  |     page.getByRole('button', { name: 'Start Sketch' }) | ||||||
|  |   ).not.toBeDisabled() | ||||||
|  |   await expect(page.getByRole('button', { name: 'Start Sketch' })).toBeVisible() | ||||||
|  |  | ||||||
|  |   const doSnapAtDifferentScales = async ( | ||||||
|  |     camPos: [number, number, number], | ||||||
|  |     expectedCode: string | ||||||
|  |   ) => { | ||||||
|  |     await u.clearCommandLogs() | ||||||
|  |     await page.getByRole('button', { name: 'Start Sketch' }).click() | ||||||
|  |     await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|  |     await u.openAndClearDebugPanel() | ||||||
|  |     await u.updateCamPosition(camPos) | ||||||
|  |     await u.closeDebugPanel() | ||||||
|  |  | ||||||
|  |     // select a plane | ||||||
|  |     await page.mouse.click(700, 200) | ||||||
|  |     await expect(page.locator('.cm-content')).toHaveText( | ||||||
|  |       `const part001 = startSketchOn('XZ')` | ||||||
|  |     ) | ||||||
|  |  | ||||||
|  |     let prevContent = await page.locator('.cm-content').innerText() | ||||||
|  |  | ||||||
|  |     const pointA = [700, 200] | ||||||
|  |     const pointB = [900, 200] | ||||||
|  |     const pointC = [900, 400] | ||||||
|  |  | ||||||
|  |     // draw three lines | ||||||
|  |     await page.mouse.click(pointA[0], pointA[1]) | ||||||
|  |     await page.waitForTimeout(100) | ||||||
|  |     await expect(page.locator('.cm-content')).not.toHaveText(prevContent) | ||||||
|  |     prevContent = await page.locator('.cm-content').innerText() | ||||||
|  |  | ||||||
|  |     await page.mouse.click(pointB[0], pointB[1]) | ||||||
|  |     await page.waitForTimeout(100) | ||||||
|  |     await expect(page.locator('.cm-content')).not.toHaveText(prevContent) | ||||||
|  |     prevContent = await page.locator('.cm-content').innerText() | ||||||
|  |  | ||||||
|  |     await page.mouse.click(pointC[0], pointC[1]) | ||||||
|  |     await page.waitForTimeout(100) | ||||||
|  |     await expect(page.locator('.cm-content')).not.toHaveText(prevContent) | ||||||
|  |     prevContent = await page.locator('.cm-content').innerText() | ||||||
|  |  | ||||||
|  |     await page.mouse.move(pointA[0] - 12, pointA[1] + 12) | ||||||
|  |     const pointNotQuiteA = [pointA[0] - 7, pointA[1] + 7] | ||||||
|  |     await page.mouse.move(pointNotQuiteA[0], pointNotQuiteA[1], { steps: 10 }) | ||||||
|  |  | ||||||
|  |     await page.mouse.click(pointNotQuiteA[0], pointNotQuiteA[1]) | ||||||
|  |     await expect(page.locator('.cm-content')).not.toHaveText(prevContent) | ||||||
|  |     prevContent = await page.locator('.cm-content').innerText() | ||||||
|  |  | ||||||
|  |     await expect(page.locator('.cm-content')).toHaveText(expectedCode) | ||||||
|  |  | ||||||
|  |     // exit sketch | ||||||
|  |     await u.openAndClearDebugPanel() | ||||||
|  |     await page.getByRole('button', { name: 'Exit Sketch' }).click() | ||||||
|  |     await u.expectCmdLog('[data-message-type="execution-done"]') | ||||||
|  |     await u.removeCurrentCode() | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   const codeTemplate = ( | ||||||
|  |     scale = 1, | ||||||
|  |     fudge = 0 | ||||||
|  |   ) => `const part001 = startSketchOn('XZ') | ||||||
|  | |> startProfileAt([${roundOff(scale * 87.68)}, ${roundOff(scale * 43.84)}], %) | ||||||
|  | |> line([${roundOff(scale * 175.36)}, 0], %) | ||||||
|  | |> line([0, -${roundOff(scale * 175.37) + fudge}], %) | ||||||
|  | |> close(%)` | ||||||
|  |  | ||||||
|  |   await doSnapAtDifferentScales([0, 100, 100], codeTemplate(0.01, 0.01)) | ||||||
|  |  | ||||||
|  |   await doSnapAtDifferentScales([0, 10000, 10000], codeTemplate()) | ||||||
|  | }) | ||||||
|  | |||||||
| @ -1,10 +1,12 @@ | |||||||
| import { test, expect } from '@playwright/test' | import { test, expect, Download } from '@playwright/test' | ||||||
| import { secrets } from './secrets' | import { secrets } from './secrets' | ||||||
| import { getUtils } from './test-utils' | import { getUtils } from './test-utils' | ||||||
| import { Models } from '@kittycad/lib' | import { Models } from '@kittycad/lib' | ||||||
| import fsp from 'fs/promises' | import fsp from 'fs/promises' | ||||||
| import { spawn } from 'child_process' | import { spawn } from 'child_process' | ||||||
| import { APP_NAME } from 'lib/constants' | import { APP_NAME } from 'lib/constants' | ||||||
|  | import JSZip from 'jszip' | ||||||
|  | import path from 'path' | ||||||
|  |  | ||||||
| test.beforeEach(async ({ context, page }) => { | test.beforeEach(async ({ context, page }) => { | ||||||
|   await context.addInitScript(async (token) => { |   await context.addInitScript(async (token) => { | ||||||
| @ -29,90 +31,7 @@ test.beforeEach(async ({ context, page }) => { | |||||||
|   await page.emulateMedia({ reducedMotion: 'reduce' }) |   await page.emulateMedia({ reducedMotion: 'reduce' }) | ||||||
| }) | }) | ||||||
|  |  | ||||||
| test.setTimeout(60000) | test.setTimeout(60_000) | ||||||
|  |  | ||||||
| test('change camera, show planes', async ({ page, context }) => { |  | ||||||
|   const u = getUtils(page) |  | ||||||
|   await page.setViewportSize({ width: 1200, height: 500 }) |  | ||||||
|   await page.goto('/') |  | ||||||
|   await u.waitForAuthSkipAppStart() |  | ||||||
|   await u.openAndClearDebugPanel() |  | ||||||
|  |  | ||||||
|   const camPos: [number, number, number] = [0, 85, 85] |  | ||||||
|   await u.updateCamPosition(camPos) |  | ||||||
|  |  | ||||||
|   // rotate |  | ||||||
|   await u.closeDebugPanel() |  | ||||||
|   await page.mouse.move(700, 200) |  | ||||||
|   await page.mouse.down({ button: 'right' }) |  | ||||||
|   await page.mouse.move(600, 300) |  | ||||||
|   await page.mouse.up({ button: 'right' }) |  | ||||||
|  |  | ||||||
|   await u.openDebugPanel() |  | ||||||
|   await page.waitForTimeout(500) |  | ||||||
|   await u.clearCommandLogs() |  | ||||||
|  |  | ||||||
|   await page.getByRole('button', { name: 'Start Sketch' }).click() |  | ||||||
|  |  | ||||||
|   await u.closeDebugPanel() |  | ||||||
|  |  | ||||||
|   await expect(page).toHaveScreenshot({ |  | ||||||
|     maxDiffPixels: 100, |  | ||||||
|   }) |  | ||||||
|  |  | ||||||
|   await u.openAndClearDebugPanel() |  | ||||||
|   await page.getByRole('button', { name: 'Exit Sketch' }).click() |  | ||||||
|  |  | ||||||
|   await u.updateCamPosition(camPos) |  | ||||||
|  |  | ||||||
|   await u.clearCommandLogs() |  | ||||||
|   await u.closeDebugPanel() |  | ||||||
|   // pan |  | ||||||
|   await page.keyboard.down('Shift') |  | ||||||
|   await page.mouse.move(600, 200) |  | ||||||
|   await page.mouse.down({ button: 'right' }) |  | ||||||
|   await page.mouse.move(700, 200) |  | ||||||
|   await page.mouse.up({ button: 'right' }) |  | ||||||
|   await page.keyboard.up('Shift') |  | ||||||
|  |  | ||||||
|   await u.openDebugPanel() |  | ||||||
|   await page.waitForTimeout(300) |  | ||||||
|   await u.clearCommandLogs() |  | ||||||
|  |  | ||||||
|   await page.getByRole('button', { name: 'Start Sketch' }).click() |  | ||||||
|   await u.closeDebugPanel() |  | ||||||
|  |  | ||||||
|   await expect(page).toHaveScreenshot({ |  | ||||||
|     maxDiffPixels: 100, |  | ||||||
|   }) |  | ||||||
|  |  | ||||||
|   await u.openAndClearDebugPanel() |  | ||||||
|   await page.getByRole('button', { name: 'Exit Sketch' }).click() |  | ||||||
|  |  | ||||||
|   await u.updateCamPosition(camPos) |  | ||||||
|  |  | ||||||
|   await u.clearCommandLogs() |  | ||||||
|   await u.closeDebugPanel() |  | ||||||
|  |  | ||||||
|   // zoom |  | ||||||
|   await page.keyboard.down('Control') |  | ||||||
|   await page.mouse.move(700, 400) |  | ||||||
|   await page.mouse.down({ button: 'right' }) |  | ||||||
|   await page.mouse.move(700, 300) |  | ||||||
|   await page.mouse.up({ button: 'right' }) |  | ||||||
|   await page.keyboard.up('Control') |  | ||||||
|  |  | ||||||
|   await u.openDebugPanel() |  | ||||||
|   await page.waitForTimeout(300) |  | ||||||
|   await u.clearCommandLogs() |  | ||||||
|  |  | ||||||
|   await page.getByRole('button', { name: 'Start Sketch' }).click() |  | ||||||
|   await u.closeDebugPanel() |  | ||||||
|  |  | ||||||
|   await expect(page).toHaveScreenshot({ |  | ||||||
|     maxDiffPixels: 100, |  | ||||||
|   }) |  | ||||||
| }) |  | ||||||
|  |  | ||||||
| test('exports of each format should work', async ({ page, context }) => { | test('exports of each format should work', async ({ page, context }) => { | ||||||
|   // FYI this test doesn't work with only engine running locally |   // FYI this test doesn't work with only engine running locally | ||||||
| @ -160,7 +79,7 @@ const part001 = startSketchOn('-XZ') | |||||||
|       }, %) |       }, %) | ||||||
|   |> angledLineToY([segAng('seg02', %) + 180, -baseHeight], %) |   |> angledLineToY([segAng('seg02', %) + 180, -baseHeight], %) | ||||||
|   |> xLineTo(ZERO, %) |   |> xLineTo(ZERO, %) | ||||||
|   |> close(%)  |   |> close(%) | ||||||
|   |> extrude(4, %)` |   |> extrude(4, %)` | ||||||
|     ) |     ) | ||||||
|   }) |   }) | ||||||
| @ -173,8 +92,6 @@ const part001 = startSketchOn('-XZ') | |||||||
|   await page.waitForTimeout(1000) |   await page.waitForTimeout(1000) | ||||||
|   await u.clearAndCloseDebugPanel() |   await u.clearAndCloseDebugPanel() | ||||||
|  |  | ||||||
|   await page.getByRole('button', { name: APP_NAME }).click() |  | ||||||
|  |  | ||||||
|   interface Paths { |   interface Paths { | ||||||
|     modelPath: string |     modelPath: string | ||||||
|     imagePath: string |     imagePath: string | ||||||
| @ -183,48 +100,54 @@ const part001 = startSketchOn('-XZ') | |||||||
|   const doExport = async ( |   const doExport = async ( | ||||||
|     output: Models['OutputFormat_type'] |     output: Models['OutputFormat_type'] | ||||||
|   ): Promise<Paths> => { |   ): Promise<Paths> => { | ||||||
|     await page.getByRole('button', { name: 'Export Model' }).click() |     await page.getByRole('button', { name: APP_NAME }).click() | ||||||
|  |     await expect( | ||||||
|     const exportSelect = page.getByTestId('export-type') |       page.getByRole('button', { name: 'Export Part' }) | ||||||
|     await exportSelect.selectOption({ label: output.type }) |     ).toBeVisible() | ||||||
|  |     await page.getByRole('button', { name: 'Export Part' }).click() | ||||||
|  |     await expect(page.getByTestId('command-bar')).toBeVisible() | ||||||
|  |  | ||||||
|  |     // Go through export via command bar | ||||||
|  |     await page.getByRole('option', { name: output.type, exact: false }).click() | ||||||
|  |     await page.locator('#arg-form').waitFor({ state: 'detached' }) | ||||||
|     if ('storage' in output) { |     if ('storage' in output) { | ||||||
|       const storageSelect = page.getByTestId('export-storage') |       await page.getByTestId('arg-name-storage').waitFor({ timeout: 1000 }) | ||||||
|       await storageSelect.selectOption({ label: output.storage }) |       await page.getByRole('button', { name: 'storage', exact: false }).click() | ||||||
|  |       await page | ||||||
|  |         .getByRole('option', { name: output.storage, exact: false }) | ||||||
|  |         .click() | ||||||
|  |       await page.locator('#arg-form').waitFor({ state: 'detached' }) | ||||||
|  |     } | ||||||
|  |     await expect(page.getByText('Confirm Export')).toBeVisible() | ||||||
|  |  | ||||||
|  |     const getPromiseAndResolve = () => { | ||||||
|  |       let resolve: any = () => {} | ||||||
|  |       const promise = new Promise<Download>((r) => { | ||||||
|  |         resolve = r | ||||||
|  |       }) | ||||||
|  |       return [promise, resolve] | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     const downloadPromise = page.waitForEvent('download') |     const [downloadPromise1, downloadResolve1] = getPromiseAndResolve() | ||||||
|     await page.getByRole('button', { name: 'Export', exact: true }).click() |     let downloadCnt = 0 | ||||||
|     const download = await downloadPromise |  | ||||||
|  |     page.on('download', async (download) => { | ||||||
|  |       if (downloadCnt === 0) { | ||||||
|  |         downloadResolve1(download) | ||||||
|  |       } | ||||||
|  |       downloadCnt++ | ||||||
|  |     }) | ||||||
|  |     await page.getByRole('button', { name: 'Submit command' }).click() | ||||||
|  |  | ||||||
|  |     // Handle download | ||||||
|  |     const download = await downloadPromise1 | ||||||
|     const downloadLocationer = (extra = '', isImage = false) => |     const downloadLocationer = (extra = '', isImage = false) => | ||||||
|       `./e2e/playwright/export-snapshots/${output.type}-${ |       `./e2e/playwright/export-snapshots/${output.type}-${ | ||||||
|         'storage' in output ? output.storage : '' |         'storage' in output ? output.storage : '' | ||||||
|       }${extra}.${isImage ? 'png' : output.type}` |       }${extra}.${isImage ? 'png' : output.type}` | ||||||
|     const downloadLocation = downloadLocationer() |     const downloadLocation = downloadLocationer() | ||||||
|     const downloadLocation2 = downloadLocationer('-2') |  | ||||||
|  |  | ||||||
|     if (output.type === 'gltf' && output.storage === 'standard') { |     await download.saveAs(downloadLocation) | ||||||
|       // wait for second download |  | ||||||
|       const download2 = await page.waitForEvent('download') |  | ||||||
|       await download.saveAs(downloadLocation) |  | ||||||
|       await download2.saveAs(downloadLocation2) |  | ||||||
|  |  | ||||||
|       // rewrite uri to reference our file name |  | ||||||
|       const fileContents = await fsp.readFile(downloadLocation, 'utf-8') |  | ||||||
|       const isJson = fileContents.includes('buffers') |  | ||||||
|       let contents = fileContents |  | ||||||
|       let reWriteLocation = downloadLocation |  | ||||||
|       let uri = downloadLocation2.split('/').pop() |  | ||||||
|       if (!isJson) { |  | ||||||
|         contents = await fsp.readFile(downloadLocation2, 'utf-8') |  | ||||||
|         reWriteLocation = downloadLocation2 |  | ||||||
|         uri = downloadLocation.split('/').pop() |  | ||||||
|       } |  | ||||||
|       contents = contents.replace(/"uri": ".*"/g, `"uri": "${uri}"`) |  | ||||||
|       await fsp.writeFile(reWriteLocation, contents) |  | ||||||
|     } else { |  | ||||||
|       await download.saveAs(downloadLocation) |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     if (output.type === 'step') { |     if (output.type === 'step') { | ||||||
|       // stable timestamps for step files |       // stable timestamps for step files | ||||||
| @ -328,38 +251,82 @@ const part001 = startSketchOn('-XZ') | |||||||
|       presentation: 'pretty', |       presentation: 'pretty', | ||||||
|     }) |     }) | ||||||
|   ) |   ) | ||||||
|  |   exportLocations.push( | ||||||
|   // TODO: gltfs don't seem to work with snap shots. push onto exportLocations once it's figured out |     await doExport({ | ||||||
|   await doExport({ |       type: 'gltf', | ||||||
|     type: 'gltf', |       storage: 'standard', | ||||||
|     storage: 'standard', |       presentation: 'pretty', | ||||||
|     presentation: 'pretty', |     }) | ||||||
|   }) |   ) | ||||||
|  |  | ||||||
|   // close page to disconnect websocket since we can only have one open atm |   // close page to disconnect websocket since we can only have one open atm | ||||||
|   await page.close() |   await page.close() | ||||||
|  |  | ||||||
|   // snapshot exports, good compromise to capture that exports are healthy without getting bogged down in "did the formatting change" changes |   // snapshot exports, good compromise to capture that exports are healthy without getting bogged down in "did the formatting change" changes | ||||||
|   // context: https://github.com/KittyCAD/modeling-app/issues/1222 |   // context: https://github.com/KittyCAD/modeling-app/issues/1222 | ||||||
|   for (const { modelPath, imagePath, outputType } of exportLocations) { |   for (let { modelPath, imagePath, outputType } of exportLocations) { | ||||||
|     const cliCommand = `export KITTYCAD_TOKEN=${secrets.snapshottoken} && kittycad file snapshot --output-format=png --src-format=${outputType} ${modelPath} ${imagePath}` |     // May change depending on the file being dealt with | ||||||
|  |     let cliCommand = `export ZOO_TOKEN=${secrets.snapshottoken} && zoo file snapshot --output-format=png --src-format=${outputType} ${modelPath} ${imagePath}` | ||||||
|  |  | ||||||
|  |     const parentPath = path.dirname(modelPath) | ||||||
|  |  | ||||||
|  |     // This is actually a zip file. | ||||||
|  |     if (modelPath.includes('gltf-standard.gltf')) { | ||||||
|  |       console.log('Extracting files from archive') | ||||||
|  |       const readZipFile = fsp.readFile(modelPath) | ||||||
|  |       const unzip = (archive: any) => | ||||||
|  |         Object.values(archive.files).map((file: any) => ({ | ||||||
|  |           name: file.name, | ||||||
|  |           promise: file.async('nodebuffer'), | ||||||
|  |         })) | ||||||
|  |       const writeFiles = (files: any) => | ||||||
|  |         Promise.all( | ||||||
|  |           files.map((file: any) => | ||||||
|  |             file.promise.then((data: any) => { | ||||||
|  |               console.log(`Writing ${file.name}`) | ||||||
|  |               return fsp | ||||||
|  |                 .writeFile(`${parentPath}/${file.name}`, data) | ||||||
|  |                 .then(() => file.name) | ||||||
|  |             }) | ||||||
|  |           ) | ||||||
|  |         ) | ||||||
|  |  | ||||||
|  |       const filenames = await readZipFile | ||||||
|  |         .then(JSZip.loadAsync) | ||||||
|  |         .then(unzip) | ||||||
|  |         .then(writeFiles) | ||||||
|  |       const gltfFilename = filenames.filter((t: string) => | ||||||
|  |         t.includes('.gltf') | ||||||
|  |       )[0] | ||||||
|  |       if (!gltfFilename) throw new Error('No output.gltf in this archive') | ||||||
|  |       cliCommand = `export ZOO_TOKEN=${secrets.snapshottoken} && zoo file snapshot --output-format=png --src-format=${outputType} ${parentPath}/${gltfFilename} ${imagePath}` | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     console.log(cliCommand) | ||||||
|  |  | ||||||
|     const child = spawn(cliCommand, { shell: true }) |     const child = spawn(cliCommand, { shell: true }) | ||||||
|     await new Promise((resolve, reject) => { |     const result = await new Promise<string>((resolve, reject) => { | ||||||
|       child.on('error', (code: any, msg: any) => { |       child.on('error', (code: any, msg: any) => { | ||||||
|         console.log('error', code, msg) |         console.log('error', code, msg) | ||||||
|         reject() |         reject('error') | ||||||
|       }) |       }) | ||||||
|       child.on('exit', (code, msg) => { |       child.on('exit', (code, msg) => { | ||||||
|         console.log('exit', code, msg) |         console.log('exit', code, msg) | ||||||
|         if (code !== 0) { |         if (code !== 0) { | ||||||
|           reject(`exit code ${code} for model ${modelPath}`) |           reject(`exit code ${code} for model ${modelPath}`) | ||||||
|         } else { |         } else { | ||||||
|           resolve(true) |           resolve('success') | ||||||
|         } |         } | ||||||
|       }) |       }) | ||||||
|       child.stderr.on('data', (data) => console.log(`stderr: ${data}`)) |       child.stderr.on('data', (data) => console.log(`stderr: ${data}`)) | ||||||
|       child.stdout.on('data', (data) => console.log(`stdout: ${data}`)) |       child.stdout.on('data', (data) => console.log(`stdout: ${data}`)) | ||||||
|     }) |     }) | ||||||
|  |     expect(result).toBe('success') | ||||||
|  |     if (result === 'success') { | ||||||
|  |       console.log(`snapshot taken for ${modelPath}`) | ||||||
|  |     } else { | ||||||
|  |       console.log(`snapshot failed for ${modelPath}`) | ||||||
|  |     } | ||||||
|   } |   } | ||||||
| }) | }) | ||||||
|  |  | ||||||
| @ -369,13 +336,13 @@ test('extrude on each default plane should be stable', async ({ | |||||||
| }) => { | }) => { | ||||||
|   const u = getUtils(page) |   const u = getUtils(page) | ||||||
|   const makeCode = (plane = 'XY') => `const part001 = startSketchOn('${plane}') |   const makeCode = (plane = 'XY') => `const part001 = startSketchOn('${plane}') | ||||||
|   |> startProfileAt([14.06, 8.88], %) |   |> startProfileAt([7.00, 4.40], %) | ||||||
|   |> line([12.98, -0.15], %) |   |> line([6.60, -0.20], %) | ||||||
|   |> line([5.56, 9.89], %) |   |> line([2.80, 5.00], %) | ||||||
|   |> line([-11.28, 8.96], %) |   |> line([-5.60, 4.40], %) | ||||||
|   |> line([-10.81, -7.57], %) |   |> line([-5.40, -3.80], %) | ||||||
|   |> close(%) |   |> close(%) | ||||||
|   |> extrude(20, %) |   |> extrude(10.00, %) | ||||||
| ` | ` | ||||||
|   await context.addInitScript(async (code) => { |   await context.addInitScript(async (code) => { | ||||||
|     localStorage.setItem('persistCode', code) |     localStorage.setItem('persistCode', code) | ||||||
| @ -419,3 +386,277 @@ test('extrude on each default plane should be stable', async ({ | |||||||
|   await runSnapshotsForOtherPlanes('YZ') |   await runSnapshotsForOtherPlanes('YZ') | ||||||
|   await runSnapshotsForOtherPlanes('-YZ') |   await runSnapshotsForOtherPlanes('-YZ') | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | test('Draft segments should look right', async ({ page, context }) => { | ||||||
|  |   await context.addInitScript(async () => { | ||||||
|  |     localStorage.setItem( | ||||||
|  |       'SETTINGS_PERSIST_KEY', | ||||||
|  |       JSON.stringify({ | ||||||
|  |         baseUnit: 'in', | ||||||
|  |         cameraControls: 'KittyCAD', | ||||||
|  |         defaultDirectory: '', | ||||||
|  |         defaultProjectName: 'project-$nnn', | ||||||
|  |         onboardingStatus: 'dismissed', | ||||||
|  |         showDebugPanel: true, | ||||||
|  |         textWrapping: 'On', | ||||||
|  |         theme: 'system', | ||||||
|  |         unitSystem: 'imperial', | ||||||
|  |       }) | ||||||
|  |     ) | ||||||
|  |   }) | ||||||
|  |   const u = getUtils(page) | ||||||
|  |   await page.setViewportSize({ width: 1200, height: 500 }) | ||||||
|  |   const PUR = 400 / 37.5 //pixeltoUnitRatio | ||||||
|  |   await page.goto('/') | ||||||
|  |   await u.waitForAuthSkipAppStart() | ||||||
|  |   await u.openDebugPanel() | ||||||
|  |  | ||||||
|  |   await expect( | ||||||
|  |     page.getByRole('button', { name: 'Start Sketch' }) | ||||||
|  |   ).not.toBeDisabled() | ||||||
|  |   await expect(page.getByRole('button', { name: 'Start Sketch' })).toBeVisible() | ||||||
|  |  | ||||||
|  |   // click on "Start Sketch" button | ||||||
|  |   await u.clearCommandLogs() | ||||||
|  |   await u.doAndWaitForImageDiff( | ||||||
|  |     () => page.getByRole('button', { name: 'Start Sketch' }).click(), | ||||||
|  |     200 | ||||||
|  |   ) | ||||||
|  |  | ||||||
|  |   // select a plane | ||||||
|  |   await page.mouse.click(700, 200) | ||||||
|  |  | ||||||
|  |   await expect(page.locator('.cm-content')).toHaveText( | ||||||
|  |     `const part001 = startSketchOn('-XZ')` | ||||||
|  |   ) | ||||||
|  |  | ||||||
|  |   await page.waitForTimeout(300) // TODO detect animation ending, or disable animation | ||||||
|  |  | ||||||
|  |   const startXPx = 600 | ||||||
|  |   await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10) | ||||||
|  |   await expect(page.locator('.cm-content')) | ||||||
|  |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|  |   |> startProfileAt([9.06, -12.22], %)`) | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|  |   await u.closeDebugPanel() | ||||||
|  |   await page.mouse.move(startXPx + PUR * 20, 500 - PUR * 10) | ||||||
|  |   await expect(page).toHaveScreenshot({ | ||||||
|  |     maxDiffPixels: 100, | ||||||
|  |   }) | ||||||
|  |  | ||||||
|  |   await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10) | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|  |   await expect(page.locator('.cm-content')) | ||||||
|  |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|  |   |> startProfileAt([9.06, -12.22], %) | ||||||
|  |   |> line([9.14, 0], %)`) | ||||||
|  |  | ||||||
|  |   await page.getByRole('button', { name: 'Tangential Arc' }).click() | ||||||
|  |  | ||||||
|  |   await page.mouse.move(startXPx + PUR * 30, 500 - PUR * 20, { steps: 10 }) | ||||||
|  |  | ||||||
|  |   await expect(page).toHaveScreenshot({ | ||||||
|  |     maxDiffPixels: 100, | ||||||
|  |   }) | ||||||
|  | }) | ||||||
|  |  | ||||||
|  | test('Client side scene scale should match engine scale inch', async ({ | ||||||
|  |   page, | ||||||
|  |   context, | ||||||
|  | }) => { | ||||||
|  |   await context.addInitScript(async () => { | ||||||
|  |     localStorage.setItem( | ||||||
|  |       'SETTINGS_PERSIST_KEY', | ||||||
|  |       JSON.stringify({ | ||||||
|  |         baseUnit: 'in', | ||||||
|  |         cameraControls: 'KittyCAD', | ||||||
|  |         defaultDirectory: '', | ||||||
|  |         defaultProjectName: 'project-$nnn', | ||||||
|  |         onboardingStatus: 'dismissed', | ||||||
|  |         showDebugPanel: true, | ||||||
|  |         textWrapping: 'On', | ||||||
|  |         theme: 'system', | ||||||
|  |         unitSystem: 'imperial', | ||||||
|  |       }) | ||||||
|  |     ) | ||||||
|  |   }) | ||||||
|  |   const u = getUtils(page) | ||||||
|  |   await page.setViewportSize({ width: 1200, height: 500 }) | ||||||
|  |   const PUR = 400 / 37.5 //pixeltoUnitRatio | ||||||
|  |   await page.goto('/') | ||||||
|  |   await u.waitForAuthSkipAppStart() | ||||||
|  |   await u.openDebugPanel() | ||||||
|  |  | ||||||
|  |   await expect( | ||||||
|  |     page.getByRole('button', { name: 'Start Sketch' }) | ||||||
|  |   ).not.toBeDisabled() | ||||||
|  |   await expect(page.getByRole('button', { name: 'Start Sketch' })).toBeVisible() | ||||||
|  |  | ||||||
|  |   // click on "Start Sketch" button | ||||||
|  |   await u.clearCommandLogs() | ||||||
|  |   await u.doAndWaitForImageDiff( | ||||||
|  |     () => page.getByRole('button', { name: 'Start Sketch' }).click(), | ||||||
|  |     200 | ||||||
|  |   ) | ||||||
|  |  | ||||||
|  |   // select a plane | ||||||
|  |   await page.mouse.click(700, 200) | ||||||
|  |  | ||||||
|  |   await expect(page.locator('.cm-content')).toHaveText( | ||||||
|  |     `const part001 = startSketchOn('-XZ')` | ||||||
|  |   ) | ||||||
|  |  | ||||||
|  |   await page.waitForTimeout(300) // TODO detect animation ending, or disable animation | ||||||
|  |  | ||||||
|  |   const startXPx = 600 | ||||||
|  |   await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10) | ||||||
|  |   await expect(page.locator('.cm-content')) | ||||||
|  |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|  | |> startProfileAt([9.06, -12.22], %)`) | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|  |   await u.closeDebugPanel() | ||||||
|  |  | ||||||
|  |   await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10) | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|  |   await expect(page.locator('.cm-content')) | ||||||
|  |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|  | |> startProfileAt([9.06, -12.22], %) | ||||||
|  | |> line([9.14, 0], %)`) | ||||||
|  |  | ||||||
|  |   await page.getByRole('button', { name: 'Tangential Arc' }).click() | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|  |   await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20) | ||||||
|  |  | ||||||
|  |   await expect(page.locator('.cm-content')) | ||||||
|  |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|  | |> startProfileAt([9.06, -12.22], %) | ||||||
|  | |> line([9.14, 0], %) | ||||||
|  | |> tangentialArcTo([27.34, -3.08], %)`) | ||||||
|  |  | ||||||
|  |   // click tangential arc tool again to unequip it | ||||||
|  |   await page.getByRole('button', { name: 'Tangential Arc' }).click() | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|  |   // screen shot should show the sketch | ||||||
|  |   await expect(page).toHaveScreenshot({ | ||||||
|  |     maxDiffPixels: 100, | ||||||
|  |   }) | ||||||
|  |  | ||||||
|  |   // exit sketch | ||||||
|  |   await u.openAndClearDebugPanel() | ||||||
|  |   await page.getByRole('button', { name: 'Exit Sketch' }).click() | ||||||
|  |  | ||||||
|  |   // wait for execution done | ||||||
|  |   await u.expectCmdLog('[data-message-type="execution-done"]') | ||||||
|  |   await u.clearAndCloseDebugPanel() | ||||||
|  |   await page.waitForTimeout(200) | ||||||
|  |  | ||||||
|  |   // second screen shot should look almost identical, i.e. scale should be the same. | ||||||
|  |   await expect(page).toHaveScreenshot({ | ||||||
|  |     maxDiffPixels: 100, | ||||||
|  |   }) | ||||||
|  | }) | ||||||
|  |  | ||||||
|  | test('Client side scene scale should match engine scale mm', async ({ | ||||||
|  |   page, | ||||||
|  |   context, | ||||||
|  | }) => { | ||||||
|  |   await context.addInitScript(async () => { | ||||||
|  |     localStorage.setItem( | ||||||
|  |       'SETTINGS_PERSIST_KEY', | ||||||
|  |       JSON.stringify({ | ||||||
|  |         baseUnit: 'mm', | ||||||
|  |         cameraControls: 'KittyCAD', | ||||||
|  |         defaultDirectory: '', | ||||||
|  |         defaultProjectName: 'project-$nnn', | ||||||
|  |         onboardingStatus: 'dismissed', | ||||||
|  |         showDebugPanel: true, | ||||||
|  |         textWrapping: 'On', | ||||||
|  |         theme: 'system', | ||||||
|  |         unitSystem: 'metric', | ||||||
|  |       }) | ||||||
|  |     ) | ||||||
|  |   }) | ||||||
|  |   const u = getUtils(page) | ||||||
|  |   await page.setViewportSize({ width: 1200, height: 500 }) | ||||||
|  |   const PUR = 400 / 37.5 //pixeltoUnitRatio | ||||||
|  |   await page.goto('/') | ||||||
|  |   await u.waitForAuthSkipAppStart() | ||||||
|  |   await u.openDebugPanel() | ||||||
|  |  | ||||||
|  |   await expect( | ||||||
|  |     page.getByRole('button', { name: 'Start Sketch' }) | ||||||
|  |   ).not.toBeDisabled() | ||||||
|  |   await expect(page.getByRole('button', { name: 'Start Sketch' })).toBeVisible() | ||||||
|  |  | ||||||
|  |   // click on "Start Sketch" button | ||||||
|  |   await u.clearCommandLogs() | ||||||
|  |   await u.doAndWaitForImageDiff( | ||||||
|  |     () => page.getByRole('button', { name: 'Start Sketch' }).click(), | ||||||
|  |     200 | ||||||
|  |   ) | ||||||
|  |  | ||||||
|  |   // select a plane | ||||||
|  |   await page.mouse.click(700, 200) | ||||||
|  |  | ||||||
|  |   await expect(page.locator('.cm-content')).toHaveText( | ||||||
|  |     `const part001 = startSketchOn('-XZ')` | ||||||
|  |   ) | ||||||
|  |  | ||||||
|  |   await page.waitForTimeout(300) // TODO detect animation ending, or disable animation | ||||||
|  |  | ||||||
|  |   const startXPx = 600 | ||||||
|  |   await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10) | ||||||
|  |   await expect(page.locator('.cm-content')) | ||||||
|  |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|  |   |> startProfileAt([230.03, -310.33], %)`) | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|  |   await u.closeDebugPanel() | ||||||
|  |  | ||||||
|  |   await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10) | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|  |   await expect(page.locator('.cm-content')) | ||||||
|  |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|  |   |> startProfileAt([230.03, -310.33], %) | ||||||
|  |   |> line([232.2, 0], %)`) | ||||||
|  |  | ||||||
|  |   await page.getByRole('button', { name: 'Tangential Arc' }).click() | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|  |   await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20) | ||||||
|  |  | ||||||
|  |   await expect(page.locator('.cm-content')) | ||||||
|  |     .toHaveText(`const part001 = startSketchOn('-XZ') | ||||||
|  |   |> startProfileAt([230.03, -310.33], %) | ||||||
|  |   |> line([232.2, 0], %) | ||||||
|  |   |> tangentialArcTo([694.43, -78.12], %)`) | ||||||
|  |  | ||||||
|  |   await page.getByRole('button', { name: 'Tangential Arc' }).click() | ||||||
|  |   await page.waitForTimeout(100) | ||||||
|  |  | ||||||
|  |   // screen shot should show the sketch | ||||||
|  |   await expect(page).toHaveScreenshot({ | ||||||
|  |     maxDiffPixels: 100, | ||||||
|  |   }) | ||||||
|  |  | ||||||
|  |   // exit sketch | ||||||
|  |   await u.openAndClearDebugPanel() | ||||||
|  |   await page.getByRole('button', { name: 'Exit Sketch' }).click() | ||||||
|  |  | ||||||
|  |   // wait for execution done | ||||||
|  |   await u.expectCmdLog('[data-message-type="execution-done"]') | ||||||
|  |   await u.clearAndCloseDebugPanel() | ||||||
|  |   await page.waitForTimeout(200) | ||||||
|  |  | ||||||
|  |   // second screen shot should look almost identical, i.e. scale should be the same. | ||||||
|  |   await expect(page).toHaveScreenshot({ | ||||||
|  |     maxDiffPixels: 100, | ||||||
|  |   }) | ||||||
|  | }) | ||||||
|  | |||||||
| After Width: | Height: | Size: 44 KiB | 
