Compare commits
31 Commits
paultag/im
...
jess/chang
Author | SHA1 | Date | |
---|---|---|---|
495727d617 | |||
e943303434 | |||
8ce175f006 | |||
13aa178734 | |||
de137ff13b | |||
48e1a8ed02 | |||
a059166b9c | |||
086a2b851d | |||
8e4c5fb24d | |||
6993893600 | |||
bfdf8babed | |||
4d31fb890d | |||
ef451fd8f7 | |||
656eb0abec | |||
a7896329f7 | |||
b9e11ac201 | |||
1aa27bd91c | |||
118ec28b04 | |||
449b43792b | |||
f1e95156ea | |||
45e5b25cda | |||
bdec611cf3 | |||
fa612d5f28 | |||
d270447777 | |||
1a59fc4f99 | |||
d38dcb9ba2 | |||
c7b348390e | |||
bf6c91932c | |||
716ed3acb3 | |||
65e08bea92 | |||
74859e99e7 |
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -1,5 +1,5 @@
|
||||
name: Bug Report
|
||||
description: File a bug report for the Zoo Modeling App
|
||||
description: File a bug report for the Zoo Design Studio
|
||||
title: "[BUG]: "
|
||||
labels: ["bug"]
|
||||
assignees: []
|
||||
@ -70,7 +70,7 @@ body:
|
||||
id: version
|
||||
attributes:
|
||||
label: Version
|
||||
description: "The version of the Zoo Modeling App you're using."
|
||||
description: "The version of the Zoo Design Studio you're using."
|
||||
placeholder: "example: v0.15.0. You can find this in the settings."
|
||||
validations:
|
||||
required: true
|
||||
|
2
.github/workflows/build-apps.yml
vendored
@ -241,7 +241,7 @@ jobs:
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: out-arm64-${{ matrix.platform }}
|
||||
# first two will pick both Zoo Modeling App-$VERSION-arm64-win.exe and Zoo Modeling App-$VERSION-win.exe
|
||||
# first two will pick both Zoo Design Studio-$VERSION-arm64-win.exe and Zoo Design Studio-$VERSION-win.exe
|
||||
path: |
|
||||
out/*-${{ env.VERSION_NO_V }}-win.*
|
||||
out/*-${{ env.VERSION_NO_V }}-arm64-win.*
|
||||
|
8
.github/workflows/e2e-tests.yml
vendored
@ -281,7 +281,7 @@ jobs:
|
||||
os:
|
||||
- "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||
- namespace-profile-macos-8-cores
|
||||
- windows-latest
|
||||
- windows-latest-8-cores
|
||||
shardIndex: [1, 2, 3, 4]
|
||||
shardTotal: [4]
|
||||
# Disable macos and windows tests on hourly e2e tests since we only care
|
||||
@ -292,7 +292,7 @@ jobs:
|
||||
exclude:
|
||||
- os: namespace-profile-macos-8-cores
|
||||
isScheduled: true
|
||||
- os: windows-latest
|
||||
- os: windows-latest-8-cores
|
||||
isScheduled: true
|
||||
# TODO: add ref here for main and latest release tag
|
||||
runs-on: ${{ matrix.os }}
|
||||
@ -370,8 +370,8 @@ jobs:
|
||||
with:
|
||||
shell: bash
|
||||
command: .github/ci-cd-scripts/playwright-electron.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{ env.OS_NAME }}
|
||||
timeout_minutes: 45
|
||||
max_attempts: 15
|
||||
timeout_minutes: 30
|
||||
max_attempts: 9
|
||||
env:
|
||||
FAIL_ON_CONSOLE_ERRORS: true
|
||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
|
20
INSTALL.md
@ -1,27 +1,27 @@
|
||||
# Setting Up Zoo Modeling App
|
||||
# Setting Up Zoo Design Studio
|
||||
|
||||
Compared to other CAD software, getting Zoo Modeling App up and running is quick and straightforward across platforms. It's about 100MB to download and is quick to install.
|
||||
Compared to other CAD software, getting Zoo Design Studio up and running is quick and straightforward across platforms. It's about 100MB to download and is quick to install.
|
||||
|
||||
## Windows
|
||||
|
||||
1. Download the [Zoo Modeling App installer](https://zoo.dev/modeling-app/download) for Windows and for your processor type.
|
||||
1. Download the [Zoo Design Studio installer](https://zoo.dev/modeling-app/download) for Windows and for your processor type.
|
||||
|
||||
2. Once downloaded, run the installer `Zoo Modeling App-{version}-{arch}-win.exe` which should take a few seconds.
|
||||
2. Once downloaded, run the installer `Zoo Design Studio-{version}-{arch}-win.exe` which should take a few seconds.
|
||||
|
||||
3. The installation happens at `C:\Program Files\Zoo Modeling App`. A shortcut in the start menu is also created so you can run the app easily by clicking on it.
|
||||
3. The installation happens at `C:\Program Files\Zoo Design Studio`. A shortcut in the start menu is also created so you can run the app easily by clicking on it.
|
||||
|
||||
## macOS
|
||||
|
||||
1. Download the [Zoo Modeling App installer](https://zoo.dev/modeling-app/download) for macOS and for your processor type.
|
||||
1. Download the [Zoo Design Studio installer](https://zoo.dev/modeling-app/download) for macOS and for your processor type.
|
||||
|
||||
2. Once downloaded, open the disk image `Zoo Modeling App-{version}-{arch}-mac.dmg` and drag the applications to your `Applications` directory.
|
||||
2. Once downloaded, open the disk image `Zoo Design Studio-{version}-{arch}-mac.dmg` and drag the applications to your `Applications` directory.
|
||||
|
||||
3. You can then open your `Applications` directory and double-click on `Zoo Modeling App` to open.
|
||||
3. You can then open your `Applications` directory and double-click on `Zoo Design Studio` to open.
|
||||
|
||||
|
||||
## Linux
|
||||
|
||||
1. Download the [Zoo Modeling App installer](https://zoo.dev/modeling-app/download) for Linux and for your processor type.
|
||||
1. Download the [Zoo Design Studio installer](https://zoo.dev/modeling-app/download) for Linux and for your processor type.
|
||||
|
||||
2. Install the dependencies needed to run the [AppImage format](https://appimage.org/).
|
||||
- On Ubuntu, install the FUSE library with these commands in a terminal.
|
||||
@ -30,7 +30,7 @@ Compared to other CAD software, getting Zoo Modeling App up and running is quick
|
||||
sudo apt install libfuse2
|
||||
```
|
||||
- Optionally, follow [these steps](https://github.com/probonopd/go-appimage/blob/master/src/appimaged/README.md#initial-setup) to install `appimaged`. It is a daemon that makes interacting with AppImage files more seamless.
|
||||
- Once installed, copy the downloaded `Zoo Modeling App-{version}-{arch}-linux.AppImage` to the directory of your choice, for instance `~/Applications`.
|
||||
- Once installed, copy the downloaded `Zoo Design Studio-{version}-{arch}-linux.AppImage` to the directory of your choice, for instance `~/Applications`.
|
||||
|
||||
- `appimaged` should automatically find it and make it executable. If not, run:
|
||||
```bash
|
||||
|
18
Makefile
@ -87,7 +87,7 @@ lint: install ## Lint the code
|
||||
###############################################################################
|
||||
# RUN
|
||||
|
||||
TARGET ?= web
|
||||
TARGET ?= desktop
|
||||
|
||||
.PHONY: run
|
||||
run: run-$(TARGET)
|
||||
@ -103,9 +103,9 @@ run-desktop: install build-desktop ## Start the desktop app
|
||||
###############################################################################
|
||||
# TEST
|
||||
|
||||
E2E_WORKERS ?= 1
|
||||
E2E_GREP ?=
|
||||
E2E_WORKERS ?=
|
||||
E2E_FAILURES ?= 1
|
||||
E2E_GREP ?= ""
|
||||
|
||||
.PHONY: test
|
||||
test: test-unit test-e2e
|
||||
@ -121,11 +121,19 @@ test-e2e: test-e2e-$(TARGET)
|
||||
.PHONY: test-e2e-web
|
||||
test-e2e-web: install build-web ## Run the web e2e tests
|
||||
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
|
||||
yarn chrome:test --headed --workers=$(E2E_WORKERS) --max-failures=$(E2E_FAILURES) --grep=$(E2E_GREP)
|
||||
ifdef E2E_GREP
|
||||
yarn chrome:test --headed --grep="$(E2E_GREP)" --max-failures=$(E2E_FAILURES)
|
||||
else
|
||||
yarn chrome:test --headed --workers='100%'
|
||||
endif
|
||||
|
||||
.PHONY: test-e2e-desktop
|
||||
test-e2e-desktop: install build-desktop ## Run the desktop e2e tests
|
||||
yarn test:playwright:electron --workers=$(E2E_WORKERS) --max-failures=$(E2E_FAILURES) --grep="$(E2E_GREP)"
|
||||
ifdef E2E_GREP
|
||||
yarn test:playwright:electron --grep="$(E2E_GREP)" --max-failures=$(E2E_FAILURES)
|
||||
else
|
||||
yarn test:playwright:electron --workers='100%'
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# CLEAN
|
||||
|
16
README.md
@ -1,17 +1,17 @@
|
||||

|
||||

|
||||
|
||||
## Zoo Modeling App
|
||||
## Zoo Design Studio
|
||||
|
||||
download at [zoo.dev/modeling-app/download](https://zoo.dev/modeling-app/download)
|
||||
|
||||
A CAD application from the future, brought to you by the [Zoo team](https://zoo.dev).
|
||||
|
||||
Modeling App is our take on what a modern modelling experience can be. It is applying several lessons learned in the decades since most major CAD tools came into existence:
|
||||
Design Studio is our take on what a modern modelling experience can be. It is applying several lessons learned in the decades since most major CAD tools came into existence:
|
||||
|
||||
- All artifacts—including parts and assemblies—should be represented as human-readable code. At the end of the day, your CAD project should be "plain text"
|
||||
- This makes version control—which is a solved problem in software engineering—trivial for CAD
|
||||
- All GUI (or point-and-click) interactions should be actions performed on this code representation under the hood
|
||||
- This unlocks a hybrid approach to modeling. Whether you point-and-click as you always have or you write your own KCL code, you are performing the same action in Modeling App
|
||||
- This unlocks a hybrid approach to modeling. Whether you point-and-click as you always have or you write your own KCL code, you are performing the same action in Design Studio
|
||||
- Everything graphics _has_ to be built for the GPU
|
||||
- Most CAD applications have had to retrofit support for GPUs, but our geometry engine is made for GPUs (primarily Nvidia's Vulkan), getting the order of magnitude rendering performance boost with it
|
||||
- Make the resource-intensive pieces of an application auto-scaling
|
||||
@ -19,9 +19,9 @@ Modeling App is our take on what a modern modelling experience can be. It is app
|
||||
|
||||
We are excited about what a small team of people could build in a short time with our API. We welcome you to try our API, build your own applications, or contribute to ours!
|
||||
|
||||
Modeling App is a _hybrid_ user interface for CAD modeling. You can point-and-click to design parts (and soon assemblies), but everything you make is really just [`kcl` code](https://github.com/KittyCAD/kcl-experiments) under the hood. All of your CAD models can be checked into source control such as GitHub and responsibly versioned, rolled back, and more.
|
||||
Design Studio is a _hybrid_ user interface for CAD modeling. You can point-and-click to design parts (and soon assemblies), but everything you make is really just [`kcl` code](https://github.com/KittyCAD/kcl-experiments) under the hood. All of your CAD models can be checked into source control such as GitHub and responsibly versioned, rolled back, and more.
|
||||
|
||||
The 3D view in Modeling App is just a video stream from our hosted geometry engine. The app sends new modeling commands to the engine via WebSockets, which returns back video frames of the view within the engine.
|
||||
The 3D view in Design Studio is just a video stream from our hosted geometry engine. The app sends new modeling commands to the engine via WebSockets, which returns back video frames of the view within the engine.
|
||||
|
||||
## Tools
|
||||
|
||||
@ -198,13 +198,13 @@ If the prompt doesn't show up, start the app in command line to grab the electro
|
||||
|
||||
```
|
||||
# Windows (PowerShell)
|
||||
& 'C:\Program Files\Zoo Modeling App\Zoo Modeling App.exe'
|
||||
& 'C:\Program Files\Zoo Design Studio\Zoo Design Studio.exe'
|
||||
|
||||
# macOS
|
||||
/Applications/Zoo\ Modeling\ App.app/Contents/MacOS/Zoo\ Modeling\ App
|
||||
|
||||
# Linux
|
||||
./Zoo Modeling App-{version}-{arch}-linux.AppImage
|
||||
./Zoo Design Studio-{version}-{arch}-linux.AppImage
|
||||
```
|
||||
|
||||
#### 4. Publish the release
|
||||
|
@ -12,7 +12,7 @@ Import a CAD file.
|
||||
|
||||
For formats lacking unit data (such as STL, OBJ, or PLY files), the default unit of measurement is millimeters. Alternatively you may specify the unit by passing your desired measurement unit in the options parameter. When importing a GLTF file, the bin file will be imported as well. Import paths are relative to the current project directory.
|
||||
|
||||
Note: The import command currently only works when using the native Modeling App.
|
||||
Note: The import command currently only works when using the native Design Studio.
|
||||
|
||||
```js
|
||||
import(
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "KCL Standard Library"
|
||||
excerpt: "Documentation for the KCL standard library for the Zoo Modeling App."
|
||||
excerpt: "Documentation for the KCL standard library for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "KCL Known Issues"
|
||||
excerpt: "Known issues with the KCL standard library for the Zoo Modeling App."
|
||||
excerpt: "Known issues with the KCL standard library for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "KCL Modules"
|
||||
excerpt: "Documentation of modules for the KCL language for the Zoo Modeling App."
|
||||
excerpt: "Documentation of modules for the KCL language for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
@ -95,7 +95,7 @@ import "tests/inputs/cube.obj"
|
||||
When importing a GLTF file, the bin file will be imported as well.
|
||||
|
||||
Import paths are relative to the current project directory. Imports currently only work when
|
||||
using the native Modeling App, not in the browser.
|
||||
using the native Design Studio, not in the browser.
|
||||
|
||||
### Supported values
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
---
|
||||
title: "KCL Settings"
|
||||
excerpt: "Documentation of settings for the KCL language and Zoo Modeling App."
|
||||
excerpt: "Documentation of settings for the KCL language and Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
# KCL Settings
|
||||
|
||||
There are three levels of settings available in the KittyCAD modeling application:
|
||||
There are three levels of settings available in the KittyCAD Design Studiolication:
|
||||
|
||||
1. [User Settings](/docs/kcl/settings/user): Global settings that apply to all projects, stored in `user.toml`
|
||||
2. [Project Settings](/docs/kcl/settings/project): Settings specific to a project, stored in `project.toml`
|
||||
@ -14,7 +14,7 @@ There are three levels of settings available in the KittyCAD modeling applicatio
|
||||
|
||||
## Configuration Files
|
||||
|
||||
The KittyCAD modeling app uses TOML files for configuration:
|
||||
The KittyCAD Design Studio uses TOML files for configuration:
|
||||
|
||||
* **User Settings**: `user.toml` - See [complete documentation](/docs/kcl/settings/user)
|
||||
* **Project Settings**: `project.toml` - See [complete documentation](/docs/kcl/settings/project)
|
||||
|
@ -35,7 +35,7 @@ base_unit = "in"
|
||||
|
||||
#### app
|
||||
|
||||
The settings for the modeling app.
|
||||
The settings for the Design Studio.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
@ -37,7 +37,7 @@ text_wrapping = false
|
||||
|
||||
#### app
|
||||
|
||||
The settings for the modeling app.
|
||||
The settings for the Design Studio.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
@ -105991,7 +105991,7 @@
|
||||
{
|
||||
"name": "import",
|
||||
"summary": "Import a CAD file.",
|
||||
"description": "**DEPRECATED** Prefer to use import statements.\n\nFor formats lacking unit data (such as STL, OBJ, or PLY files), the default unit of measurement is millimeters. Alternatively you may specify the unit by passing your desired measurement unit in the options parameter. When importing a GLTF file, the bin file will be imported as well. Import paths are relative to the current project directory.\n\nNote: The import command currently only works when using the native Modeling App.",
|
||||
"description": "**DEPRECATED** Prefer to use import statements.\n\nFor formats lacking unit data (such as STL, OBJ, or PLY files), the default unit of measurement is millimeters. Alternatively you may specify the unit by passing your desired measurement unit in the options parameter. When importing a GLTF file, the bin file will be imported as well. Import paths are relative to the current project directory.\n\nNote: The import command currently only works when using the native Design Studio.",
|
||||
"tags": [],
|
||||
"keywordArguments": false,
|
||||
"args": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "KCL Types"
|
||||
excerpt: "Documentation of types for the KCL standard library for the Zoo Modeling App."
|
||||
excerpt: "Documentation of types for the KCL standard library for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
|
@ -32,57 +32,44 @@ test(
|
||||
})
|
||||
await page.setBodyDimensions({ width: 1200, height: 500 })
|
||||
|
||||
page.on('console', console.log)
|
||||
|
||||
await test.step('on open of project', async () => {
|
||||
await expect(page.getByText(`bracket`)).toBeVisible()
|
||||
// Open the project
|
||||
const projectName = page.getByText(`bracket`)
|
||||
await expect(projectName).toBeVisible()
|
||||
await projectName.click()
|
||||
await scene.waitForExecutionDone()
|
||||
await page.waitForTimeout(1_000) // wait for panel buttons to be available
|
||||
|
||||
// open the project
|
||||
await page.getByText(`bracket`).click()
|
||||
|
||||
// expect zero errors in guter
|
||||
// Expect zero errors in gutter
|
||||
await expect(page.locator('.cm-lint-marker-error')).not.toBeVisible()
|
||||
|
||||
// export the model
|
||||
// Click the export button
|
||||
const exportButton = page.getByTestId('export-pane-button')
|
||||
await expect(exportButton).toBeVisible()
|
||||
|
||||
// Wait for the model to finish loading
|
||||
const modelStateIndicator = page.getByTestId(
|
||||
'model-state-indicator-execution-done'
|
||||
)
|
||||
await expect(modelStateIndicator).toBeVisible({ timeout: 60000 })
|
||||
|
||||
const gltfOption = page.getByText('glTF')
|
||||
const submitButton = page.getByText('Confirm Export')
|
||||
const exportingToastMessage = page.getByText(`Exporting...`)
|
||||
const errorToastMessage = page.getByText(`Error while exporting`)
|
||||
const engineErrorToastMessage = page.getByText(`Nothing to export`)
|
||||
const alreadyExportingToastMessage = page.getByText(`Already exporting`)
|
||||
// The open file's name is `main.kcl`, so the export file name should be `main.gltf`
|
||||
const exportFileName = `main.gltf`
|
||||
|
||||
// Click the export button
|
||||
await exportButton.click()
|
||||
await page.waitForTimeout(1_000) // wait for export options to be available
|
||||
|
||||
// Select the first format option
|
||||
const gltfOption = page.getByText('glTF')
|
||||
const exportFileName = `main.gltf` // source file is named `main.kcl`
|
||||
await expect(gltfOption).toBeVisible()
|
||||
await expect(page.getByText('STL')).toBeVisible()
|
||||
|
||||
await page.keyboard.press('Enter')
|
||||
|
||||
// Click the checkbox
|
||||
const submitButton = page.getByText('Confirm Export')
|
||||
await expect(submitButton).toBeVisible()
|
||||
|
||||
await page.waitForTimeout(500)
|
||||
|
||||
await page.keyboard.press('Enter')
|
||||
|
||||
// Find the toast.
|
||||
// Look out for the toast message
|
||||
const exportingToastMessage = page.getByText(`Exporting...`)
|
||||
const alreadyExportingToastMessage = page.getByText(`Already exporting`)
|
||||
await expect(exportingToastMessage).toBeVisible()
|
||||
await expect(alreadyExportingToastMessage).not.toBeVisible()
|
||||
|
||||
// Expect it to succeed.
|
||||
// Expect it to succeed
|
||||
const errorToastMessage = page.getByText(`Error while exporting`)
|
||||
const engineErrorToastMessage = page.getByText(`Nothing to export`)
|
||||
await expect(errorToastMessage).not.toBeVisible()
|
||||
await expect(engineErrorToastMessage).not.toBeVisible()
|
||||
|
||||
@ -90,6 +77,7 @@ test(
|
||||
await expect(successToastMessage).toBeVisible()
|
||||
await expect(exportingToastMessage).not.toBeVisible()
|
||||
|
||||
// Check for the exported file
|
||||
const firstFileFullPath = path.resolve(
|
||||
getPlaywrightDownloadDir(tronApp.projectDirName),
|
||||
exportFileName
|
||||
@ -116,60 +104,53 @@ test(
|
||||
const u = await getUtils(page)
|
||||
await u.openFilePanel()
|
||||
|
||||
// Click on the other file
|
||||
const otherKclButton = page.getByRole('button', { name: 'other.kcl' })
|
||||
|
||||
// Click the file
|
||||
await otherKclButton.click()
|
||||
|
||||
// Close the file pane
|
||||
await u.closeFilePanel()
|
||||
await scene.waitForExecutionDone()
|
||||
await page.waitForTimeout(1_000) // wait for panel buttons to be available
|
||||
|
||||
// FIXME: await scene.waitForExecutionDone() does not work. The modeling indicator stays in -receive-reliable and not execution done
|
||||
await page.waitForTimeout(10000)
|
||||
|
||||
// expect zero errors in guter
|
||||
// Expect zero errors in gutter
|
||||
await expect(page.locator('.cm-lint-marker-error')).not.toBeVisible()
|
||||
|
||||
// export the model
|
||||
// Click the export button
|
||||
const exportButton = page.getByTestId('export-pane-button')
|
||||
await expect(exportButton).toBeVisible()
|
||||
|
||||
const gltfOption = page.getByText('glTF')
|
||||
const submitButton = page.getByText('Confirm Export')
|
||||
const exportingToastMessage = page.getByText(`Exporting...`)
|
||||
const errorToastMessage = page.getByText(`Error while exporting`)
|
||||
const engineErrorToastMessage = page.getByText(`Nothing to export`)
|
||||
const alreadyExportingToastMessage = page.getByText(`Already exporting`)
|
||||
// The open file's name is `other.kcl`, so the export file name should be `other.gltf`
|
||||
const exportFileName = `other.gltf`
|
||||
|
||||
// Click the export button
|
||||
await exportButton.click()
|
||||
await page.waitForTimeout(1_000) // wait for export options to be available
|
||||
|
||||
// Select the first format option
|
||||
const gltfOption = page.getByText('glTF')
|
||||
const exportFileName = `other.gltf` // source file is named `other.kcl`
|
||||
await expect(gltfOption).toBeVisible()
|
||||
await expect(page.getByText('STL')).toBeVisible()
|
||||
|
||||
await page.keyboard.press('Enter')
|
||||
|
||||
// Click the checkbox
|
||||
const submitButton = page.getByText('Confirm Export')
|
||||
await expect(submitButton).toBeVisible()
|
||||
|
||||
await page.waitForTimeout(500)
|
||||
await page.keyboard.press('Enter')
|
||||
|
||||
// Find the toast.
|
||||
// Look out for the toast message
|
||||
const exportingToastMessage = page.getByText(`Exporting...`)
|
||||
const alreadyExportingToastMessage = page.getByText(`Already exporting`)
|
||||
await expect(exportingToastMessage).toBeVisible()
|
||||
await expect(alreadyExportingToastMessage).not.toBeVisible()
|
||||
|
||||
// Expect it to succeed
|
||||
const errorToastMessage = page.getByText(`Error while exporting`)
|
||||
const engineErrorToastMessage = page.getByText(`Nothing to export`)
|
||||
await expect(errorToastMessage).not.toBeVisible()
|
||||
await expect(engineErrorToastMessage).not.toBeVisible()
|
||||
|
||||
const successToastMessage = page.getByText(`Exported successfully`)
|
||||
await test.step('Check the success toast message shows and nothing else', async () =>
|
||||
Promise.all([
|
||||
expect(alreadyExportingToastMessage).not.toBeVisible(),
|
||||
expect(errorToastMessage).not.toBeVisible(),
|
||||
expect(engineErrorToastMessage).not.toBeVisible(),
|
||||
expect(successToastMessage).toBeVisible(),
|
||||
expect(exportingToastMessage).not.toBeVisible(),
|
||||
]))
|
||||
await expect(successToastMessage).toBeVisible()
|
||||
await expect(exportingToastMessage).not.toBeVisible()
|
||||
|
||||
// Check for the exported file=
|
||||
const secondFileFullPath = path.resolve(
|
||||
getPlaywrightDownloadDir(tronApp.projectDirName),
|
||||
exportFileName
|
||||
|
@ -1274,4 +1274,79 @@ sketch001 = startSketchOn(XZ)
|
||||
await middleMousePan(800, 200, 900, 300)
|
||||
})
|
||||
})
|
||||
|
||||
test('Can select lines on the main axis', async ({
|
||||
page,
|
||||
homePage,
|
||||
toolbar,
|
||||
}) => {
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn(XZ)
|
||||
profile001 = startProfileAt([100.00, 100.0], sketch001)
|
||||
|> yLine(length = -100.0)
|
||||
|> xLine(length = 200.0)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()`
|
||||
)
|
||||
})
|
||||
|
||||
const width = 1200
|
||||
const height = 800
|
||||
const viewportSize = { width, height }
|
||||
await page.setBodyDimensions(viewportSize)
|
||||
|
||||
await homePage.goToModelingScene()
|
||||
|
||||
const u = await getUtils(page)
|
||||
await u.waitForPageLoad()
|
||||
|
||||
await toolbar.editSketch(0)
|
||||
|
||||
await page.waitForTimeout(1000)
|
||||
|
||||
// Click on the bottom segment that lies on the x axis
|
||||
await page.mouse.click(width * 0.85, height / 2)
|
||||
|
||||
await page.waitForTimeout(1000)
|
||||
|
||||
// Verify segment is selected (you can check for visual indicators or state)
|
||||
const element = page.locator('[data-overlay-index="1"]')
|
||||
await expect(element).toHaveAttribute('data-overlay-visible', 'true')
|
||||
})
|
||||
|
||||
test(`Only show axis planes when there are no errors`, async ({
|
||||
page,
|
||||
homePage,
|
||||
scene,
|
||||
cmdBar,
|
||||
}) => {
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn(XZ)
|
||||
profile001 = circle(sketch001, center = [-100.0, -100.0], radius = 50.0)
|
||||
|
||||
sketch002 = startSketchOn(XZ)
|
||||
profile002 = circle(sketch002, center = [-100.0, 100.0], radius = 50.0)
|
||||
extrude001 = extrude(profile002, length = 0)` // length = 0 is causing the error
|
||||
)
|
||||
})
|
||||
|
||||
const viewportSize = { width: 1200, height: 800 }
|
||||
await page.setBodyDimensions(viewportSize)
|
||||
|
||||
await homePage.goToModelingScene()
|
||||
|
||||
await scene.connectionEstablished()
|
||||
await scene.settled(cmdBar)
|
||||
|
||||
await scene.expectPixelColor(
|
||||
TEST_COLORS.DARK_MODE_BKGD,
|
||||
// This is a position where the blue part of the axis plane is visible if its rendered
|
||||
{ x: viewportSize.width * 0.75, y: viewportSize.height * 0.2 },
|
||||
15
|
||||
)
|
||||
})
|
||||
})
|
||||
|
@ -177,6 +177,25 @@ export class ElectronZoo {
|
||||
|
||||
this.context = this.electron.context()
|
||||
await this.context.tracing.start({ screenshots: true, snapshots: true })
|
||||
|
||||
// We need to patch this because addInitScript will bind too late in our
|
||||
// electron tests, never running. We need to call reload() after each call
|
||||
// to guarantee it runs.
|
||||
const oldContextAddInitScript = this.context.addInitScript
|
||||
this.context.addInitScript = async function (a, b) {
|
||||
// @ts-ignore pretty sure way out of tsc's type checking capabilities.
|
||||
// This code works perfectly fine.
|
||||
await oldContextAddInitScript.apply(this, [a, b])
|
||||
await that.page.reload()
|
||||
}
|
||||
|
||||
const oldPageAddInitScript = this.page.addInitScript
|
||||
this.page.addInitScript = async function (a: any, b: any) {
|
||||
// @ts-ignore pretty sure way out of tsc's type checking capabilities.
|
||||
// This code works perfectly fine.
|
||||
await oldPageAddInitScript.apply(this, [a, b])
|
||||
await that.page.reload()
|
||||
}
|
||||
}
|
||||
|
||||
await this.context.tracing.startChunk()
|
||||
@ -219,26 +238,6 @@ export class ElectronZoo {
|
||||
}))
|
||||
}
|
||||
|
||||
// We need to patch this because addInitScript will bind too late in our
|
||||
// electron tests, never running. We need to call reload() after each call
|
||||
// to guarantee it runs.
|
||||
const oldContextAddInitScript = this.context.addInitScript
|
||||
this.context.addInitScript = async function (a, b) {
|
||||
// @ts-ignore pretty sure way out of tsc's type checking capabilities.
|
||||
// This code works perfectly fine.
|
||||
await oldContextAddInitScript.apply(this, [a, b])
|
||||
await that.page.reload()
|
||||
}
|
||||
|
||||
// No idea why we mix and match page and context's addInitScript but we do
|
||||
const oldPageAddInitScript = this.page.addInitScript
|
||||
this.page.addInitScript = async function (a: any, b: any) {
|
||||
// @ts-ignore pretty sure way out of tsc's type checking capabilities.
|
||||
// This code works perfectly fine.
|
||||
await oldPageAddInitScript.apply(this, [a, b])
|
||||
await that.page.reload()
|
||||
}
|
||||
|
||||
if (!this.firstUrl) {
|
||||
await this.page.getByText('Your Projects').count()
|
||||
this.firstUrl = this.page.url()
|
||||
|
@ -96,7 +96,7 @@ export class HomePageFixture {
|
||||
await expect(this.projectSection).not.toHaveText('Loading your Projects...')
|
||||
}
|
||||
|
||||
createAndGoToProject = async (projectTitle = 'project-$nnn') => {
|
||||
createAndGoToProject = async (projectTitle = 'untitled') => {
|
||||
await this.projectsLoaded()
|
||||
await this.projectButtonNew.click()
|
||||
await this.projectTextName.click()
|
||||
|
120
e2e/playwright/import-ui.spec.ts
Normal file
@ -0,0 +1,120 @@
|
||||
import { expect, test } from '@e2e/playwright/zoo-test'
|
||||
import * as fsp from 'fs/promises'
|
||||
import path from 'path'
|
||||
|
||||
test.describe('Import UI tests', () => {
|
||||
test('shows toast when trying to sketch on imported face', async ({
|
||||
context,
|
||||
page,
|
||||
homePage,
|
||||
toolbar,
|
||||
scene,
|
||||
editor,
|
||||
}) => {
|
||||
await context.folderSetupFn(async (dir) => {
|
||||
const projectDir = path.join(dir, 'import-test')
|
||||
await fsp.mkdir(projectDir, { recursive: true })
|
||||
|
||||
// Create the imported file
|
||||
await fsp.writeFile(
|
||||
path.join(projectDir, 'toBeImported.kcl'),
|
||||
`sketch001 = startSketchOn(XZ)
|
||||
profile001 = startProfileAt([281.54, 305.81], sketch001)
|
||||
|> angledLine([0, 123.43], %, $rectangleSegmentA001)
|
||||
|> angledLine([
|
||||
segAng(rectangleSegmentA001) - 90,
|
||||
85.99
|
||||
], %)
|
||||
|> angledLine([
|
||||
segAng(rectangleSegmentA001),
|
||||
-segLen(rectangleSegmentA001)
|
||||
], %)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
extrude(profile001, length = 100)`
|
||||
)
|
||||
|
||||
// Create the main file that imports
|
||||
await fsp.writeFile(
|
||||
path.join(projectDir, 'main.kcl'),
|
||||
`import "toBeImported.kcl" as importedCube
|
||||
|
||||
importedCube
|
||||
|
||||
sketch001 = startSketchOn(XZ)
|
||||
profile001 = startProfileAt([-134.53, -56.17], sketch001)
|
||||
|> angledLine([0, 79.05], %, $rectangleSegmentA001)
|
||||
|> angledLine([
|
||||
segAng(rectangleSegmentA001) - 90,
|
||||
76.28
|
||||
], %)
|
||||
|> angledLine([
|
||||
segAng(rectangleSegmentA001),
|
||||
-segLen(rectangleSegmentA001)
|
||||
], %, $seg01)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|
||||
|> close()
|
||||
extrude001 = extrude(profile001, length = 100)
|
||||
sketch003 = startSketchOn(extrude001, seg02)
|
||||
sketch002 = startSketchOn(extrude001, seg01)`
|
||||
)
|
||||
})
|
||||
|
||||
await homePage.openProject('import-test')
|
||||
await scene.waitForExecutionDone()
|
||||
|
||||
await scene.moveCameraTo(
|
||||
{
|
||||
x: -114,
|
||||
y: -897,
|
||||
z: 475,
|
||||
},
|
||||
{
|
||||
x: -114,
|
||||
y: -51,
|
||||
z: 83,
|
||||
}
|
||||
)
|
||||
const [_, hoverOverNonImport] = scene.makeMouseHelpers(611, 364)
|
||||
const [importedFaceClick, hoverOverImported] = scene.makeMouseHelpers(
|
||||
940,
|
||||
150
|
||||
)
|
||||
|
||||
await test.step('check code highlight works for code define in the file being edited', async () => {
|
||||
await hoverOverNonImport()
|
||||
await editor.expectState({
|
||||
highlightedCode: 'startProfileAt([-134.53,-56.17],sketch001)',
|
||||
diagnostics: [],
|
||||
activeLines: ['import"toBeImported.kcl"asimportedCube'],
|
||||
})
|
||||
})
|
||||
|
||||
await test.step('check code does nothing when geometry is defined in an import', async () => {
|
||||
await hoverOverImported()
|
||||
await editor.expectState({
|
||||
highlightedCode: '',
|
||||
diagnostics: [],
|
||||
activeLines: ['import"toBeImported.kcl"asimportedCube'],
|
||||
})
|
||||
})
|
||||
|
||||
await test.step('check the user is warned when sketching on a imported face', async () => {
|
||||
// Start sketch mode
|
||||
await toolbar.startSketchPlaneSelection()
|
||||
|
||||
// Click on a face from the imported model
|
||||
// await new Promise(() => {})
|
||||
await importedFaceClick()
|
||||
|
||||
// Verify toast appears with correct content
|
||||
await expect(page.getByText('This face is from an import')).toBeVisible()
|
||||
await expect(
|
||||
page.locator('.font-mono').getByText('toBeImported.kcl')
|
||||
).toBeVisible()
|
||||
await expect(
|
||||
page.getByText('Please select this from the files pane to edit')
|
||||
).toBeVisible()
|
||||
})
|
||||
})
|
||||
})
|
7
e2e/playwright/lib/electron-helpers.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export const throwError = (message: string): never => {
|
||||
throw new Error(message)
|
||||
}
|
||||
|
||||
export const throwTronAppMissing = () => {
|
||||
throwError('tronApp is missing')
|
||||
}
|
@ -42,10 +42,10 @@ test.describe('Onboarding tests', () => {
|
||||
await homePage.goToModelingScene()
|
||||
|
||||
// Test that the onboarding pane loaded
|
||||
await expect(page.getByText('Welcome to Modeling App! This')).toBeVisible()
|
||||
await expect(page.getByText('Welcome to Design Studio! This')).toBeVisible()
|
||||
|
||||
// Test that the onboarding pane loaded
|
||||
await expect(page.getByText('Welcome to Modeling App! This')).toBeVisible()
|
||||
await expect(page.getByText('Welcome to Design Studio! This')).toBeVisible()
|
||||
|
||||
// *and* that the code is shown in the editor
|
||||
await expect(page.locator('.cm-content')).toContainText('// Shelf Bracket')
|
||||
@ -86,7 +86,7 @@ test.describe('Onboarding tests', () => {
|
||||
await test.step(`Ensure we see the onboarding stuff`, async () => {
|
||||
// Test that the onboarding pane loaded
|
||||
await expect(
|
||||
page.getByText('Welcome to Modeling App! This')
|
||||
page.getByText('Welcome to Design Studio! This')
|
||||
).toBeVisible()
|
||||
|
||||
// *and* that the code is shown in the editor
|
||||
@ -147,7 +147,7 @@ test.describe('Onboarding tests', () => {
|
||||
await nextButton.click()
|
||||
|
||||
// Ensure we see the introduction and that the code has been reset
|
||||
await expect(page.getByText('Welcome to Modeling App!')).toBeVisible()
|
||||
await expect(page.getByText('Welcome to Design Studio!')).toBeVisible()
|
||||
await expect(page.locator('.cm-content')).toContainText('// Shelf Bracket')
|
||||
|
||||
// There used to be old code here that checked if we stored the reset
|
||||
@ -188,7 +188,7 @@ test.describe('Onboarding tests', () => {
|
||||
await homePage.goToModelingScene()
|
||||
|
||||
// Test that the onboarding pane loaded
|
||||
await expect(page.getByText('Welcome to Modeling App! This')).toBeVisible()
|
||||
await expect(page.getByText('Welcome to Design Studio! This')).toBeVisible()
|
||||
|
||||
const nextButton = page.getByTestId('onboarding-next')
|
||||
const prevButton = page.getByTestId('onboarding-prev')
|
||||
@ -494,7 +494,7 @@ test('Restarting onboarding on desktop takes one attempt', async ({
|
||||
const tutorialProjectIndicator = page
|
||||
.getByTestId('project-sidebar-toggle')
|
||||
.filter({ hasText: 'Tutorial Project 00' })
|
||||
const tutorialModalText = page.getByText('Welcome to Modeling App!')
|
||||
const tutorialModalText = page.getByText('Welcome to Design Studio!')
|
||||
const tutorialDismissButton = page.getByRole('button', { name: 'Dismiss' })
|
||||
const userMenuButton = page.getByTestId('user-sidebar-toggle')
|
||||
const userMenuSettingsButton = page.getByRole('button', {
|
||||
|
@ -828,7 +828,7 @@ test.describe(`Project management commands`, () => {
|
||||
const commandButton = page.getByRole('button', { name: 'Commands' })
|
||||
const commandOption = page.getByRole('option', { name: 'rename project' })
|
||||
const projectNameOption = page.getByRole('option', { name: projectName })
|
||||
const projectRenamedName = `project-000`
|
||||
const projectRenamedName = `untitled`
|
||||
// const projectMenuButton = page.getByTestId('project-sidebar-toggle')
|
||||
const commandContinueButton = page.getByRole('button', {
|
||||
name: 'Continue',
|
||||
@ -941,7 +941,7 @@ test.describe(`Project management commands`, () => {
|
||||
const commandButton = page.getByRole('button', { name: 'Commands' })
|
||||
const commandOption = page.getByRole('option', { name: 'rename project' })
|
||||
const projectNameOption = page.getByRole('option', { name: projectName })
|
||||
const projectRenamedName = `project-000`
|
||||
const projectRenamedName = `untitled`
|
||||
const commandContinueButton = page.getByRole('button', {
|
||||
name: 'Continue',
|
||||
})
|
||||
@ -1139,7 +1139,7 @@ test(`Create a few projects using the default project name`, async ({
|
||||
await test.step(`Create project ${i}`, async () => {
|
||||
await homePage.expectState({
|
||||
projectCards: Array.from({ length: i }, (_, i) => ({
|
||||
title: `project-${i.toString().padStart(3, '0')}`,
|
||||
title: i === 0 ? 'untitled' : `untitled-${i}`,
|
||||
fileCount: 1,
|
||||
})).toReversed(),
|
||||
sortBy: 'last-modified-desc',
|
||||
@ -1323,9 +1323,9 @@ test(
|
||||
})
|
||||
|
||||
await test.step('Check we can still create a project', async () => {
|
||||
await createProject({ name: 'project-000', page, returnHome: true })
|
||||
await createProject({ name: 'new-project', page, returnHome: true })
|
||||
await expect(
|
||||
page.getByTestId('project-link').filter({ hasText: 'project-000' })
|
||||
page.getByTestId('project-link').filter({ hasText: 'new-project' })
|
||||
).toBeVisible()
|
||||
})
|
||||
}
|
||||
|
@ -351,7 +351,7 @@ const extrudeDefaultPlane = async (
|
||||
},
|
||||
},
|
||||
project: {
|
||||
default_project_name: 'project-$nnn',
|
||||
default_project_name: 'untitled',
|
||||
},
|
||||
text_editor: {
|
||||
text_wrapping: true,
|
||||
|
@ -23,7 +23,7 @@ export const TEST_SETTINGS: DeepPartial<Settings> = {
|
||||
camera_projection: 'perspective',
|
||||
},
|
||||
project: {
|
||||
default_project_name: 'project-$nnn',
|
||||
default_project_name: 'untitled',
|
||||
directory: '',
|
||||
},
|
||||
text_editor: {
|
||||
@ -80,7 +80,8 @@ export const TEST_SETTINGS_CORRUPTED = {
|
||||
},
|
||||
} satisfies Partial<SaveSettingsPayload>
|
||||
|
||||
export const TEST_CODE_GIZMO = `part001 = startSketchOn(XZ)
|
||||
export const TEST_CODE_GIZMO = `@settings(defaultLengthUnit = in)
|
||||
part001 = startSketchOn(XZ)
|
||||
|> startProfileAt([20, 0], %)
|
||||
|> line(end = [7.13, 4 + 0])
|
||||
|> angledLine({ angle: 3 + 0, length: 3.14 + 0 }, %)
|
||||
|
@ -8,37 +8,37 @@ test.describe('Testing Gizmo', { tag: ['@skipWin'] }, () => {
|
||||
const cases = [
|
||||
{
|
||||
testDescription: 'top view',
|
||||
clickPosition: { x: 951, y: 347 },
|
||||
clickPosition: { x: 951, y: 385 },
|
||||
expectedCameraPosition: { x: 800, y: -152, z: 4886.02 },
|
||||
expectedCameraTarget: { x: 800, y: -152, z: 26 },
|
||||
},
|
||||
{
|
||||
testDescription: 'bottom view',
|
||||
clickPosition: { x: 951, y: 391 },
|
||||
clickPosition: { x: 951, y: 429 },
|
||||
expectedCameraPosition: { x: 800, y: -152, z: -4834.02 },
|
||||
expectedCameraTarget: { x: 800, y: -152, z: 26 },
|
||||
},
|
||||
{
|
||||
testDescription: 'right view',
|
||||
clickPosition: { x: 929, y: 379 },
|
||||
clickPosition: { x: 929, y: 417 },
|
||||
expectedCameraPosition: { x: 5660.02, y: -152, z: 26 },
|
||||
expectedCameraTarget: { x: 800, y: -152, z: 26 },
|
||||
},
|
||||
{
|
||||
testDescription: 'left view',
|
||||
clickPosition: { x: 974, y: 359 },
|
||||
clickPosition: { x: 974, y: 397 },
|
||||
expectedCameraPosition: { x: -4060.02, y: -152, z: 26 },
|
||||
expectedCameraTarget: { x: 800, y: -152, z: 26 },
|
||||
},
|
||||
{
|
||||
testDescription: 'back view',
|
||||
clickPosition: { x: 967, y: 383 },
|
||||
clickPosition: { x: 967, y: 421 },
|
||||
expectedCameraPosition: { x: 800, y: 4708.02, z: 26 },
|
||||
expectedCameraTarget: { x: 800, y: -152, z: 26 },
|
||||
},
|
||||
{
|
||||
testDescription: 'front view',
|
||||
clickPosition: { x: 935, y: 355 },
|
||||
clickPosition: { x: 935, y: 393 },
|
||||
expectedCameraPosition: { x: 800, y: -5012.02, z: 26 },
|
||||
expectedCameraTarget: { x: 800, y: -152, z: 26 },
|
||||
},
|
||||
|
@ -2,7 +2,11 @@ import { getUtils, orRunWhenFullSuiteEnabled } from '@e2e/playwright/test-utils'
|
||||
import { expect, test } from '@e2e/playwright/zoo-test'
|
||||
|
||||
test.describe('Test toggling perspective', () => {
|
||||
test('via command palette and toggle', async ({ page, homePage }) => {
|
||||
test('via command palette and toggle', async ({
|
||||
page,
|
||||
homePage,
|
||||
toolbar,
|
||||
}) => {
|
||||
test.fixme(orRunWhenFullSuiteEnabled())
|
||||
const u = await getUtils(page)
|
||||
|
||||
@ -14,7 +18,7 @@ test.describe('Test toggling perspective', () => {
|
||||
y: screenHeight * 0.2,
|
||||
}
|
||||
const backgroundColor: [number, number, number] = [29, 29, 29]
|
||||
const xzPlaneColor: [number, number, number] = [82, 55, 96]
|
||||
const xzPlaneColor: [number, number, number] = [72, 55, 96]
|
||||
const locationToHaveColor = async (color: [number, number, number]) => {
|
||||
return u.getGreatestPixDiff(checkedScreenLocation, color)
|
||||
}
|
||||
@ -26,9 +30,29 @@ test.describe('Test toggling perspective', () => {
|
||||
const commandToast = page.getByText(
|
||||
`Set camera projection to "orthographic"`
|
||||
)
|
||||
const projectionToggle = page.getByRole('switch', {
|
||||
name: 'Camera projection: ',
|
||||
})
|
||||
|
||||
const checkSettingValue = async () => {
|
||||
const settingsButton = page.getByRole('link', {
|
||||
name: 'Settings',
|
||||
exact: false,
|
||||
})
|
||||
|
||||
let settingValue: string | null = null
|
||||
|
||||
await test.step(`Check the setting value`, async () => {
|
||||
await settingsButton.click()
|
||||
const userTab = page.getByRole('radio', { name: 'User' })
|
||||
await userTab.click()
|
||||
await expect(userTab).toBeChecked()
|
||||
const setting = page.locator('#cameraProjection').first()
|
||||
await expect(setting).toBeAttached()
|
||||
await setting.scrollIntoViewIfNeeded()
|
||||
settingValue = await setting.getByRole('combobox').inputValue()
|
||||
await page.getByTestId('settings-close-button').click()
|
||||
})
|
||||
|
||||
return settingValue
|
||||
}
|
||||
|
||||
await test.step('Setup', async () => {
|
||||
await page.setBodyDimensions({ width: screenWidth, height: screenHeight })
|
||||
@ -39,8 +63,8 @@ test.describe('Test toggling perspective', () => {
|
||||
timeout: 5000,
|
||||
message: 'This spot should have the background color',
|
||||
})
|
||||
.toBeLessThan(15)
|
||||
await expect(projectionToggle).toHaveAttribute('aria-checked', 'true')
|
||||
.toBeLessThan(30)
|
||||
expect(await checkSettingValue()).toBe('perspective')
|
||||
})
|
||||
|
||||
// Extremely wild note: flicking between ortho and persp actually changes
|
||||
@ -59,33 +83,22 @@ test.describe('Test toggling perspective', () => {
|
||||
timeout: 5000,
|
||||
message: 'This spot should have the XZ plane color',
|
||||
})
|
||||
.toBeLessThan(15)
|
||||
await expect(projectionToggle).toHaveAttribute('aria-checked', 'false')
|
||||
.toBeLessThan(30)
|
||||
expect(await checkSettingValue()).toBe('orthographic')
|
||||
})
|
||||
|
||||
await test.step(`Refresh the page and ensure the stream is loaded in ortho`, async () => {
|
||||
await page.reload()
|
||||
await page.waitForTimeout(1000)
|
||||
await expect(toolbar.startSketchBtn).toBeEnabled({ timeout: 15_000 })
|
||||
await u.closeKclCodePanel()
|
||||
await expect
|
||||
.poll(async () => locationToHaveColor(xzPlaneColor), {
|
||||
timeout: 5000,
|
||||
message: 'This spot should have the XZ plane color',
|
||||
})
|
||||
.toBeLessThan(15)
|
||||
.toBeLessThan(30)
|
||||
await expect(commandToast).not.toBeVisible()
|
||||
await expect(projectionToggle).toHaveAttribute('aria-checked', 'false')
|
||||
})
|
||||
|
||||
await test.step(`Switch to perspective via toggle`, async () => {
|
||||
await projectionToggle.click()
|
||||
await expect(projectionToggle).toHaveAttribute('aria-checked', 'true')
|
||||
await expect
|
||||
.poll(async () => locationToHaveColor(backgroundColor), {
|
||||
timeout: 5000,
|
||||
message: 'This spot should have the background color',
|
||||
})
|
||||
.toBeLessThan(15)
|
||||
expect(await checkSettingValue()).toBe('orthographic')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -8,8 +8,8 @@ import { expect, test } from '@e2e/playwright/zoo-test'
|
||||
|
||||
test.describe('Testing in-app sample loading', () => {
|
||||
/**
|
||||
* Note this test implicitly depends on the KCL sample "a-parametric-bearing-pillow-block",
|
||||
* its title, and its units settings. https://github.com/KittyCAD/kcl-samples/blob/main/a-parametric-bearing-pillow-block/main.kcl
|
||||
* Note this test implicitly depends on the KCL sample "parametric-bearing-pillow-block",
|
||||
* its title, and its units settings. https://github.com/KittyCAD/kcl-samples/blob/main/parametric-bearing-pillow-block/main.kcl
|
||||
*/
|
||||
test('Web: should overwrite current code, cannot create new file', async ({
|
||||
editor,
|
||||
@ -29,8 +29,8 @@ test.describe('Testing in-app sample loading', () => {
|
||||
|
||||
// Locators and constants
|
||||
const newSample = {
|
||||
file: 'a-parametric-bearing-pillow-block' + FILE_EXT,
|
||||
title: 'A Parametric Bearing Pillow Block',
|
||||
file: 'parametric-bearing-pillow-block' + FILE_EXT,
|
||||
title: 'Parametric Bearing Pillow Block',
|
||||
}
|
||||
const commandBarButton = page.getByRole('button', { name: 'Commands' })
|
||||
const samplesCommandOption = page.getByRole('option', {
|
||||
@ -72,7 +72,7 @@ test.describe('Testing in-app sample loading', () => {
|
||||
|
||||
/**
|
||||
* Note this test implicitly depends on the KCL samples:
|
||||
* "a-parametric-bearing-pillow-block": https://github.com/KittyCAD/kcl-samples/blob/main/a-parametric-bearing-pillow-block/main.kcl
|
||||
* "parametric-bearing-pillow-block": https://github.com/KittyCAD/kcl-samples/blob/main/parametric-bearing-pillow-block/main.kcl
|
||||
* "gear-rack": https://github.com/KittyCAD/kcl-samples/blob/main/gear-rack/main.kcl
|
||||
*/
|
||||
test(
|
||||
@ -90,8 +90,8 @@ test.describe('Testing in-app sample loading', () => {
|
||||
|
||||
// Locators and constants
|
||||
const sampleOne = {
|
||||
file: 'a-parametric-bearing-pillow-block' + FILE_EXT,
|
||||
title: 'A Parametric Bearing Pillow Block',
|
||||
file: 'parametric-bearing-pillow-block' + FILE_EXT,
|
||||
title: 'Parametric Bearing Pillow Block',
|
||||
}
|
||||
const sampleTwo = {
|
||||
file: 'gear-rack' + FILE_EXT,
|
||||
|
@ -57,7 +57,7 @@ test.describe('Testing settings', () => {
|
||||
expect(storedSettings.settings?.modeling?.mouse_controls).toBe('zoo')
|
||||
expect(storedSettings.settings?.project?.directory).toBe('')
|
||||
expect(storedSettings.settings?.project?.default_project_name).toBe(
|
||||
'project-$nnn'
|
||||
'untitled'
|
||||
)
|
||||
})
|
||||
|
||||
|
@ -4,6 +4,7 @@ directories:
|
||||
buildResources: assets
|
||||
files:
|
||||
- .vite/**
|
||||
- "!node_modules/win-ca/pem/**"
|
||||
mac:
|
||||
category: public.app-category.developer-tools
|
||||
artifactName: "${productName}-${version}-${arch}-${os}.${ext}"
|
||||
|
@ -22,7 +22,7 @@
|
||||
data-domain="app.zoo.dev"
|
||||
src="https://plausible.corp.zoo.dev/js/script.tagged-events.js"
|
||||
></script>
|
||||
<title>Zoo Modeling App</title>
|
||||
<title>Zoo Design Studio</title>
|
||||
</head>
|
||||
<body class="body-bg">
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
|
@ -2,13 +2,13 @@
|
||||
"name": "zoo-modeling-app",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"productName": "Zoo Modeling App",
|
||||
"productName": "Zoo Design Studio",
|
||||
"author": {
|
||||
"name": "Zoo Corporation",
|
||||
"email": "info@zoo.dev",
|
||||
"url": "https://zoo.dev"
|
||||
},
|
||||
"description": "Zoo Modeling App",
|
||||
"description": "Zoo Design Studio",
|
||||
"main": ".vite/build/main.js",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@ -26,7 +26,7 @@
|
||||
"@fortawesome/react-fontawesome": "^0.2.0",
|
||||
"@headlessui/react": "^1.7.19",
|
||||
"@headlessui/tailwindcss": "^0.2.2",
|
||||
"@kittycad/lib": "2.0.25",
|
||||
"@kittycad/lib": "2.0.26",
|
||||
"@lezer/highlight": "^1.2.1",
|
||||
"@lezer/lr": "^1.4.1",
|
||||
"@react-hook/resize-observer": "^2.0.1",
|
||||
@ -66,6 +66,7 @@
|
||||
"vscode-languageserver-protocol": "^3.17.5",
|
||||
"vscode-uri": "^3.1.0",
|
||||
"web-vitals": "^3.5.2",
|
||||
"win-ca": "^3.5.1",
|
||||
"xstate": "^5.19.2",
|
||||
"yargs": "^17.7.2"
|
||||
},
|
||||
@ -233,7 +234,7 @@
|
||||
"ts-node": "^10.0.0",
|
||||
"typescript": "^5.8.2",
|
||||
"typescript-eslint": "^8.26.1",
|
||||
"vite": "^5.4.16",
|
||||
"vite": "^5.4.17",
|
||||
"vite-plugin-package-version": "^1.1.0",
|
||||
"vite-plugin-top-level-await": "^1.5.0",
|
||||
"vite-tsconfig-paths": "^4.3.2",
|
||||
|
@ -683,9 +683,9 @@ vite-tsconfig-paths@^4.3.2:
|
||||
tsconfck "^3.0.3"
|
||||
|
||||
vite@^5.0.0:
|
||||
version "5.4.16"
|
||||
resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.16.tgz#471983257a890ef33f2700cbbbc2134f2d08abf1"
|
||||
integrity sha512-Y5gnfp4NemVfgOTDQAunSD4346fal44L9mszGGY/e+qxsRT5y1sMlS/8tiQ8AFAp+MFgYNSINdfEchJiPm41vQ==
|
||||
version "5.4.17"
|
||||
resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.17.tgz#4bf61dd4cdbf64b0d6661f5dba76954cc81d5082"
|
||||
integrity sha512-5+VqZryDj4wgCs55o9Lp+p8GE78TLVg0lasCH5xFZ4jacZjtqZa6JUw9/p0WeAojaOfncSM6v77InkFPGnvPvg==
|
||||
dependencies:
|
||||
esbuild "^0.21.3"
|
||||
postcss "^8.4.43"
|
||||
|
@ -1,10 +1,29 @@
|
||||
import { defineConfig, devices } from '@playwright/test'
|
||||
import os from 'os'
|
||||
|
||||
/**
|
||||
* Read environment variables from file.
|
||||
* https://github.com/motdotla/dotenv
|
||||
*/
|
||||
// require('dotenv').config();
|
||||
const platform = os.platform() // 'linux' (Ubuntu), 'darwin' (macOS), 'win32' (Windows)
|
||||
|
||||
let workers: number | string
|
||||
|
||||
if (process.env.E2E_WORKERS) {
|
||||
workers = process.env.E2E_WORKERS.includes('%')
|
||||
? process.env.E2E_WORKERS
|
||||
: parseInt(process.env.E2E_WORKERS)
|
||||
} else if (!process.env.CI) {
|
||||
workers = 1 // Local dev: keep things simple and deterministic by default
|
||||
} else {
|
||||
// On CI: adjust based on OS
|
||||
switch (platform) {
|
||||
case 'linux':
|
||||
workers = '100%' // CI Linux runners are generally beefier
|
||||
break
|
||||
case 'darwin':
|
||||
case 'win32':
|
||||
default:
|
||||
workers = '75%' // Slightly conservative for GUI-based OSes
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* See https://playwright.dev/docs/test-configuration.
|
||||
@ -19,8 +38,8 @@ export default defineConfig({
|
||||
forbidOnly: !!process.env.CI,
|
||||
/* Do not retry */
|
||||
retries: process.env.CI ? 0 : 0,
|
||||
/* Different amount of parallelism on CI and local. */
|
||||
workers: process.env.CI ? 1 : 4,
|
||||
/* Use all available CPU cores */
|
||||
workers: workers,
|
||||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
||||
reporter: [
|
||||
[process.env.CI ? 'dot' : 'list'],
|
||||
|
@ -1,5 +1,29 @@
|
||||
import { defineConfig, devices } from '@playwright/test'
|
||||
import { platform } from 'os'
|
||||
import os from 'os'
|
||||
|
||||
const platform = os.platform() // 'linux' (Ubuntu), 'darwin' (macOS), 'win32' (Windows)
|
||||
|
||||
let workers: number | string
|
||||
|
||||
if (process.env.E2E_WORKERS) {
|
||||
workers = process.env.E2E_WORKERS.includes('%')
|
||||
? process.env.E2E_WORKERS
|
||||
: parseInt(process.env.E2E_WORKERS)
|
||||
} else if (!process.env.CI) {
|
||||
workers = 1 // Local dev: keep things simple and deterministic by default
|
||||
} else {
|
||||
// On CI: adjust based on OS
|
||||
switch (platform) {
|
||||
case 'linux':
|
||||
workers = '50%' // CI Linux runners are generally beefier
|
||||
break
|
||||
case 'darwin':
|
||||
case 'win32':
|
||||
default:
|
||||
workers = '25%' // Lower concurrency for heavier Electron processes
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* See https://playwright.dev/docs/test-configuration.
|
||||
@ -14,8 +38,8 @@ export default defineConfig({
|
||||
forbidOnly: true,
|
||||
/* Do not retry */
|
||||
retries: 0,
|
||||
/* Different amount of parallelism on CI and local. */
|
||||
workers: platform() === 'win32' ? 1 : 2,
|
||||
/* Use all available CPU cores */
|
||||
workers: workers,
|
||||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
||||
reporter: [
|
||||
['dot'],
|
||||
|
@ -31,7 +31,7 @@ data = {
|
||||
|
||||
{modified_release_body}
|
||||
'''),
|
||||
"username": "Modeling App Release Updates",
|
||||
"username": "Design Studio Release Updates",
|
||||
"avatar_url": "https://raw.githubusercontent.com/KittyCAD/modeling-app/main/public/discord-avatar.png"
|
||||
}
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
|
||||
First off, thank you so much for your interest in being a part of the closed Alpha program! We are thrilled to have others use our product and see what you build with it (and truthfully, how you break it too).
|
||||
|
||||
### Zoo Modeling App (ZMA)
|
||||
### Zoo Design Studio (ZMA)
|
||||
|
||||
What we are introducing to you is our Zoo Modeling App (ZMA). ZMA is a CAD application that expresses a hybrid style of traditional CAD interface along with a code-CAD interface. ZMA is a great way for us to test our own APIs as well as inspire others to develop their own applications.
|
||||
What we are introducing to you is our Zoo Design Studio (ZMA). ZMA is a CAD application that expresses a hybrid style of traditional CAD interface along with a code-CAD interface. ZMA is a great way for us to test our own APIs as well as inspire others to develop their own applications.
|
||||
|
||||
### Why Code?
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Define function
|
||||
// Create a function to make the 80-20 rail
|
||||
fn rail8020(originStart, railHeight, railLength) {
|
||||
// Sketch side 1 of profile
|
||||
sketch001 = startSketchOn(-XZ)
|
||||
|
@ -25,8 +25,6 @@ When you submit a PR to add or modify KCL samples, images and STEP files will be
|
||||
---
|
||||
#### [80-20-rail](80-20-rail/main.kcl) ([screenshot](screenshots/80-20-rail.png))
|
||||
[](80-20-rail/main.kcl)
|
||||
#### [a-parametric-bearing-pillow-block](a-parametric-bearing-pillow-block/main.kcl) ([screenshot](screenshots/a-parametric-bearing-pillow-block.png))
|
||||
[](a-parametric-bearing-pillow-block/main.kcl)
|
||||
#### [ball-bearing](ball-bearing/main.kcl) ([screenshot](screenshots/ball-bearing.png))
|
||||
[](ball-bearing/main.kcl)
|
||||
#### [bench](bench/main.kcl) ([screenshot](screenshots/bench.png))
|
||||
@ -83,6 +81,8 @@ When you submit a PR to add or modify KCL samples, images and STEP files will be
|
||||
[](mounting-plate/main.kcl)
|
||||
#### [multi-axis-robot](multi-axis-robot/main.kcl) ([screenshot](screenshots/multi-axis-robot.png))
|
||||
[](multi-axis-robot/main.kcl)
|
||||
#### [parametric-bearing-pillow-block](parametric-bearing-pillow-block/main.kcl) ([screenshot](screenshots/parametric-bearing-pillow-block.png))
|
||||
[](parametric-bearing-pillow-block/main.kcl)
|
||||
#### [pipe](pipe/main.kcl) ([screenshot](screenshots/pipe.png))
|
||||
[](pipe/main.kcl)
|
||||
#### [pipe-flange-assembly](pipe-flange-assembly/main.kcl) ([screenshot](screenshots/pipe-flange-assembly.png))
|
||||
|
@ -4,7 +4,7 @@
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Define constants like ball diameter, inside diamter, overhange length, and thickness
|
||||
// Define parameters
|
||||
outsideDiameter = 1.625
|
||||
sphereDia = 0.25
|
||||
shaftDia = 0.75
|
||||
@ -95,5 +95,3 @@ outsideWallSketch = startSketchOn(offsetPlane(XY, offset = -overallThickness / 2
|
||||
|> hole(circle(center = [0, 0], radius = shaftDia / 2 + wallThickness + sphereDia), %)
|
||||
|
||||
outsideWall = extrude(outsideWallSketch, length = overallThickness)
|
||||
|
||||
// https://www.mcmaster.com/60355K185/
|
||||
|
@ -4,8 +4,8 @@
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Import Constants
|
||||
import caliperTolerance, caliperPadLength, caliperThickness, caliperOuterEdgeRadius, caliperInnerEdgeRadius, rotorDiameter, rotorTotalThickness, yAxisOffset from "globals.kcl"
|
||||
// Import parameters
|
||||
import caliperTolerance, caliperPadLength, caliperThickness, caliperOuterEdgeRadius, caliperInnerEdgeRadius, rotorDiameter, rotorTotalThickness, yAxisOffset from "parameters.kcl"
|
||||
|
||||
// Sketch the brake caliper profile
|
||||
brakeCaliperSketch = startSketchOn(XY)
|
||||
|
@ -4,8 +4,8 @@
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Import Constants
|
||||
import rotorDiameter, rotorInnerDiameter, rotorSinglePlateThickness, rotorInnerDiameterThickness, lugHolePatternDia, lugSpacing, rotorTotalThickness, spacerPatternDiameter, spacerDiameter, spacerLength, spacerCount, wheelDiameter, lugCount, yAxisOffset, drillAndSlotCount from "globals.kcl"
|
||||
// Import parameters
|
||||
import rotorDiameter, rotorInnerDiameter, rotorSinglePlateThickness, rotorInnerDiameterThickness, lugHolePatternDia, lugSpacing, rotorTotalThickness, spacerPatternDiameter, spacerDiameter, spacerLength, spacerCount, wheelDiameter, lugCount, yAxisOffset, drillAndSlotCount from "parameters.kcl"
|
||||
|
||||
rotorSketch = startSketchOn(XZ)
|
||||
|> circle(center = [0, 0], radius = rotorDiameter / 2)
|
||||
|
@ -4,8 +4,8 @@
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Import Constants
|
||||
import tireInnerDiameter, tireOuterDiameter, tireDepth, bendRadius, tireTreadWidth, tireTreadDepth, tireTreadOffset from "globals.kcl"
|
||||
// Import parameters
|
||||
import tireInnerDiameter, tireOuterDiameter, tireDepth, bendRadius, tireTreadWidth, tireTreadDepth, tireTreadOffset from "parameters.kcl"
|
||||
|
||||
// Create the sketch of the tire
|
||||
tireSketch = startSketchOn(XY)
|
||||
|
@ -4,8 +4,8 @@
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Import Constants
|
||||
import lugCount, lugSpacing, offset, backSpacing, wheelWidth, wheelDiameter, spokeCount, spokeGap, spokeAngle, spokeThickness from "globals.kcl"
|
||||
// Import parameters
|
||||
import lugCount, lugSpacing, offset, backSpacing, wheelWidth, wheelDiameter, spokeCount, spokeGap, spokeAngle, spokeThickness from "parameters.kcl"
|
||||
|
||||
// Create the wheel center
|
||||
lugBase = startSketchOn(XZ)
|
||||
|
@ -4,8 +4,8 @@
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Import Constants
|
||||
import lugDiameter, lugHeadLength, lugThreadDiameter, lugLength, lugThreadDepth, lugSpacing from "globals.kcl"
|
||||
// Import parameters
|
||||
import lugDiameter, lugHeadLength, lugThreadDiameter, lugLength, lugThreadDepth, lugSpacing from "parameters.kcl"
|
||||
|
||||
customPlane = {
|
||||
plane = {
|
||||
|
@ -4,16 +4,24 @@
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Import parts
|
||||
import "car-wheel.kcl" as carWheel
|
||||
import "car-rotor.kcl" as carRotor
|
||||
import "brake-caliper.kcl" as brakeCaliper
|
||||
import "lug-nut.kcl" as lugNut
|
||||
import "car-tire.kcl" as carTire
|
||||
import lugCount from "globals.kcl"
|
||||
|
||||
// Import parameters
|
||||
import * from "parameters.kcl"
|
||||
|
||||
// Place the car rotor
|
||||
carRotor
|
||||
|> translate(x = 0, y = 0.5, z = 0)
|
||||
|
||||
// Place the car wheel
|
||||
carWheel
|
||||
|
||||
// Place the lug nuts
|
||||
lugNut
|
||||
|> patternCircular3d(
|
||||
arcDegrees = 360,
|
||||
@ -22,6 +30,10 @@ lugNut
|
||||
instances = lugCount,
|
||||
rotateDuplicates = false,
|
||||
)
|
||||
|
||||
// Place the brake caliper
|
||||
brakeCaliper
|
||||
|> translate(x = 0, y = 0.5, z = 0)
|
||||
|
||||
// Place the car tire
|
||||
carTire
|
||||
|
@ -1,9 +1,9 @@
|
||||
// Car wheel assembly global constants
|
||||
// Car wheel assembly parameters
|
||||
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Car Wheel
|
||||
// Car wheel
|
||||
export lugCount = 5
|
||||
export lugSpacing = 114.3 * mm()
|
||||
export offset = -35 * mm()
|
||||
@ -22,7 +22,7 @@ export lugThreadDiameter = lugDiameter / 2 * .85
|
||||
export lugLength = 30 * mm()
|
||||
export lugThreadDepth = lugLength - (12.7 * mm())
|
||||
|
||||
// Car Rotor
|
||||
// Car rotor
|
||||
export rotorDiameter = 12
|
||||
export rotorInnerDiameter = 6
|
||||
export rotorSinglePlateThickness = 0.25
|
||||
@ -36,7 +36,7 @@ export spacerCount = 16
|
||||
export yAxisOffset = 0.5
|
||||
export drillAndSlotCount = 5
|
||||
|
||||
// Car Tire
|
||||
// Car tire
|
||||
export tireInnerDiameter = 19
|
||||
export tireOuterDiameter = 24
|
||||
export tireDepth = 11.02
|
||||
@ -45,7 +45,7 @@ export tireTreadWidth = 0.39
|
||||
export tireTreadDepth = 0.39
|
||||
export tireTreadOffset = 3.15
|
||||
|
||||
// Brake Caliper
|
||||
// Brake caliper
|
||||
export caliperTolerance = 0.050
|
||||
export caliperPadLength = 1.6
|
||||
export caliperThickness = 0.39
|
@ -1,10 +1,10 @@
|
||||
// Color Cube
|
||||
// This is a color cube centered about the origin. It is used to help determine orientation in the scene.
|
||||
|
||||
// Set unit
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = mm)
|
||||
|
||||
// Globals referenced in drawRectangle
|
||||
// Parameters referenced in drawRectangle
|
||||
size = 100
|
||||
halfSize = size / 2
|
||||
extrudeLength = 1.0
|
||||
|
@ -1,9 +1,10 @@
|
||||
// Cycloidal Gear
|
||||
// A cycloidal gear is a gear with a continuous, curved tooth profile. They are used in watchmaking and high precision robotics actuation
|
||||
|
||||
// Set Units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Create a function for the cycloidal gear
|
||||
fn cycloidalGear(gearPitch, gearHeight, holeDiameter, helixAngle) {
|
||||
// Create a function to draw the gear profile as a sketch. Rotate each profile about the gear's axis by an helix angle proportional to the total gear height
|
||||
fn gearSketch(gHeight) {
|
||||
@ -44,4 +45,5 @@ fn cycloidalGear(gearPitch, gearHeight, holeDiameter, helixAngle) {
|
||||
return gearLoft
|
||||
}
|
||||
|
||||
// Call the cycloidal gear function
|
||||
cycloidalGear(.3, 1.5, 0.297, -80)
|
||||
|
@ -9,19 +9,19 @@
|
||||
circR = 25
|
||||
|
||||
// Calculated parameters
|
||||
// thickness of the dodecahedron
|
||||
// Thickness of the dodecahedron
|
||||
wallThickness = circR * 0.2
|
||||
|
||||
// angle between faces in radians
|
||||
// Angle between faces in radians
|
||||
dihedral = acos(-(sqrt(5) / 5))
|
||||
|
||||
// inscribed radius
|
||||
// Inscribed radius
|
||||
inscR = circR / 15 * sqrt(75 + 30 * sqrt(5))
|
||||
|
||||
// pentagon edge length
|
||||
// Pentagon edge length
|
||||
edgeL = 4 * circR / (sqrt(3) * (1 + sqrt(5)))
|
||||
|
||||
// pentagon radius
|
||||
// Pentagon radius
|
||||
pentR = edgeL / 2 / sin(toRadians(36))
|
||||
|
||||
// Define a plane for the bottom angled face
|
||||
@ -69,7 +69,7 @@ bottomBowl = patternCircular3d(
|
||||
rotateDuplicates = true,
|
||||
)
|
||||
|
||||
// pattern the bottom to create the top face
|
||||
// Pattern the bottom to create the top face
|
||||
patternCircular3d(
|
||||
bottom,
|
||||
instances = 2,
|
||||
@ -79,7 +79,7 @@ patternCircular3d(
|
||||
rotateDuplicates = true,
|
||||
)
|
||||
|
||||
// pattern the bottom angled faces to create the top
|
||||
// Pattern the bottom angled faces to create the top
|
||||
patternCircular3d(
|
||||
bottomBowl,
|
||||
instances = 2,
|
||||
|
@ -1,10 +1,10 @@
|
||||
// Dual-Basin Utility Sink
|
||||
// A stainless steel sink unit with dual rectangular basins and six under-counter storage compartments.
|
||||
|
||||
// set units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = mm)
|
||||
|
||||
// globals
|
||||
// Define parameters
|
||||
tableHeight = 850
|
||||
tableWidth = 3400
|
||||
tableDepth = 400
|
||||
|
@ -4,6 +4,7 @@
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = mm)
|
||||
|
||||
// Define parameters
|
||||
length = 175
|
||||
width = 125
|
||||
height = 70
|
||||
|
@ -1,10 +1,10 @@
|
||||
// Exhaust Manifold
|
||||
// A welded exhaust header for an inline 4-cylinder engine
|
||||
|
||||
// Set Units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Define Constants
|
||||
// Define parameters
|
||||
primaryTubeDiameter = 1.625
|
||||
wallThickness = 0.080
|
||||
plateHeight = 0.125
|
||||
|
@ -4,7 +4,7 @@
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Define constants
|
||||
// Define parameters
|
||||
mountingHoleDia = .625
|
||||
baseDia = 4.625
|
||||
pipeDia = 1.25
|
||||
|
@ -4,7 +4,7 @@
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = mm)
|
||||
|
||||
// define constants in mm
|
||||
// define parameters
|
||||
radius = 6.0
|
||||
width = 144.0
|
||||
length = 80.0
|
||||
@ -15,7 +15,7 @@ tabLength = 25
|
||||
tabWidth = 12
|
||||
tabThk = 4
|
||||
|
||||
// define a rectangular shape func
|
||||
// Define a rectangular shape func
|
||||
fn rectShape(pos, w, l) {
|
||||
rr = startSketchOn('xy')
|
||||
|> startProfileAt([pos[0] - (w / 2), pos[1] - (l / 2)], %)
|
||||
@ -26,7 +26,7 @@ fn rectShape(pos, w, l) {
|
||||
return rr
|
||||
}
|
||||
|
||||
// define the bracket plane
|
||||
// Define the bracket plane
|
||||
bracketPlane = {
|
||||
plane = {
|
||||
origin = { x = 0, y = length / 2 + thk, z = 0 },
|
||||
@ -36,7 +36,7 @@ bracketPlane = {
|
||||
}
|
||||
}
|
||||
|
||||
// build the bracket sketch around the body
|
||||
// Build the bracket sketch around the body
|
||||
fn bracketSketch(w, d, t) {
|
||||
s = startSketchOn(bracketPlane)
|
||||
|> startProfileAt([-w / 2 - t, d + t], %)
|
||||
@ -51,7 +51,7 @@ fn bracketSketch(w, d, t) {
|
||||
return s
|
||||
}
|
||||
|
||||
// build the body of the bracket
|
||||
// Build the body of the bracket
|
||||
bs = bracketSketch(width, depth, thk)
|
||||
bracketBody = bs
|
||||
|> extrude(length = length + 2 * thk)
|
||||
@ -65,7 +65,7 @@ bracketBody = bs
|
||||
],
|
||||
)
|
||||
|
||||
// define the tab plane
|
||||
// Define the tab plane
|
||||
tabPlane = {
|
||||
plane = {
|
||||
origin = { x = 0, y = 0, z = depth + thk },
|
||||
@ -75,7 +75,7 @@ tabPlane = {
|
||||
}
|
||||
}
|
||||
|
||||
// build the tabs of the mounting bracket (right side)
|
||||
// Build the tabs of the mounting bracket (right side)
|
||||
tabsR = startSketchOn(tabPlane)
|
||||
|> startProfileAt([width / 2 + thk, length / 2 + thk], %)
|
||||
|> line(end = [tabWidth, -tabLength / 3], tag = $edge11)
|
||||
@ -99,7 +99,7 @@ tabsR = startSketchOn(tabPlane)
|
||||
)
|
||||
|> patternLinear3d(axis = [0, -1, 0], instances = 2, distance = length + 2 * thk - (tabLength * 4 / 3))
|
||||
|
||||
// build the tabs of the mounting bracket (left side)
|
||||
// Build the tabs of the mounting bracket (left side)
|
||||
tabsL = startSketchOn(tabPlane)
|
||||
|> startProfileAt([-width / 2 - thk, length / 2 + thk], %)
|
||||
|> line(end = [-tabWidth, -tabLength / 3], tag = $edge21)
|
||||
@ -123,7 +123,7 @@ tabsL = startSketchOn(tabPlane)
|
||||
)
|
||||
|> patternLinear3d(axis = [0, -1, 0], instances = 2, distance = length + 2 * thk - (tabLength * 4 / 3))
|
||||
|
||||
// define a plane for retention bumps
|
||||
// Define a plane for retention bumps
|
||||
retPlane = {
|
||||
plane = {
|
||||
origin = { x = -width / 2 + 20, y = 0, z = 0 },
|
||||
@ -133,7 +133,7 @@ retPlane = {
|
||||
}
|
||||
}
|
||||
|
||||
// build the retention bump in the front
|
||||
// Build the retention bump in the front
|
||||
retFront = startSketchOn(retPlane)
|
||||
|> startProfileAt([-length / 2 - thk, 0], %)
|
||||
|> line(end = [0, thk])
|
||||
@ -141,7 +141,7 @@ retFront = startSketchOn(retPlane)
|
||||
|> close()
|
||||
|> extrude(length = width - 40)
|
||||
|
||||
// build the retention bump in the back
|
||||
// Build the retention bump in the back
|
||||
retBack = startSketchOn(retPlane)
|
||||
|> startProfileAt([length / 2 + thk, 0], %)
|
||||
|> line(end = [0, thk])
|
||||
|
@ -4,7 +4,7 @@
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = mm)
|
||||
|
||||
// Define constants in millimeters (mm)
|
||||
// Define parameters
|
||||
flipperThickness = 3.5
|
||||
flipperLength = 70.0
|
||||
handleWidth = 15.0
|
||||
@ -16,7 +16,7 @@ gripHeight = 20.0
|
||||
gripFilletRadius = 3.0
|
||||
gripSlotWidth = 8.0
|
||||
|
||||
// function for drawing slots on a sketch given the start and end points as well as a width
|
||||
// Function for drawing slots on a sketch given the start and end points as well as a width
|
||||
fn slot(sketch1, start, end, width) {
|
||||
angle = if start[0] == end[0] {
|
||||
if end[1] > start[1] {
|
||||
@ -43,10 +43,10 @@ fn slot(sketch1, start, end, width) {
|
||||
return slotSketch
|
||||
}
|
||||
|
||||
// create a sketch on the "XY" plane
|
||||
// Create a sketch on the "XY" plane
|
||||
sketch000 = startSketchOn(XY)
|
||||
|
||||
// create a profile of the flipper
|
||||
// Create a profile of the flipper
|
||||
flipperProfile = startProfileAt([-flipperLength, -32.0], sketch000)
|
||||
|> line(end = [flipperLength, 2.0])
|
||||
|> yLine(length = 60.0, tag = $backEdge)
|
||||
@ -58,25 +58,25 @@ flipperProfile = startProfileAt([-flipperLength, -32.0], sketch000)
|
||||
}, %)
|
||||
|> close()
|
||||
|
||||
// create a profile of the middle
|
||||
// Create a profile of the middle
|
||||
slotProfile000 = slot(sketch000, [-25, 0], [-55, 0], flipperSlotWidth)
|
||||
|
||||
// create a profile of the top slot
|
||||
// Create a profile of the top slot
|
||||
slotProfile001 = slot(sketch000, [-25, 18], [-55, 19], flipperSlotWidth)
|
||||
|
||||
// create a profile of the bottom slot
|
||||
// Create a profile of the bottom slot
|
||||
slotProfile002 = slot(sketch000, [-25, -18], [-55, -19], flipperSlotWidth)
|
||||
|
||||
// create a profile with slots for the spatula
|
||||
// Create a profile with slots for the spatula
|
||||
spatulaProfile = flipperProfile
|
||||
|> hole(slotProfile000, %)
|
||||
|> hole(slotProfile001, %)
|
||||
|> hole(slotProfile002, %)
|
||||
|
||||
// extrude the profile to create the spatula flipper
|
||||
// Extrude the profile to create the spatula flipper
|
||||
flipper = extrude(spatulaProfile, length = flipperThickness)
|
||||
|
||||
// fillet the edges of the flipper
|
||||
// Fillet the edges of the flipper
|
||||
fillet(
|
||||
flipper,
|
||||
radius = flipperFilletRadius,
|
||||
@ -86,10 +86,10 @@ fillet(
|
||||
],
|
||||
)
|
||||
|
||||
// create a sketch on the "XZ" plane offset by half the thickness
|
||||
// Create a sketch on the "XZ" plane offset by half the thickness
|
||||
sketch001 = startSketchOn(offsetPlane(XZ, offset = -handleWidth / 2))
|
||||
|
||||
// create a profile of the spatula handle
|
||||
// Create a profile of the spatula handle
|
||||
handleProfile = startProfileAt([0.0, flipperThickness], sketch001)
|
||||
|> line(end = [31.819805, 31.819805], tag = $handleBottomEdge)
|
||||
|> line(end = [140.953893, 51.303021])
|
||||
@ -99,10 +99,10 @@ handleProfile = startProfileAt([0.0, flipperThickness], sketch001)
|
||||
|> xLine(length = 7.071068)
|
||||
|> close()
|
||||
|
||||
// create an extrusion extrude001
|
||||
// Create an extrusion extrude001
|
||||
handle = extrude(handleProfile, length = handleWidth)
|
||||
|
||||
// fillet the bend of the spatula handle
|
||||
// Fillet the bend of the spatula handle
|
||||
fillet(
|
||||
handle,
|
||||
radius = 4,
|
||||
@ -112,7 +112,7 @@ fillet(
|
||||
],
|
||||
)
|
||||
|
||||
// define a plane which is at the end of the handle
|
||||
// Define a plane which is at the end of the handle
|
||||
handlePlane = {
|
||||
plane = {
|
||||
origin = [208.593833, 0.0, 75.921946],
|
||||
@ -122,10 +122,10 @@ handlePlane = {
|
||||
}
|
||||
}
|
||||
|
||||
// create a sketch on the handle plane
|
||||
// Create a sketch on the handle plane
|
||||
sketch002 = startSketchOn(handlePlane)
|
||||
|
||||
// create a profile of the grip
|
||||
// Create a profile of the grip
|
||||
gripProfile = startProfileAt([-26.806746, -10.0], sketch002)
|
||||
|> xLine(length = gripWidth - (2 * gripFilletRadius))
|
||||
|> arc({
|
||||
@ -153,14 +153,14 @@ gripProfile = startProfileAt([-26.806746, -10.0], sketch002)
|
||||
}, %)
|
||||
|> close()
|
||||
|
||||
// extrude the grip profile to create the grip
|
||||
// Extrude the grip profile to create the grip
|
||||
grip = extrude(gripProfile, length = -gripLength)
|
||||
|
||||
// create a sketch on the grip for the hole
|
||||
// Create a sketch on the grip for the hole
|
||||
sketch003 = startSketchOn(grip, gripEdgeTop)
|
||||
|
||||
// create a profile for the grip hole
|
||||
// Create a profile for the grip hole
|
||||
gripHoleProfile = slot(sketch003, [0, 200], [0, 210], gripSlotWidth)
|
||||
|
||||
// cut a hole in the grip
|
||||
// Cut a hole in the grip
|
||||
extrude(gripHoleProfile, length = -gripWidth - 20)
|
||||
|
@ -4,7 +4,7 @@
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Define constants
|
||||
// Define parameters
|
||||
carafeDiameter = 4.41
|
||||
carafeHeight = 7.32
|
||||
handleThickness = 0.65
|
||||
|
@ -1,10 +1,10 @@
|
||||
// 100mm Gear Rack
|
||||
// A flat bar or rail that is engraved with teeth along its length. These teeth are designed to mesh with the teeth of a gear, known as a pinion. When the pinion, a small cylindrical gear, rotates, its teeth engage with the teeth on the rack, causing the rack to move linearly. Conversely, linear motion applied to the rack will cause the pinion to rotate.
|
||||
|
||||
// Set Units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = mm)
|
||||
|
||||
// Define constants
|
||||
// Define parameters
|
||||
length = 100
|
||||
pitchHeight = 11.5
|
||||
width = 5
|
||||
|
@ -1,10 +1,10 @@
|
||||
// Spur Gear
|
||||
// A rotating machine part having cut teeth or, in the case of a cogwheel, inserted teeth (called cogs), which mesh with another toothed part to transmit torque. Geared devices can change the speed, torque, and direction of a power source. The two elements that define a gear are its circular shape and the teeth that are integrated into its outer edge, which are designed to fit into the teeth of another gear.
|
||||
|
||||
// Set Units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Define constants
|
||||
// Define parameters
|
||||
nTeeth = 21
|
||||
module = 0.5
|
||||
pitchDiameter = module * nTeeth
|
||||
|
@ -4,7 +4,7 @@
|
||||
// Set units in millimeters (mm)
|
||||
@settings(defaultLengthUnit = mm)
|
||||
|
||||
// Define constants
|
||||
// Define parameters
|
||||
binLength = 42.0
|
||||
cornerRadius = 4.0
|
||||
firstStep = 0.7
|
||||
@ -21,7 +21,7 @@ countBinLength = 3
|
||||
// The total height of the baseplate is a summation of the vertical heights of the baseplate steps
|
||||
height = firstStep + secondStep + thirdStep
|
||||
|
||||
// define a function which builds the profile of the baseplate bin
|
||||
// Define a function which builds the profile of the baseplate bin
|
||||
fn face(plane) {
|
||||
faceSketch = startSketchOn(plane)
|
||||
|> startProfileAt([0, 0], %)
|
||||
@ -33,10 +33,10 @@ fn face(plane) {
|
||||
return faceSketch
|
||||
}
|
||||
|
||||
// extrude a single side of the bin
|
||||
// Extrude a single side of the bin
|
||||
singleSide = extrude(face(offsetPlane(YZ, offset = cornerRadius)), length = binLength - (cornerRadius * 2))
|
||||
|
||||
// create the other sides of the bin by using a circular pattern
|
||||
// Create the other sides of the bin by using a circular pattern
|
||||
sides = patternCircular3d(
|
||||
singleSide,
|
||||
arcDegrees = 360,
|
||||
@ -46,16 +46,16 @@ sides = patternCircular3d(
|
||||
rotateDuplicates = true,
|
||||
)
|
||||
|
||||
// define an axis axis000
|
||||
// Define an axis axis000
|
||||
axis000 = {
|
||||
direction = [0.0, 1.0],
|
||||
origin = [cornerRadius, cornerRadius]
|
||||
}
|
||||
|
||||
// create a single corner of the bin
|
||||
// Create a single corner of the bin
|
||||
singleCorner = revolve(face(offsetPlane(YZ, offset = cornerRadius)), angle = -90, axis = axis000)
|
||||
|
||||
// create the corners of the bin
|
||||
// Create the corners of the bin
|
||||
corners = patternCircular3d(
|
||||
singleCorner,
|
||||
arcDegrees = 360,
|
||||
@ -65,7 +65,7 @@ corners = patternCircular3d(
|
||||
rotateDuplicates = true,
|
||||
)
|
||||
|
||||
// create the baseplate by patterning sides
|
||||
// Create the baseplate by patterning sides
|
||||
basePlateSides = patternLinear3d(
|
||||
sides,
|
||||
axis = [1.0, 0.0, 0.0],
|
||||
@ -74,7 +74,7 @@ basePlateSides = patternLinear3d(
|
||||
)
|
||||
|> patternLinear3d(axis = [0.0, 1.0, 0.0], instances = countBinLength, distance = binLength)
|
||||
|
||||
// create the corners of the baseplate by patterning the corners
|
||||
// Create the corners of the baseplate by patterning the corners
|
||||
basePlateCorners = patternLinear3d(
|
||||
corners,
|
||||
axis = [1.0, 0.0, 0.0],
|
||||
@ -83,7 +83,7 @@ basePlateCorners = patternLinear3d(
|
||||
)
|
||||
|> patternLinear3d(axis = [0.0, 1.0, 0.0], instances = countBinLength, distance = binLength)
|
||||
|
||||
// create the center cutout for the magnet profile
|
||||
// Create the center cutout for the magnet profile
|
||||
fn magnetCenterCutout(plane) {
|
||||
magnetSketch = startSketchOn(plane)
|
||||
|> startProfileAt([
|
||||
@ -126,7 +126,7 @@ fn magnetCenterCutout(plane) {
|
||||
return magnetSketch
|
||||
}
|
||||
|
||||
// create the outside profile of the magnets
|
||||
// Create the outside profile of the magnets
|
||||
fn magnetBase(plane) {
|
||||
magnetBaseSketch = startSketchOn(plane)
|
||||
|> startProfileAt([0, 0], %)
|
||||
@ -138,7 +138,7 @@ fn magnetBase(plane) {
|
||||
return magnetBaseSketch
|
||||
}
|
||||
|
||||
// create sketch profile sketch000Profile002
|
||||
// Create sketch profile sketch000Profile002
|
||||
magnetsSketch = startSketchOn(XY)
|
||||
|> circle(center = [cornerRadius * 2, cornerRadius * 2], radius = magOuterDiam / 2)
|
||||
|> patternCircular2d(
|
||||
@ -148,14 +148,14 @@ magnetsSketch = startSketchOn(XY)
|
||||
rotateDuplicates = true,
|
||||
)
|
||||
|
||||
// create a profile with holes for the magnets
|
||||
// Create a profile with holes for the magnets
|
||||
magnetProfile = magnetBase(XY)
|
||||
|> hole(magnetsSketch, %)
|
||||
|
||||
// create an extrusion of the magnet cutout with holes
|
||||
// Create an extrusion of the magnet cutout with holes
|
||||
magnetHolesExtrude = extrude(magnetProfile, length = -magDepth)
|
||||
|
||||
// add a fillet to the extrusion
|
||||
// Add a fillet to the extrusion
|
||||
magnetHolesExtrudeFillets = fillet(
|
||||
magnetHolesExtrude,
|
||||
radius = cornerRadius,
|
||||
@ -167,13 +167,13 @@ magnetHolesExtrudeFillets = fillet(
|
||||
],
|
||||
)
|
||||
|
||||
// create a profile without the holes for the magnets
|
||||
// Create a profile without the holes for the magnets
|
||||
magnetProfileNoMagnets = magnetBase(offsetPlane(XY, offset = -magDepth))
|
||||
|
||||
// create an extrusion of the magnet cutout without holes
|
||||
// Create an extrusion of the magnet cutout without holes
|
||||
magnetCutoutExtrude = extrude(magnetProfileNoMagnets, length = -magDepth)
|
||||
|
||||
// add a fillet to the extrusion
|
||||
// Add a fillet to the extrusion
|
||||
magnetCutoutExtrudeFillets = fillet(
|
||||
magnetCutoutExtrude,
|
||||
radius = cornerRadius,
|
||||
@ -185,7 +185,7 @@ magnetCutoutExtrudeFillets = fillet(
|
||||
],
|
||||
)
|
||||
|
||||
// pattern the magnet cutouts with holes
|
||||
// Pattern the magnet cutouts with holes
|
||||
patternLinear3d(
|
||||
magnetHolesExtrudeFillets,
|
||||
axis = [1.0, 0.0, 0.0],
|
||||
@ -194,7 +194,7 @@ patternLinear3d(
|
||||
)
|
||||
|> patternLinear3d(axis = [0.0, 1.0, 0.0], instances = countBinLength, distance = binLength)
|
||||
|
||||
// pattern the magnet cutouts without holes
|
||||
// Pattern the magnet cutouts without holes
|
||||
patternLinear3d(
|
||||
magnetCutoutExtrudeFillets,
|
||||
axis = [1.0, 0.0, 0.0],
|
||||
|
@ -4,7 +4,7 @@
|
||||
// Set units in millimeters (mm)
|
||||
@settings(defaultLengthUnit = mm)
|
||||
|
||||
// Define constants
|
||||
// Define parameters
|
||||
binLength = 42.0
|
||||
cornerRadius = 4.0
|
||||
firstStep = 0.7
|
||||
@ -18,7 +18,7 @@ countBinLength = 3
|
||||
// The total height of the baseplate is a summation of the vertical heights of the baseplate steps
|
||||
height = firstStep + secondStep + thirdStep
|
||||
|
||||
// define a function which builds the profile of the baseplate bin
|
||||
// Define a function which builds the profile of the baseplate bin
|
||||
fn face(plane) {
|
||||
faceSketch = startSketchOn(plane)
|
||||
|> startProfileAt([0, 0], %)
|
||||
@ -30,10 +30,10 @@ fn face(plane) {
|
||||
return faceSketch
|
||||
}
|
||||
|
||||
// extrude a single side of the bin
|
||||
// Extrude a single side of the bin
|
||||
singleSide = extrude(face(offsetPlane(YZ, offset = cornerRadius)), length = binLength - (cornerRadius * 2))
|
||||
|
||||
// create the other sides of the bin by using a circular pattern
|
||||
// Create the other sides of the bin by using a circular pattern
|
||||
sides = patternCircular3d(
|
||||
singleSide,
|
||||
arcDegrees = 360,
|
||||
@ -43,16 +43,16 @@ sides = patternCircular3d(
|
||||
rotateDuplicates = true,
|
||||
)
|
||||
|
||||
// define an axis axis000
|
||||
// Define an axis axis000
|
||||
axis000 = {
|
||||
direction = [0.0, 1.0],
|
||||
origin = [cornerRadius, cornerRadius]
|
||||
}
|
||||
|
||||
// create a single corner of the bin
|
||||
// Create a single corner of the bin
|
||||
singleCorner = revolve(face(offsetPlane(YZ, offset = cornerRadius)), angle = -90, axis = axis000)
|
||||
|
||||
// create the corners of the bin
|
||||
// Create the corners of the bin
|
||||
corners = patternCircular3d(
|
||||
singleCorner,
|
||||
arcDegrees = 360,
|
||||
@ -62,7 +62,7 @@ corners = patternCircular3d(
|
||||
rotateDuplicates = true,
|
||||
)
|
||||
|
||||
// create the baseplate by patterning sides
|
||||
// Create the baseplate by patterning sides
|
||||
basePlateSides = patternLinear3d(
|
||||
sides,
|
||||
axis = [1.0, 0.0, 0.0],
|
||||
@ -71,7 +71,7 @@ basePlateSides = patternLinear3d(
|
||||
)
|
||||
|> patternLinear3d(axis = [0.0, 1.0, 0.0], instances = countBinLength, distance = binLength)
|
||||
|
||||
// create the corners of the baseplate by patterning the corners
|
||||
// Create the corners of the baseplate by patterning the corners
|
||||
basePlateCorners = patternLinear3d(
|
||||
corners,
|
||||
axis = [1.0, 0.0, 0.0],
|
||||
|
@ -4,7 +4,7 @@
|
||||
// Set units in millimeters (mm)
|
||||
@settings(defaultLengthUnit = mm)
|
||||
|
||||
// Define constants
|
||||
// Define parameters
|
||||
binLength = 41.5
|
||||
binHeight = 7.0
|
||||
binBaseLength = 2.95
|
||||
@ -33,7 +33,7 @@ countBinHeight = 1
|
||||
height = firstStep + secondStep + thirdStep
|
||||
lipHeight = lipStep1 + lipStep2 + lipStep3 + lipStep4 + lipStep5
|
||||
|
||||
// define a function which builds the profile of the baseplate bin
|
||||
// Define a function which builds the profile of the baseplate bin
|
||||
fn face(plane) {
|
||||
faceSketch = startSketchOn(plane)
|
||||
|> startProfileAt([binBaseLength + binTol, 0], %)
|
||||
@ -46,10 +46,10 @@ fn face(plane) {
|
||||
return faceSketch
|
||||
}
|
||||
|
||||
// extrude a single side of the bin
|
||||
// Extrude a single side of the bin
|
||||
singleSide = extrude(face(offsetPlane(YZ, offset = cornerRadius + binTol)), length = binLength - (cornerRadius * 2))
|
||||
|
||||
// create the other sides of the bin by using a circular pattern
|
||||
// Create the other sides of the bin by using a circular pattern
|
||||
sides = patternCircular3d(
|
||||
singleSide,
|
||||
arcDegrees = 360,
|
||||
@ -63,7 +63,7 @@ sides = patternCircular3d(
|
||||
rotateDuplicates = true,
|
||||
)
|
||||
|
||||
// define an axis axis000
|
||||
// Define an axis axis000
|
||||
axis000 = {
|
||||
direction = [0.0, 1.0],
|
||||
origin = [
|
||||
@ -72,10 +72,10 @@ axis000 = {
|
||||
]
|
||||
}
|
||||
|
||||
// create a single corner of the bin
|
||||
// Create a single corner of the bin
|
||||
singleCorner = revolve(face(offsetPlane(YZ, offset = cornerRadius + binTol)), angle = -90, axis = axis000)
|
||||
|
||||
// create the corners of the bin
|
||||
// Create the corners of the bin
|
||||
corners = patternCircular3d(
|
||||
singleCorner,
|
||||
arcDegrees = 360,
|
||||
@ -128,7 +128,7 @@ magCutout000 = startSketchOn(singleBinFill, "start")
|
||||
)
|
||||
|> extrude(length = -magDepth)
|
||||
|
||||
// create the baseplate by patterning sides
|
||||
// Create the baseplate by patterning sides
|
||||
binSides = patternLinear3d(
|
||||
sides,
|
||||
axis = [1.0, 0.0, 0.0],
|
||||
@ -137,7 +137,7 @@ binSides = patternLinear3d(
|
||||
)
|
||||
|> patternLinear3d(axis = [0.0, 1.0, 0.0], instances = countBinLength, distance = binLength + binTol * 2)
|
||||
|
||||
// create the corners of the baseplate by patterning the corners
|
||||
// Create the corners of the baseplate by patterning the corners
|
||||
binCorners = patternLinear3d(
|
||||
corners,
|
||||
axis = [1.0, 0.0, 0.0],
|
||||
@ -146,7 +146,7 @@ binCorners = patternLinear3d(
|
||||
)
|
||||
|> patternLinear3d(axis = [0.0, 1.0, 0.0], instances = countBinLength, distance = binLength + binTol * 2)
|
||||
|
||||
// create the fill of the bin by patterning the corners
|
||||
// Create the fill of the bin by patterning the corners
|
||||
binFill = patternLinear3d(
|
||||
singleBinFill,
|
||||
axis = [1.0, 0.0, 0.0],
|
||||
@ -155,7 +155,6 @@ binFill = patternLinear3d(
|
||||
)
|
||||
|> patternLinear3d(axis = [0.0, 1.0, 0.0], instances = countBinLength, distance = binLength + binTol * 2)
|
||||
|
||||
//
|
||||
binTop = startSketchOn(offsetPlane(XY, offset = height))
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> xLine(length = (binLength + 2 * binTol) * countBinWidth, tag = $line010)
|
||||
@ -174,7 +173,7 @@ binTop = startSketchOn(offsetPlane(XY, offset = height))
|
||||
)
|
||||
|> shell(faces = ["end"], thickness = binThk)
|
||||
|
||||
// define a function which builds the profile of the baseplate bin
|
||||
// Define a function which builds the profile of the baseplate bin
|
||||
fn lipFace(plane) {
|
||||
faceSketch = startSketchOn(plane)
|
||||
|> startProfileAt([0, 0], %)
|
||||
@ -234,13 +233,13 @@ plane002 = {
|
||||
}
|
||||
}
|
||||
|
||||
// extrude a single side of the lip of the bin
|
||||
// Extrude a single side of the lip of the bin
|
||||
lipSingleLength = extrude(lipFace(plane000), length = binLength * countBinWidth - (2 * cornerRadius) + 2 * binTol * countBinWidth)
|
||||
|
||||
// extrude a single side of the lip of the bin
|
||||
// Extrude a single side of the lip of the bin
|
||||
lipSingleWidth = extrude(lipFace(plane001), length = binLength * countBinLength - (2 * cornerRadius) + 2 * binTol * countBinLength)
|
||||
|
||||
// create the other sides of the lips by using a circular pattern
|
||||
// Create the other sides of the lips by using a circular pattern
|
||||
lipLengths = patternCircular3d(
|
||||
lipSingleLength,
|
||||
arcDegrees = 360,
|
||||
@ -254,7 +253,7 @@ lipLengths = patternCircular3d(
|
||||
rotateDuplicates = true,
|
||||
)
|
||||
|
||||
// create the other sides of the lips by using a circular pattern
|
||||
// Create the other sides of the lips by using a circular pattern
|
||||
lipWidths = patternCircular3d(
|
||||
lipSingleWidth,
|
||||
arcDegrees = 360,
|
||||
@ -268,19 +267,19 @@ lipWidths = patternCircular3d(
|
||||
rotateDuplicates = true,
|
||||
)
|
||||
|
||||
// define an axis axis000
|
||||
// Define an axis axis000
|
||||
axis001 = {
|
||||
direction = [0.0, 1.0],
|
||||
origin = [cornerRadius, cornerRadius]
|
||||
}
|
||||
|
||||
// create a single corner of the bin
|
||||
// Create a single corner of the bin
|
||||
lipSingleLengthCorner = revolve(lipFace(plane000), angle = -90, axis = axis001)
|
||||
|
||||
// create a single corner of the bin
|
||||
// Create a single corner of the bin
|
||||
lipSingleWidthCorner = revolve(lipFace(plane002), angle = 90, axis = axis001)
|
||||
|
||||
// create the corners of the bin
|
||||
// Create the corners of the bin
|
||||
lipCorners000 = patternCircular3d(
|
||||
lipSingleLengthCorner,
|
||||
arcDegrees = 360,
|
||||
@ -294,7 +293,7 @@ lipCorners000 = patternCircular3d(
|
||||
rotateDuplicates = true,
|
||||
)
|
||||
|
||||
// create the corners of the bin
|
||||
// Create the corners of the bin
|
||||
lipCorners001 = patternCircular3d(
|
||||
lipSingleWidthCorner,
|
||||
arcDegrees = 360,
|
||||
|
@ -4,7 +4,7 @@
|
||||
// Set units in millimeters (mm)
|
||||
@settings(defaultLengthUnit = mm)
|
||||
|
||||
// Define constants
|
||||
// Define parameters
|
||||
binLength = 41.5
|
||||
binHeight = 7.0
|
||||
binBaseLength = 2.95
|
||||
@ -26,7 +26,7 @@ countBinHeight = 2
|
||||
// The total height of the baseplate is a summation of the vertical heights of the baseplate steps
|
||||
height = firstStep + secondStep + thirdStep
|
||||
|
||||
// define a function which builds the profile of the baseplate bin
|
||||
// Define a function which builds the profile of the baseplate bin
|
||||
fn face(plane) {
|
||||
faceSketch = startSketchOn(plane)
|
||||
|> startProfileAt([binBaseLength + binTol, 0], %)
|
||||
@ -39,10 +39,10 @@ fn face(plane) {
|
||||
return faceSketch
|
||||
}
|
||||
|
||||
// extrude a single side of the bin
|
||||
// Extrude a single side of the bin
|
||||
singleSide = extrude(face(offsetPlane(YZ, offset = cornerRadius + binTol)), length = binLength - (cornerRadius * 2))
|
||||
|
||||
// create the other sides of the bin by using a circular pattern
|
||||
// Create the other sides of the bin by using a circular pattern
|
||||
sides = patternCircular3d(
|
||||
singleSide,
|
||||
arcDegrees = 360,
|
||||
@ -56,7 +56,7 @@ sides = patternCircular3d(
|
||||
rotateDuplicates = true,
|
||||
)
|
||||
|
||||
// define an axis axis000
|
||||
// Define an axis axis000
|
||||
axis000 = {
|
||||
direction = [0.0, 1.0],
|
||||
origin = [
|
||||
@ -65,10 +65,10 @@ axis000 = {
|
||||
]
|
||||
}
|
||||
|
||||
// create a single corner of the bin
|
||||
// Create a single corner of the bin
|
||||
singleCorner = revolve(face(offsetPlane(YZ, offset = cornerRadius + binTol)), angle = -90, axis = axis000)
|
||||
|
||||
// create the corners of the bin
|
||||
// Create the corners of the bin
|
||||
corners = patternCircular3d(
|
||||
singleCorner,
|
||||
arcDegrees = 360,
|
||||
@ -121,7 +121,7 @@ magCutout000 = startSketchOn(singleBinFill, "start")
|
||||
)
|
||||
|> extrude(length = -magDepth)
|
||||
|
||||
// create the baseplate by patterning sides
|
||||
// Create the baseplate by patterning sides
|
||||
binSides = patternLinear3d(
|
||||
sides,
|
||||
axis = [1.0, 0.0, 0.0],
|
||||
@ -130,7 +130,7 @@ binSides = patternLinear3d(
|
||||
)
|
||||
|> patternLinear3d(axis = [0.0, 1.0, 0.0], instances = countBinLength, distance = binLength + binTol * 2)
|
||||
|
||||
// create the corners of the baseplate by patterning the corners
|
||||
// Create the corners of the baseplate by patterning the corners
|
||||
binCorners = patternLinear3d(
|
||||
corners,
|
||||
axis = [1.0, 0.0, 0.0],
|
||||
@ -139,7 +139,7 @@ binCorners = patternLinear3d(
|
||||
)
|
||||
|> patternLinear3d(axis = [0.0, 1.0, 0.0], instances = countBinLength, distance = binLength + binTol * 2)
|
||||
|
||||
// create the fill of the bin by patterning the corners
|
||||
// Create the fill of the bin by patterning the corners
|
||||
binFill = patternLinear3d(
|
||||
singleBinFill,
|
||||
axis = [1.0, 0.0, 0.0],
|
||||
@ -148,7 +148,7 @@ binFill = patternLinear3d(
|
||||
)
|
||||
|> patternLinear3d(axis = [0.0, 1.0, 0.0], instances = countBinLength, distance = binLength + binTol * 2)
|
||||
|
||||
// create the top of the bin
|
||||
// Create the top of the bin
|
||||
binTop = startSketchOn(offsetPlane(XY, offset = height))
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> xLine(length = (binLength + 2 * binTol) * countBinWidth, tag = $line010)
|
||||
|
@ -1,10 +1,10 @@
|
||||
// Hex nut
|
||||
// Hex Nut
|
||||
// A hex nut is a type of fastener with a threaded hole and a hexagonal outer shape, used in a wide variety of applications to secure parts together. The hexagonal shape allows for a greater torque to be applied with wrenches or tools, making it one of the most common nut types in hardware.
|
||||
|
||||
// Set Units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Define constants (5/16" - 24 thread size)
|
||||
// Define parameters (5/16" - 24 thread size)
|
||||
wallToWallLength = 0.5
|
||||
thickness = 0.266
|
||||
diameter = 0.3125
|
||||
|
@ -1,10 +1,10 @@
|
||||
// I-beam
|
||||
// A structural metal beam with an I shaped cross section. Often used in construction and architecture
|
||||
|
||||
// Set Units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Define Beam Dimensions
|
||||
// Define parameters
|
||||
beamLength = 6 * ft()
|
||||
beamHeight = 4
|
||||
flangeWidth = 2.663
|
||||
@ -13,7 +13,7 @@ webThickness = 0.193
|
||||
rootRadius = 0.457
|
||||
|
||||
// Sketch a quadrant of the beam cross section, then mirror for symmetry across each axis. Extrude to the appropriate length
|
||||
sketch001 = startSketchOn(-XZ)
|
||||
iBeam = startSketchOn(-XZ)
|
||||
|> startProfileAt([0, beamHeight / 2], %)
|
||||
|> xLine(length = flangeWidth / 2)
|
||||
|> yLine(length = -flangeThickness)
|
||||
|
@ -1,10 +1,10 @@
|
||||
// Zoo Keyboard
|
||||
// A custom keyboard with Zoo brand lettering
|
||||
|
||||
// Set Units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Define constants
|
||||
// Define parameters
|
||||
baseColor = "#0f0f0f"
|
||||
highlightColor1 = "#b0b0b0"
|
||||
highlightColor2 = "#23af93"
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Kitt
|
||||
// The beloved KittyCAD mascot in a voxelized style.
|
||||
|
||||
// pixel box function
|
||||
// Pixel box function
|
||||
fn pixelBox(kitExtrude, extrudeTag, positionY, positionZ, width, height, depth) {
|
||||
pixelBoxBody = startSketchOn(kitExtrude, extrudeTag)
|
||||
|> startProfileAt([positionY, positionZ], %)
|
||||
|
@ -4,8 +4,8 @@
|
||||
// Set Units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Define constants
|
||||
lbumps = 4 // number of bumps long
|
||||
// Define parameters
|
||||
lbumps = 3 // number of bumps long
|
||||
wbumps = 2 // number of bumps wide
|
||||
pitch = 8.0
|
||||
clearance = 0.1
|
||||
|
@ -1,19 +1,19 @@
|
||||
// Makeup Mirror
|
||||
// A circular vanity mirror mounted on a swiveling arm with pivot joints, used for personal grooming.
|
||||
|
||||
// Settings
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = mm)
|
||||
|
||||
// hinge
|
||||
// Hinge parameters
|
||||
hingeRadius = 8
|
||||
hingeHeight = hingeRadius * 3
|
||||
hingeGap = 0.5
|
||||
|
||||
// arm
|
||||
// Arm parameters
|
||||
armLength = 170
|
||||
armRadius = 5
|
||||
|
||||
// mirror
|
||||
// Mirror parameters
|
||||
mirrorRadius = 170 / 2
|
||||
mirrorThickness = 10
|
||||
archToMirrorGap = 5
|
||||
@ -21,7 +21,7 @@ archThickness = 1
|
||||
archRadius = mirrorRadius + archToMirrorGap
|
||||
|
||||
// Geometry
|
||||
// hinge
|
||||
// Add a function to create the hinge
|
||||
fn hingeFn(x, y, z) {
|
||||
hingeBody = startSketchOn(offsetPlane(XY, offset = z))
|
||||
|> circle(center = [x, y], radius = hingeRadius)
|
||||
@ -39,7 +39,7 @@ hingePartB3 = hingeFn(armLength, 0, hingeHeight * 2 + hingeGap * 2)
|
||||
hingePartC2 = hingeFn(armLength, -armLength, hingeHeight * 2 + hingeGap * 2)
|
||||
hingePartC3 = hingeFn(armLength, -armLength, hingeHeight * 3 + hingeGap * 3)
|
||||
|
||||
// arm
|
||||
// Add a function to create the arm
|
||||
fn armFn(plane, offset, altitude) {
|
||||
armBody = startSketchOn(plane)
|
||||
|> circle(center = [offset, altitude], radius = armRadius)
|
||||
@ -50,7 +50,7 @@ fn armFn(plane, offset, altitude) {
|
||||
armPartA = armFn(YZ, 0, hingeHeight * 1.5 + hingeGap)
|
||||
armPartB = armFn(XZ, armLength, hingeHeight * 2.5 + hingeGap * 2)
|
||||
|
||||
// mirror
|
||||
// Add a function to create the mirror
|
||||
fn mirrorFn(plane, offsetX, offsetY, altitude, radius, tiefe, gestellR, gestellD) {
|
||||
armPlane = startSketchOn( offsetPlane(plane, offset = offsetY - (tiefe / 2)))
|
||||
armBody = circle(armPlane, center = [offsetX, altitude], radius = radius)
|
||||
|
@ -6,13 +6,6 @@
|
||||
"title": "80/20 Rail",
|
||||
"description": "An 80/20 extruded aluminum linear rail. T-slot profile adjustable by profile height, rail length, and origin position"
|
||||
},
|
||||
{
|
||||
"file": "main.kcl",
|
||||
"pathFromProjectDirectoryToFirstFile": "a-parametric-bearing-pillow-block/main.kcl",
|
||||
"multipleFiles": false,
|
||||
"title": "A Parametric Bearing Pillow Block",
|
||||
"description": "A bearing pillow block, also known as a plummer block or pillow block bearing, is a pedestal used to provide support for a rotating shaft with the help of compatible bearings and various accessories. Housing a bearing, the pillow block provides a secure and stable foundation that allows the shaft to rotate smoothly within its machinery setup. These components are essential in a wide range of mechanical systems and machinery, playing a key role in reducing friction and supporting radial and axial loads."
|
||||
},
|
||||
{
|
||||
"file": "main.kcl",
|
||||
"pathFromProjectDirectoryToFirstFile": "ball-bearing/main.kcl",
|
||||
@ -157,7 +150,7 @@
|
||||
"file": "main.kcl",
|
||||
"pathFromProjectDirectoryToFirstFile": "hex-nut/main.kcl",
|
||||
"multipleFiles": false,
|
||||
"title": "Hex nut",
|
||||
"title": "Hex Nut",
|
||||
"description": "A hex nut is a type of fastener with a threaded hole and a hexagonal outer shape, used in a wide variety of applications to secure parts together. The hexagonal shape allows for a greater torque to be applied with wrenches or tools, making it one of the most common nut types in hardware."
|
||||
},
|
||||
{
|
||||
@ -209,12 +202,19 @@
|
||||
"title": "Robot Arm",
|
||||
"description": "A 4 axis robotic arm for industrial use. These machines can be used for assembly, packaging, organization of goods, and quality inspection processes"
|
||||
},
|
||||
{
|
||||
"file": "main.kcl",
|
||||
"pathFromProjectDirectoryToFirstFile": "parametric-bearing-pillow-block/main.kcl",
|
||||
"multipleFiles": false,
|
||||
"title": "Parametric Bearing Pillow Block",
|
||||
"description": "A bearing pillow block, also known as a plummer block or pillow block bearing, is a pedestal used to provide support for a rotating shaft with the help of compatible bearings and various accessories. Housing a bearing, the pillow block provides a secure and stable foundation that allows the shaft to rotate smoothly within its machinery setup. These components are essential in a wide range of mechanical systems and machinery, playing a key role in reducing friction and supporting radial and axial loads."
|
||||
},
|
||||
{
|
||||
"file": "main.kcl",
|
||||
"pathFromProjectDirectoryToFirstFile": "pipe/main.kcl",
|
||||
"multipleFiles": false,
|
||||
"title": "Pipe",
|
||||
"description": "A tubular section or hollow cylinder, usually but not necessarily of circular cross-section, used mainly to convey substances that can flow."
|
||||
"description": "Piping for the pipe flange assembly"
|
||||
},
|
||||
{
|
||||
"file": "main.kcl",
|
||||
@ -248,7 +248,7 @@
|
||||
"file": "main.kcl",
|
||||
"pathFromProjectDirectoryToFirstFile": "router-template-slate/main.kcl",
|
||||
"multipleFiles": false,
|
||||
"title": "Router template for a slate",
|
||||
"title": "Router Template for a Slate",
|
||||
"description": "A guide for routing a slate for a cross bar."
|
||||
},
|
||||
{
|
||||
|
@ -1,10 +1,10 @@
|
||||
// Mounting Plate
|
||||
// A flat piece of material, often metal or plastic, that serves as a support or base for attaching, securing, or mounting various types of equipment, devices, or components.
|
||||
|
||||
// Set Units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Define constants
|
||||
// Define parameters
|
||||
plateLength = 10
|
||||
plateWidth = 6
|
||||
filletRadius = 0.5
|
||||
|
@ -4,6 +4,7 @@
|
||||
// Set Units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Import parts
|
||||
import "robot-arm-base.kcl" as robotArmBase
|
||||
import "robot-rotating-base.kcl" as rotatingBase
|
||||
import "robot-arm-j2.kcl" as j2RobotArm
|
||||
|
@ -1,10 +1,10 @@
|
||||
// A Parametric Bearing Pillow Block
|
||||
// Parametric Bearing Pillow Block
|
||||
// A bearing pillow block, also known as a plummer block or pillow block bearing, is a pedestal used to provide support for a rotating shaft with the help of compatible bearings and various accessories. Housing a bearing, the pillow block provides a secure and stable foundation that allows the shaft to rotate smoothly within its machinery setup. These components are essential in a wide range of mechanical systems and machinery, playing a key role in reducing friction and supporting radial and axial loads.
|
||||
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Define constants such as length, width, height, counter-bore depth and diameter, bearing diameter, hole location padding, and more
|
||||
// Define parameters
|
||||
length = 6
|
||||
width = 4
|
||||
height = 1
|
||||
@ -14,15 +14,15 @@ holeDia = .375
|
||||
padding = 1.5
|
||||
bearingDia = 3
|
||||
|
||||
// (Needs to be updated). Sketch the block and extrude up to where the counterbore diameter starts.
|
||||
extrude001 = startSketchOn(XY)
|
||||
// Sketch the block body
|
||||
body = startSketchOn(XY)
|
||||
|> startProfileAt([-width / 2, -length / 2], %)
|
||||
|> line(endAbsolute = [width / 2, -length / 2])
|
||||
|> line(endAbsolute = [width / 2, length / 2])
|
||||
|> line(endAbsolute = [-width / 2, length / 2])
|
||||
|> close()
|
||||
|> extrude(length = height)
|
||||
extrude002 = startSketchOn(extrude001, 'end')
|
||||
counterBoreHoles = startSketchOn(body, 'end')
|
||||
|> circle(
|
||||
center = [
|
||||
-(width / 2 - (padding / 2)),
|
||||
@ -34,7 +34,7 @@ extrude002 = startSketchOn(extrude001, 'end')
|
||||
|> patternLinear2d(instances = 2, distance = width - padding, axis = [1, 0])
|
||||
|> extrude(%, length = -cbDepth)
|
||||
|
||||
extrude003 = startSketchOn(extrude001, 'start')
|
||||
boltHoles = startSketchOn(body, 'start')
|
||||
|> circle(
|
||||
center = [
|
||||
-(width / 2 - (padding / 2)),
|
||||
@ -46,6 +46,6 @@ extrude003 = startSketchOn(extrude001, 'start')
|
||||
|> patternLinear2d(instances = 2, distance = width - padding, axis = [1, 0])
|
||||
|> extrude(length = -height + cbDepth)
|
||||
|
||||
extrude004 = startSketchOn(extrude001, 'end')
|
||||
centerHole = startSketchOn(body, 'end')
|
||||
|> circle(center = [0, 0], radius = bearingDia / 2)
|
||||
|> extrude(length = -height)
|
@ -1,25 +1,23 @@
|
||||
// Pipe
|
||||
// piping for the pipe flange assembly
|
||||
// Piping for the pipe flange assembly
|
||||
|
||||
// set units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// import constants
|
||||
import pipeInnerDiameter, pipeOuterDiameter, pipeLength from "globals.kcl"
|
||||
// Import parameters
|
||||
import pipeInnerDiameter, pipeOuterDiameter, pipeLength from "parameters.kcl"
|
||||
|
||||
// create a function to make the pipe
|
||||
// Create a function to make the pipe. Export
|
||||
export fn pipe() {
|
||||
// create the pipe base
|
||||
// Create the pipe base
|
||||
pipeBase = startSketchOn(XZ)
|
||||
|> circle(%, center = [0, 0], radius = pipeOuterDiameter / 2)
|
||||
|> extrude(%, length = pipeLength)
|
||||
|
||||
// extrude a hole through the length of the pipe
|
||||
// Extrude a hole through the length of the pipe
|
||||
pipe = startSketchOn(pipeBase, 'end')
|
||||
|> circle(center = [0, 0], radius = pipeInnerDiameter / 2)
|
||||
|> extrude(%, length = -pipeLength)
|
||||
|> appearance(color = "#a24ed0")
|
||||
return pipe
|
||||
}
|
||||
|
||||
// https://www.mcmaster.com/1120T74/
|
||||
|
@ -1,15 +1,15 @@
|
||||
// 68095k348 flange
|
||||
// flange used for mating two pipes together in the pipe flange assembly.
|
||||
// Flange
|
||||
// Flange used for mating two pipes together in the pipe flange assembly.
|
||||
|
||||
// set units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// import constants
|
||||
import pipeDiameter, mountingHoleDiameter, mountingHolePlacementDiameter, flangeDiameter, flangeTotalThickness, flangeBackHeight, flangeFrontHeight, flangeBaseThickness, flangeBackDiameter, flangeFrontDiameter from "globals.kcl"
|
||||
// Import parameters
|
||||
import pipeDiameter, mountingHoleDiameter, mountingHolePlacementDiameter, flangeDiameter, flangeTotalThickness, flangeBackHeight, flangeFrontHeight, flangeBaseThickness, flangeBackDiameter, flangeFrontDiameter from "parameters.kcl"
|
||||
|
||||
// create a function to create the flange
|
||||
// Create a function to create the flange. We must create a function since we are using multiple flanges.
|
||||
export fn flange() {
|
||||
// sketch the mounting hole pattern
|
||||
// Sketch the mounting hole pattern
|
||||
mountingHoles = startSketchOn(XY)
|
||||
|> circle(%, center = [0, mountingHolePlacementDiameter / 2], radius = mountingHoleDiameter / 2)
|
||||
|> patternCircular2d(
|
||||
@ -20,13 +20,13 @@ export fn flange() {
|
||||
rotateDuplicates = false,
|
||||
)
|
||||
|
||||
// create the flange base
|
||||
// Create the flange base
|
||||
flangeBase = startSketchOn(XY)
|
||||
|> circle(%, center = [0, 0], radius = flangeDiameter / 2)
|
||||
|> hole(mountingHoles, %)
|
||||
|> extrude(%, length = flangeBaseThickness)
|
||||
|
||||
// create both the raised portions on the front and back of the flange base
|
||||
// Create both the raised portions on the front and back of the flange base
|
||||
flangeBack = startSketchOn(flangeBase, 'start')
|
||||
|> circle(%, center = [0, 0], radius = flangeBackDiameter / 2)
|
||||
|> extrude(%, length = flangeBackHeight)
|
||||
@ -34,7 +34,7 @@ export fn flange() {
|
||||
|> circle(%, center = [0, 0], radius = flangeFrontDiameter / 2)
|
||||
|> extrude(%, length = flangeFrontHeight)
|
||||
|
||||
// create the circular cut in the center for the pipe
|
||||
// Create the circular cut in the center for the pipe
|
||||
pipeCut = startSketchOn(flangeFront, 'end')
|
||||
|> circle(%, center = [0, 0], radius = pipeDiameter / 2)
|
||||
|> extrude(%, length = -flangeTotalThickness)
|
||||
@ -42,5 +42,3 @@ export fn flange() {
|
||||
|
||||
return pipeCut
|
||||
}
|
||||
|
||||
// https://www.mcmaster.com/68095K348/
|
||||
|
@ -1,13 +1,13 @@
|
||||
// 91251A404 Socket Head Cap Screw
|
||||
// Socket Head Cap Screw
|
||||
// screw for mating the flanges together in the pipe flange assembly
|
||||
|
||||
// set units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// import constants
|
||||
import boltDiameter, boltLength, boltHeadLength, boltHeadDiameter, boltHexDrive, boltHexFlatLength, boltThreadLength from "globals.kcl"
|
||||
// Import parameters
|
||||
import boltDiameter, boltLength, boltHeadLength, boltHeadDiameter, boltHexDrive, boltHexFlatLength, boltThreadLength from "parameters.kcl"
|
||||
|
||||
// create a function to make a the bolt
|
||||
// Create a function to make a the bolt
|
||||
export fn bolt() {
|
||||
// Create the head of the cap screw
|
||||
boltHead = startSketchOn(XZ)
|
||||
@ -52,5 +52,3 @@ export fn bolt() {
|
||||
|
||||
return boltBody
|
||||
}
|
||||
|
||||
// https://www.mcmaster.com/91251a404/
|
||||
|
@ -1,26 +1,19 @@
|
||||
// 9472K188 Gasket
|
||||
// gasket for the pipe flange assembly. A gasket is a mechanical seal that fills the space between two or more mating surfaces, preventing leaks of liquids or gases under compression
|
||||
// Gasket
|
||||
// Gasket for the pipe flange assembly. A gasket is a mechanical seal that fills the space between two or more mating surfaces, preventing leaks of liquids or gases under compression
|
||||
|
||||
// set units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// import constants
|
||||
import gasketOutsideDiameter, gasketInnerDiameter, gasketThickness from "globals.kcl"
|
||||
// Import parameters
|
||||
import gasketOutsideDiameter, gasketInnerDiameter, gasketThickness from "parameters.kcl"
|
||||
|
||||
// create a function to make the gasket
|
||||
export fn gasket() {
|
||||
// create the base of the gasket
|
||||
gasketBase = startSketchOn(XY)
|
||||
|> circle(%, center = [0, 0], radius = gasketOutsideDiameter / 2)
|
||||
|> extrude(%, length = gasketThickness)
|
||||
// Create the base of the gasket
|
||||
gasketBase = startSketchOn(XY)
|
||||
|> circle(%, center = [0, 0], radius = gasketOutsideDiameter / 2)
|
||||
|> extrude(%, length = gasketThickness)
|
||||
|
||||
// extrude a circular hole through the gasket base
|
||||
gasket = startSketchOn(gasketBase, 'end')
|
||||
|> circle(%, center = [0, 0], radius = gasketInnerDiameter / 2)
|
||||
|> extrude(%, length = -gasketThickness)
|
||||
|> appearance(%, color = "#d0cb3e")
|
||||
|
||||
return gasket
|
||||
}
|
||||
|
||||
// https://www.mcmaster.com/9472K616/
|
||||
// Extrude a circular hole through the gasket base
|
||||
startSketchOn(gasketBase, 'end')
|
||||
|> circle(%, center = [0, 0], radius = gasketInnerDiameter / 2)
|
||||
|> extrude(%, length = -gasketThickness)
|
||||
|> appearance(%, color = "#d0cb3e")
|
||||
|
@ -1,15 +1,15 @@
|
||||
// 95479A127 Hex Nut
|
||||
// hex nut for the screws in the pipe flange assembly.
|
||||
// Hex Nut
|
||||
// Hex nut for the screws in the pipe flange assembly.
|
||||
|
||||
// set units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// import constants
|
||||
import hexNutDiameter, hexNutFlatToFlat, hexNutThickness, hexNutFlatLength from "globals.kcl"
|
||||
// Import parameters
|
||||
import hexNutDiameter, hexNutFlatToFlat, hexNutThickness, hexNutFlatLength from "parameters.kcl"
|
||||
|
||||
// create a function to make the hex nut
|
||||
// Create a function to make the hex nut. Must be a function since multiple hex nuts are used
|
||||
export fn hexNut() {
|
||||
// create the base of the hex nut
|
||||
// Create the base of the hex nut
|
||||
hexNutBase = startSketchOn(XY)
|
||||
|> startProfileAt([
|
||||
hexNutFlatToFlat / 2,
|
||||
@ -38,7 +38,7 @@ export fn hexNut() {
|
||||
|> close()
|
||||
|> extrude(length = hexNutThickness)
|
||||
|
||||
// create the hole in the center of the hex nut
|
||||
// Create the hole in the center of the hex nut
|
||||
hexNut = startSketchOn(hexNutBase, 'end')
|
||||
|> circle(center = [0, 0], radius = hexNutDiameter / 2)
|
||||
|> extrude(%, length = -hexNutThickness)
|
||||
@ -46,4 +46,3 @@ export fn hexNut() {
|
||||
|
||||
return hexNut
|
||||
}
|
||||
// https://www.mcmaster.com/95479A127/
|
||||
|
@ -1,20 +1,20 @@
|
||||
// 98017A257 Washer
|
||||
// washer for the screws in the pipe flange assembly.
|
||||
// Washer for the screws in the pipe flange assembly.
|
||||
|
||||
// set units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// import constants
|
||||
import washerInnerDia, washerOuterDia, washerThickness from "globals.kcl"
|
||||
// Import parameters
|
||||
import washerInnerDia, washerOuterDia, washerThickness from "parameters.kcl"
|
||||
|
||||
// create a function to make the washer
|
||||
// Create a function to make the washer. Must be a function since multiple washers are used.
|
||||
export fn washer() {
|
||||
// create the base of the washer
|
||||
// Create the base of the washer
|
||||
washerBase = startSketchOn(XY)
|
||||
|> circle(center = [0, 0], radius = washerOuterDia / 2)
|
||||
|> extrude(length = washerThickness)
|
||||
|
||||
// extrude a hole through the washer
|
||||
// Extrude a hole through the washer
|
||||
washer = startSketchOn(washerBase, 'end')
|
||||
|> circle(center = [0, 0], radius = washerInnerDia / 2)
|
||||
|> extrude(%, length = -washerThickness)
|
||||
@ -22,5 +22,3 @@ export fn washer() {
|
||||
|
||||
return washer
|
||||
}
|
||||
|
||||
// https://www.mcmaster.com/98017A257/
|
||||
|
@ -1,31 +1,31 @@
|
||||
// Pipe and Flange Assembly
|
||||
// A crucial component in various piping systems, designed to facilitate the connection, disconnection, and access to piping for inspection, cleaning, and modifications. This assembly combines pipes (long cylindrical conduits) with flanges (plate-like fittings) to create a secure yet detachable joint.
|
||||
|
||||
// set units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// import constants
|
||||
import * from "globals.kcl"
|
||||
// Import parameters
|
||||
import * from "parameters.kcl"
|
||||
|
||||
// import parts
|
||||
// Import parts
|
||||
import "9472k188-gasket.kcl" as gasket
|
||||
import flange from "68095k348-flange.kcl"
|
||||
import gasket from "9472k188-gasket.kcl"
|
||||
import washer from "98017a257-washer.kcl"
|
||||
import bolt from "91251a404-bolt.kcl"
|
||||
import hexNut from "95479a127-hex-nut.kcl"
|
||||
import pipe from "1120t74-pipe.kcl"
|
||||
|
||||
// place flanges
|
||||
// Place flanges
|
||||
flange()
|
||||
flange()
|
||||
|> rotate(axis = [0, 1, 0], angle = 180)
|
||||
|> translate(x = 0, y = 0, z = flangeBackHeight * 2 + gasketThickness)
|
||||
|
||||
// place gasket between the flanges
|
||||
gasket()
|
||||
// Place gasket between the flanges
|
||||
gasket
|
||||
|> translate(x = 0, y = 0, z = -flangeBackHeight - gasketThickness)
|
||||
|
||||
// place eight washers (four front, four back)
|
||||
// Place eight washers (four front, four back)
|
||||
washer()
|
||||
|> translate(x = mountingHolePlacementDiameter / 2, y = 0, z = flangeBaseThickness)
|
||||
|> patternCircular3d(
|
||||
@ -43,7 +43,7 @@ washer()
|
||||
axis = [0, 0, 1],
|
||||
)
|
||||
|
||||
// place four bolts
|
||||
// Place four bolts
|
||||
bolt()
|
||||
|> translate(x = mountingHolePlacementDiameter / 2, y = 0, z = flangeBaseThickness + washerThickness)
|
||||
|> rotate(roll = 90, pitch = 0, yaw = 0)
|
||||
@ -56,7 +56,7 @@ bolt()
|
||||
rotateDuplicates = false,
|
||||
)
|
||||
|
||||
// place four hex nuts
|
||||
// Place four hex nuts
|
||||
hexNut()
|
||||
|> translate(x = mountingHolePlacementDiameter / 2, y = 0, z = -(flangeBackHeight * 2 + gasketThickness + flangeBaseThickness + washerThickness + hexNutThickness))
|
||||
|> patternCircular3d(
|
||||
@ -68,7 +68,7 @@ hexNut()
|
||||
rotateDuplicates = false,
|
||||
)
|
||||
|
||||
// place both pieces of pipe
|
||||
// Place both pieces of pipe
|
||||
pipe()
|
||||
|> rotate(
|
||||
%,
|
||||
|
@ -1,9 +1,9 @@
|
||||
// Globals
|
||||
// Parameters
|
||||
|
||||
// set units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// flange (68095K348)
|
||||
// Flange (68095K348)
|
||||
export pipeDiameter = 2.440
|
||||
export mountingHoleDiameter = 0.750
|
||||
export mountingHolePlacementDiameter = 4.750
|
||||
@ -17,12 +17,12 @@ export flangeBaseThickness = flangeTotalThickness - flangeBackHeight - flangeFro
|
||||
export flangeBackDiameter = 3.620
|
||||
export flangeFrontDiameter = 3.060
|
||||
|
||||
// washer (98017A257)
|
||||
// Washer (98017A257)
|
||||
export washerInnerDia = 0.640
|
||||
export washerOuterDia = 1.188
|
||||
export washerThickness = 0.032
|
||||
|
||||
// bolt (91251A404)
|
||||
// Bolt (91251A404)
|
||||
export boltDiameter = 0.625
|
||||
export boltLength = 2.500
|
||||
export boltHeadLength = boltDiameter
|
||||
@ -31,18 +31,18 @@ export boltHexDrive = 1 / 2
|
||||
export boltHexFlatLength = boltHexDrive / (2 * cos(toRadians(30)))
|
||||
export boltThreadLength = 1.750
|
||||
|
||||
// hex nut (95479A127)
|
||||
// Hex nut (95479A127)
|
||||
export hexNutDiameter = 5 / 8
|
||||
export hexNutFlatToFlat = 15 / 16
|
||||
export hexNutThickness = 35 / 64
|
||||
export hexNutFlatLength = hexNutFlatToFlat / (2 * cos(toRadians(30)))
|
||||
|
||||
// gasket (9472K188)
|
||||
// Gasket (9472K188)
|
||||
export gasketOutsideDiameter = 4.125
|
||||
export gasketInnerDiameter = 2.375
|
||||
export gasketThickness = 0.031
|
||||
|
||||
// pipe (1120T74)
|
||||
// Pipe (1120T74)
|
||||
export pipeInnerDiameter = 2.0
|
||||
export pipeOuterDiameter = 2.375
|
||||
export pipeLength = 6
|
@ -4,24 +4,24 @@
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Define constants
|
||||
// Define parameters
|
||||
innerDiameter = 10
|
||||
outerDiameter = 20
|
||||
bendRadius = 30
|
||||
bendAngle = 90
|
||||
|
||||
// create a sketch in the 'XZ' plane
|
||||
// Create a sketch in the 'XZ' plane
|
||||
sketch000 = startSketchOn(XZ)
|
||||
|
||||
// create a profile for the outer diameter
|
||||
// Create a profile for the outer diameter
|
||||
outerProfile = circle(sketch000, center = [bendRadius, 0], radius = outerDiameter / 2)
|
||||
|
||||
// create a profile for the inner diameter
|
||||
// Create a profile for the inner diameter
|
||||
innerProfile = circle(sketch000, center = [bendRadius, 0], radius = innerDiameter / 2)
|
||||
|
||||
// create the profile of the pipe
|
||||
// Create the profile of the pipe
|
||||
pipeProfile = outerProfile
|
||||
|> hole(innerProfile, %)
|
||||
|
||||
// revolve the pipe profile at the desired angle
|
||||
// Revolve the pipe profile at the desired angle
|
||||
pipe = revolve(pipeProfile, axis = Y, angle = bendAngle)
|
||||
|
@ -1,36 +1,21 @@
|
||||
// Pipe
|
||||
// A tubular section or hollow cylinder, usually but not necessarily of circular cross-section, used mainly to convey substances that can flow.
|
||||
// Piping for the pipe flange assembly
|
||||
|
||||
// Set Units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Define constants
|
||||
pipeTotalLength = 20
|
||||
pipeLargeDiaLength = 1
|
||||
pipeLargeDia = 1
|
||||
pipeSmallDia = .75
|
||||
thickness = 0.125
|
||||
pipeTransitionAngle = 60
|
||||
pipeTransitionLength = 0.5
|
||||
pipeSmallDiaLength = pipeTotalLength - pipeTransitionLength - pipeLargeDiaLength
|
||||
// Define parameters
|
||||
pipeInnerDiameter = 2.0
|
||||
pipeOuterDiameter = 2.375
|
||||
pipeLength = 6
|
||||
|
||||
// Create the sketch to be revolved around the y-axis. Use the small diameter, large diameter, length, and thickness to define the sketch.
|
||||
pipeSketch = startSketchOn(XY)
|
||||
|> startProfileAt([pipeSmallDia - (thickness / 2), 38], %)
|
||||
|> line(end = [thickness, 0])
|
||||
|> line(end = [0, -pipeSmallDiaLength])
|
||||
|> angledLineOfYLength({
|
||||
angle = -60,
|
||||
length = pipeTransitionLength
|
||||
}, %)
|
||||
|> line(end = [0, -pipeLargeDiaLength])
|
||||
|> xLine(length = -thickness)
|
||||
|> line(end = [0, pipeLargeDiaLength])
|
||||
|> angledLineToX({
|
||||
angle = -pipeTransitionAngle + 180,
|
||||
to = pipeSmallDia - (thickness / 2)
|
||||
}, %)
|
||||
|> close()
|
||||
// Create the pipe base
|
||||
pipeBase = startSketchOn(XZ)
|
||||
|> circle(%, center = [0, 0], radius = pipeOuterDiameter / 2)
|
||||
|> extrude(%, length = pipeLength)
|
||||
|
||||
// Revolve the sketch to create the pipe
|
||||
pipe = revolve(pipeSketch, axis = Y)
|
||||
// Extrude a hole through the length of the pipe
|
||||
pipe = startSketchOn(pipeBase, 'end')
|
||||
|> circle(center = [0, 0], radius = pipeInnerDiameter / 2)
|
||||
|> extrude(%, length = -pipeLength)
|
||||
|> appearance(color = "#a24ed0")
|
||||
|
@ -4,6 +4,7 @@
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Define parameters
|
||||
wallThickness = 0.125
|
||||
wallsWidth = 3
|
||||
height = 5.125
|
||||
@ -12,6 +13,7 @@ backLength = 6
|
||||
exitHeight = 1
|
||||
frontLength = 7
|
||||
|
||||
// Create the curved portion that catches the printer poop
|
||||
sketch001 = startSketchOn(-YZ)
|
||||
|> startProfileAt([wallsWidth / 2, 0], %)
|
||||
|> xLine(length = wallThickness / 2)
|
||||
@ -78,6 +80,7 @@ sketch003 = startSketchOn(customPlane)
|
||||
|> close()
|
||||
|> extrude(length = wallThickness)
|
||||
|
||||
// Create the right side wall of the tub
|
||||
sketch004 = startSketchOn(sketch002, 'END')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> yLine(endAbsolute = height)
|
||||
|
@ -1,18 +1,23 @@
|
||||
// Router template for a cross bar
|
||||
// A guide for routing a notch into a cross bar.
|
||||
|
||||
// Set Units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = mm)
|
||||
|
||||
// Define parameters
|
||||
routerDiameter = 12.7
|
||||
templateDiameter = 11 / 16 * inch()
|
||||
templateGap = (templateDiameter - routerDiameter) / 2 - 0.5
|
||||
slateWidthHalf = 41.5 / 2
|
||||
minClampingDistance = 50 + 30
|
||||
templateThickness = 10
|
||||
radius = 10
|
||||
depth = 30
|
||||
|
||||
// Calculated parameters
|
||||
templateGap = (templateDiameter - routerDiameter) / 2 - 0.5
|
||||
distanceToInsideEdge = slateWidthHalf + templateThickness + templateGap
|
||||
|
||||
// Create the first sketch
|
||||
sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([0, depth + templateGap], %)
|
||||
|> xLine(length = slateWidthHalf - radius, tag = $seg01)
|
||||
@ -44,9 +49,12 @@ sketch001 = startSketchOn(XZ)
|
||||
}, %)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
|
||||
// Extrude the first sketch
|
||||
extrude001 = extrude(sketch001, length = 5)
|
||||
|
||||
sketch003 = startSketchOn(extrude001, 'START')
|
||||
// Create the second sketch
|
||||
sketch002 = startSketchOn(extrude001, 'START')
|
||||
|> startProfileAt([distanceToInsideEdge, 0], %)
|
||||
|> angledLine([180, templateThickness], %, $rectangleSegmentA002)
|
||||
|> angledLine([
|
||||
@ -59,9 +67,12 @@ sketch003 = startSketchOn(extrude001, 'START')
|
||||
], %, $rectangleSegmentC002)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
extrude003 = extrude(sketch003, length = 13)
|
||||
|
||||
sketch002 = startSketchOn(extrude001, 'START')
|
||||
// Extrude the second sketch
|
||||
extrude002 = extrude(sketch002, length = 13)
|
||||
|
||||
// Create the third sketch
|
||||
sketch003 = startSketchOn(extrude001, 'START')
|
||||
|> startProfileAt([-distanceToInsideEdge, 0], %)
|
||||
|> angledLine([0, templateThickness], %, $rectangleSegmentA001)
|
||||
|> angledLine([
|
||||
@ -75,8 +86,10 @@ sketch002 = startSketchOn(extrude001, 'START')
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
|
||||
extrude002 = extrude(sketch002, length = 13)
|
||||
// Extrude the third sketch
|
||||
extrude003 = extrude(sketch003, length = 13)
|
||||
|
||||
// Create the fourth sketch
|
||||
sketch004 = startSketchOn(extrude002, 'END')
|
||||
|> startProfileAt([-distanceToInsideEdge, 0], %)
|
||||
|> angledLine([0, distanceToInsideEdge * 2], %, $rectangleSegmentA003)
|
||||
@ -90,4 +103,6 @@ sketch004 = startSketchOn(extrude002, 'END')
|
||||
], %, $rectangleSegmentC003)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
|
||||
// Extrude the fourth sketch
|
||||
extrude004 = extrude(sketch004, length = 4)
|
||||
|
@ -1,18 +1,20 @@
|
||||
// Router template for a slate
|
||||
// Router Template for a Slate
|
||||
// A guide for routing a slate for a cross bar.
|
||||
|
||||
// Set Units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = mm)
|
||||
|
||||
// Define constants
|
||||
// Define parameters
|
||||
routerDiameter = 12.7
|
||||
templateDiameter = 11 / 16 * inch()
|
||||
templateGap = (templateDiameter - routerDiameter) / 2 - 0.5
|
||||
slateWidthHalf = 41.5 / 2
|
||||
minClampingDistance = 50 + 30
|
||||
templateThickness = 10
|
||||
radius = 10
|
||||
depth = 30
|
||||
|
||||
// Calculated parameters
|
||||
templateGap = (templateDiameter - routerDiameter) / 2 - 0.5
|
||||
length001 = slateWidthHalf - radius
|
||||
length002 = depth + minClampingDistance
|
||||
|
||||
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 87 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 104 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 57 KiB |
@ -1,7 +1,7 @@
|
||||
// Sheet Metal Bracket
|
||||
// A component typically made from flat sheet metal through various manufacturing processes such as bending, punching, cutting, and forming. These brackets are used to support, attach, or mount other hardware components, often providing a structural or functional base for assembly.
|
||||
|
||||
// Set Units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// Input bolt pattern dimensions to mount the bracket
|
||||
@ -14,13 +14,13 @@ componentBoltDiameter = 3 / 16
|
||||
componentBoltPatternX = 2
|
||||
componentBoltPatternY = 3
|
||||
|
||||
// Define bracket constants such as sheet metal thickness, bend radius, flange length, etc.
|
||||
// Define bracket parameters such as sheet metal thickness, bend radius, flange length, etc.
|
||||
hatHeight = 2.5
|
||||
bendAngle = 75
|
||||
thickness = 0.125
|
||||
interiorBendRadius = 0.125
|
||||
|
||||
// Calculate Remaining Parameters
|
||||
// Calculate remaining parameters
|
||||
exteriorBendRadius = interiorBendRadius + thickness
|
||||
overhang = 3 * mountingBoltDiameter
|
||||
flangeLength = 6 * mountingBoltDiameter
|
||||
|
@ -1,58 +1,53 @@
|
||||
// Socket Head Cap Screw
|
||||
// This is for a #10-24 screw that is 1.00 inches long. A socket head cap screw is a type of fastener that is widely used in a variety of applications requiring a high strength fastening solution. It is characterized by its cylindrical head and internal hexagonal drive, which allows for tightening with an Allen wrench or hex key.
|
||||
|
||||
// set units
|
||||
@settings(defaultLengthUnit = in, defaultAngleUnit = deg)
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
export boltDiameter = 0.190
|
||||
export boltLength = 1.0
|
||||
export boltHeadLength = boltDiameter
|
||||
export boltHeadDiameter = 0.313
|
||||
export boltHexDrive = 5 / 32
|
||||
export boltHexFlatLength = boltHexDrive / (2 * cos(toRadians(30)))
|
||||
// Define parameters
|
||||
boltDiameter = 0.190
|
||||
boltLength = 1.0
|
||||
boltHeadLength = boltDiameter
|
||||
boltHeadDiameter = 0.313
|
||||
boltHexDrive = 5 / 32
|
||||
boltHexFlatLength = boltHexDrive / (2 * cos(toRadians(30)))
|
||||
|
||||
export fn bolt() {
|
||||
// Create the head of the cap screw
|
||||
boltHead = startSketchOn(XZ)
|
||||
|> circle(center = [0, 0], radius = boltHeadDiameter / 2, tag = $topEdge)
|
||||
|> extrude(length = -boltHeadLength)
|
||||
|> fillet(radius = 0.020, tags = [topEdge, getOppositeEdge(topEdge)])
|
||||
// Create the head of the cap screw
|
||||
boltHead = startSketchOn(XZ)
|
||||
|> circle(center = [0, 0], radius = boltHeadDiameter / 2, tag = $topEdge)
|
||||
|> extrude(length = -boltHeadLength)
|
||||
|> fillet(radius = 0.020, tags = [topEdge, getOppositeEdge(topEdge)])
|
||||
|
||||
// Define the sketch of the hex pattern on the screw head
|
||||
hexPatternSketch = startSketchOn(boltHead, 'start')
|
||||
|> startProfileAt([
|
||||
boltHexDrive / 2,
|
||||
boltHexFlatLength / 2
|
||||
], %)
|
||||
|> angledLine({
|
||||
angle = 270,
|
||||
length = boltHexFlatLength
|
||||
}, %)
|
||||
|> angledLine({
|
||||
angle = 210,
|
||||
length = boltHexFlatLength
|
||||
}, %)
|
||||
|> angledLine({
|
||||
angle = 150,
|
||||
length = boltHexFlatLength
|
||||
}, %)
|
||||
|> angledLine({
|
||||
angle = 90,
|
||||
length = boltHexFlatLength
|
||||
}, %)
|
||||
|> angledLine({
|
||||
angle = 30,
|
||||
length = boltHexFlatLength
|
||||
}, %)
|
||||
|> close()
|
||||
|> extrude(length = -boltHeadLength * 0.75)
|
||||
boltBody = startSketchOn(boltHead, 'end')
|
||||
|> circle(center = [0, 0], radius = boltDiameter / 2, tag = $filletEdge)
|
||||
|> extrude(length = boltLength)
|
||||
|> fillet(radius = .020, tags = [getOppositeEdge(filletEdge)])
|
||||
|> appearance(color = "#4dd043", metalness = 90, roughness = 90)
|
||||
|
||||
return boltBody
|
||||
}
|
||||
|
||||
bolt()
|
||||
// Define the sketch of the hex pattern on the screw head
|
||||
hexPatternSketch = startSketchOn(boltHead, 'start')
|
||||
|> startProfileAt([
|
||||
boltHexDrive / 2,
|
||||
boltHexFlatLength / 2
|
||||
], %)
|
||||
|> angledLine({
|
||||
angle = 270,
|
||||
length = boltHexFlatLength
|
||||
}, %)
|
||||
|> angledLine({
|
||||
angle = 210,
|
||||
length = boltHexFlatLength
|
||||
}, %)
|
||||
|> angledLine({
|
||||
angle = 150,
|
||||
length = boltHexFlatLength
|
||||
}, %)
|
||||
|> angledLine({
|
||||
angle = 90,
|
||||
length = boltHexFlatLength
|
||||
}, %)
|
||||
|> angledLine({
|
||||
angle = 30,
|
||||
length = boltHexFlatLength
|
||||
}, %)
|
||||
|> close()
|
||||
|> extrude(length = -boltHeadLength * 0.75)
|
||||
boltBody = startSketchOn(boltHead, 'end')
|
||||
|> circle(center = [0, 0], radius = boltDiameter / 2, tag = $filletEdge)
|
||||
|> extrude(length = boltLength)
|
||||
|> fillet(radius = .020, tags = [getOppositeEdge(filletEdge)])
|
||||
|> appearance(color = "#4dd043", metalness = 90, roughness = 90)
|
||||
|
@ -1,35 +1,32 @@
|
||||
// Walkie talkie antenna
|
||||
// antenna for the walkie talkie assembly
|
||||
// Walkie Talkie Antenna
|
||||
// Antenna for the walkie talkie assembly
|
||||
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// import constants
|
||||
import antennaLength, antennaBaseWidth, antennaBaseHeight, antennaTopWidth, antennaTopHeight from "globals.kcl"
|
||||
// Import parameters
|
||||
import antennaLength, antennaBaseWidth, antennaBaseHeight, antennaTopWidth, antennaTopHeight from "parameters.kcl"
|
||||
|
||||
export fn antenna() {
|
||||
// Create the antenna base sketch
|
||||
sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line(end = [antennaBaseWidth, 0])
|
||||
|> line(end = [0, -antennaBaseHeight])
|
||||
|> line(end = [-antennaBaseWidth, 0])
|
||||
|> close()
|
||||
// Create the antenna base sketch
|
||||
antennaBaseSketch = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line(end = [antennaBaseWidth, 0])
|
||||
|> line(end = [0, -antennaBaseHeight])
|
||||
|> line(end = [-antennaBaseWidth, 0])
|
||||
|> close()
|
||||
|
||||
// Create the antenna top sketch
|
||||
loftPlane = offsetPlane(XY, offset = antennaLength)
|
||||
sketch002 = startSketchOn(loftPlane)
|
||||
|> startProfileAt([
|
||||
(antennaBaseWidth - antennaTopWidth) / 2,
|
||||
(antennaBaseHeight - antennaTopHeight) / 2
|
||||
], %)
|
||||
|> xLine(length = antennaTopWidth)
|
||||
|> yLine(length = -antennaTopHeight)
|
||||
|> xLine(length = -antennaTopWidth)
|
||||
|> close()
|
||||
// Create the antenna top sketch
|
||||
loftPlane = offsetPlane(XY, offset = antennaLength)
|
||||
antennaTopSketch = startSketchOn(loftPlane)
|
||||
|> startProfileAt([
|
||||
(antennaBaseWidth - antennaTopWidth) / 2,
|
||||
(antennaBaseHeight - antennaTopHeight) / 2
|
||||
], %)
|
||||
|> xLine(length = antennaTopWidth)
|
||||
|> yLine(length = -antennaTopHeight)
|
||||
|> xLine(length = -antennaTopWidth)
|
||||
|> close()
|
||||
|
||||
// Create the antenna using a loft
|
||||
antenna = loft([sketch001, sketch002])
|
||||
|> appearance(color = "#000000")
|
||||
return antenna
|
||||
}
|
||||
// Create the antenna using a loft
|
||||
loft([antennaBaseSketch, antennaTopSketch])
|
||||
|> appearance(color = "#000000")
|
||||
|
@ -1,84 +1,78 @@
|
||||
// Walkie talkie body
|
||||
// the main body of the walkie talkie assembly
|
||||
// Walkie Talkie Body
|
||||
// The main body of the walkie talkie assembly
|
||||
|
||||
// set units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// import constants
|
||||
import height, width, thickness, chamferLength, offset, screenWidth, screenHeight, screenYPosition, screenDepth, speakerBoxWidth, speakerBoxHeight from "globals.kcl"
|
||||
// Import parameters
|
||||
import height, width, thickness, chamferLength, offset, screenWidth, screenHeight, screenYPosition, screenDepth, speakerBoxWidth, speakerBoxHeight from "parameters.kcl"
|
||||
|
||||
// create a function to define the body
|
||||
export fn body() {
|
||||
// sketch and extrude the body of the walkie talkie
|
||||
bodySketch = startSketchOn(XZ)
|
||||
|> startProfileAt([-width / 2, height / 2], %)
|
||||
|> xLine(length = width, tag = $chamfer1)
|
||||
|> yLine(length = -height, tag = $chamfer2)
|
||||
|> xLine(length = -width, tag = $chamfer3)
|
||||
|> close(tag = $chamfer4)
|
||||
bodyExtrude = extrude(bodySketch, length = thickness)
|
||||
|> chamfer(
|
||||
length = chamferLength,
|
||||
tags = [
|
||||
getNextAdjacentEdge(chamfer1),
|
||||
getNextAdjacentEdge(chamfer2),
|
||||
getNextAdjacentEdge(chamfer3),
|
||||
getNextAdjacentEdge(chamfer4)
|
||||
],
|
||||
)
|
||||
// Sketch and extrude the body of the walkie talkie
|
||||
body = startSketchOn(XZ)
|
||||
|> startProfileAt([-width / 2, height / 2], %)
|
||||
|> xLine(length = width, tag = $chamfer1)
|
||||
|> yLine(length = -height, tag = $chamfer2)
|
||||
|> xLine(length = -width, tag = $chamfer3)
|
||||
|> close(tag = $chamfer4)
|
||||
|> extrude(%, length = thickness)
|
||||
|> chamfer(
|
||||
length = chamferLength,
|
||||
tags = [
|
||||
getNextAdjacentEdge(chamfer1),
|
||||
getNextAdjacentEdge(chamfer2),
|
||||
getNextAdjacentEdge(chamfer3),
|
||||
getNextAdjacentEdge(chamfer4)
|
||||
],
|
||||
)
|
||||
|
||||
// cut out the indentation for the case
|
||||
sketch002 = startSketchOn(bodyExtrude, 'END')
|
||||
|> startProfileAt([
|
||||
-width / 2 + offset,
|
||||
height / 2 - (chamferLength + offset / 2 * cos(toRadians(45)))
|
||||
], %)
|
||||
|> angledLineToY({ angle = 45, to = height / 2 - offset }, %)
|
||||
|> line(endAbsolute = [
|
||||
width / 2 - (chamferLength + offset / 2 * cos(toRadians(45))),
|
||||
height / 2 - offset
|
||||
])
|
||||
|> angledLineToX({ angle = -45, to = width / 2 - offset }, %)
|
||||
|> line(endAbsolute = [
|
||||
width / 2 - offset,
|
||||
-(height / 2 - (chamferLength + offset / 2 * cos(toRadians(45))))
|
||||
])
|
||||
|> angledLineToY({
|
||||
angle = -135,
|
||||
to = -height / 2 + offset
|
||||
}, %)
|
||||
|> line(endAbsolute = [
|
||||
-(width / 2 - (chamferLength + offset / 2 * cos(toRadians(45)))),
|
||||
-height / 2 + offset
|
||||
])
|
||||
|> angledLineToX({
|
||||
angle = -225,
|
||||
to = -width / 2 + offset
|
||||
}, %)
|
||||
|> close()
|
||||
extrude002 = extrude(sketch002, length = -0.0625)
|
||||
// Cut out the indentation for the case
|
||||
caseIndentSketch = startSketchOn(body, 'END')
|
||||
|> startProfileAt([
|
||||
-width / 2 + offset,
|
||||
height / 2 - (chamferLength + offset / 2 * cos(toRadians(45)))
|
||||
], %)
|
||||
|> angledLineToY({ angle = 45, to = height / 2 - offset }, %)
|
||||
|> line(endAbsolute = [
|
||||
width / 2 - (chamferLength + offset / 2 * cos(toRadians(45))),
|
||||
height / 2 - offset
|
||||
])
|
||||
|> angledLineToX({ angle = -45, to = width / 2 - offset }, %)
|
||||
|> line(endAbsolute = [
|
||||
width / 2 - offset,
|
||||
-(height / 2 - (chamferLength + offset / 2 * cos(toRadians(45))))
|
||||
])
|
||||
|> angledLineToY({
|
||||
angle = -135,
|
||||
to = -height / 2 + offset
|
||||
}, %)
|
||||
|> line(endAbsolute = [
|
||||
-(width / 2 - (chamferLength + offset / 2 * cos(toRadians(45)))),
|
||||
-height / 2 + offset
|
||||
])
|
||||
|> angledLineToX({
|
||||
angle = -225,
|
||||
to = -width / 2 + offset
|
||||
}, %)
|
||||
|> close()
|
||||
extrude002 = extrude(caseIndentSketch, length = -0.0625)
|
||||
|
||||
// Create the pocket for the screen
|
||||
sketch003 = startSketchOn(extrude002, 'start')
|
||||
|> startProfileAt([-screenWidth / 2, screenYPosition], %)
|
||||
|> xLine(length = screenWidth, tag = $seg01)
|
||||
|> yLine(length = -screenHeight)
|
||||
|> xLine(length = -segLen(seg01))
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
extrude003 = extrude(sketch003, length = screenDepth)
|
||||
// Create the pocket for the screen
|
||||
screenCutout = startSketchOn(extrude002, 'start')
|
||||
|> startProfileAt([-screenWidth / 2, screenYPosition], %)
|
||||
|> xLine(length = screenWidth, tag = $seg01)
|
||||
|> yLine(length = -screenHeight)
|
||||
|> xLine(length = -segLen(seg01))
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
extrude003 = extrude(screenCutout, length = screenDepth)
|
||||
|
||||
// Create the speaker box
|
||||
sketch004 = startSketchOn(extrude002, 'start')
|
||||
|> startProfileAt([-1.25 / 2, -.125], %)
|
||||
|> xLine(length = speakerBoxWidth)
|
||||
|> yLine(length = -speakerBoxHeight)
|
||||
|> xLine(length = -speakerBoxWidth)
|
||||
|> close()
|
||||
// Create the speaker box
|
||||
speakerBox = startSketchOn(extrude002, 'start')
|
||||
|> startProfileAt([-1.25 / 2, -.125], %)
|
||||
|> xLine(length = speakerBoxWidth)
|
||||
|> yLine(length = -speakerBoxHeight)
|
||||
|> xLine(length = -speakerBoxWidth)
|
||||
|> close()
|
||||
|
||||
body = extrude(sketch004, length = -.5)
|
||||
|> appearance(color = "#277bb0")
|
||||
return body
|
||||
}
|
||||
|
||||
body()
|
||||
extrude(speakerBox, length = -.5)
|
||||
|> appearance(color = "#277bb0")
|
||||
|
@ -1,21 +1,24 @@
|
||||
// Walkie Talkie button
|
||||
// Walkie Talkie Button
|
||||
// Button for the walkie talkie
|
||||
|
||||
// set units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// import constants
|
||||
import buttonWidth, buttonHeight, buttonThickness from "globals.kcl"
|
||||
// Import parameters
|
||||
import buttonWidth, buttonHeight, buttonThickness from "parameters.kcl"
|
||||
|
||||
// Create a function for the button. We need to create a function to use multiple buttons.
|
||||
|
||||
|
||||
// create a function to define the button
|
||||
export fn button() {
|
||||
// sketch the button profile and extrude
|
||||
// Sketch the button profile and extrude
|
||||
buttonSketch = startSketchOn(XZ)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> angledLine({ angle = 180, length = buttonWidth }, %, $tag1)
|
||||
|> angledLine({ angle = 270, length = buttonHeight }, %, $tag2)
|
||||
|> angledLine({ angle = 0, length = buttonWidth }, %)
|
||||
|> close()
|
||||
buttonExtrude = extrude(buttonSketch, length = buttonThickness)
|
||||
button = extrude(buttonSketch, length = buttonThickness)
|
||||
|> chamfer(
|
||||
length = .050,
|
||||
tags = [
|
||||
@ -25,5 +28,5 @@ export fn button() {
|
||||
)
|
||||
|> appearance(color = "#ff0000")
|
||||
|
||||
return buttonExtrude
|
||||
return button
|
||||
}
|
||||
|
@ -1,88 +1,83 @@
|
||||
// Walkie talkie case
|
||||
// the plastic case for the front of the walkie talkie
|
||||
// Walkie Talkie Case
|
||||
// The plastic case for the front of the walkie talkie
|
||||
|
||||
// set units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// import constants and Zoo logo
|
||||
import width, height, chamferLength, offset, screenWidth, screenHeight, screenYPosition, screenDepth, speakerBoxWidth, speakerBoxHeight, squareHoleSideLength, caseTolerance from "globals.kcl"
|
||||
// Import parameters and Zoo logo
|
||||
import width, height, chamferLength, offset, screenWidth, screenHeight, screenYPosition, screenDepth, speakerBoxWidth, speakerBoxHeight, squareHoleSideLength, caseTolerance from "parameters.kcl"
|
||||
import zLogo, oLogo, oLogo2 from "zoo-logo.kcl"
|
||||
|
||||
// create a function to define the case
|
||||
export fn case() {
|
||||
// sketch the profile of the screen
|
||||
sketch006 = startSketchOn(startSketchOn(XZ))
|
||||
|> startProfileAt([-screenWidth / 2, screenYPosition], %)
|
||||
|> xLine(length = screenWidth)
|
||||
|> yLine(length = -screenHeight)
|
||||
|> xLine(length = -screenWidth)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
// Sketch the profile of the screen
|
||||
screenSketch = startSketchOn(XZ)
|
||||
|> startProfileAt([-screenWidth / 2, screenYPosition], %)
|
||||
|> xLine(length = screenWidth)
|
||||
|> yLine(length = -screenHeight)
|
||||
|> xLine(length = -screenWidth)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
|
||||
// create transform functions for the speaker grid pattern
|
||||
fn transformX(i) {
|
||||
return { translate = [.125 * i, 0] }
|
||||
}
|
||||
fn transformY(i) {
|
||||
return { translate = [0, -.125 * i] }
|
||||
}
|
||||
|
||||
// sketch the square hole grid pattern
|
||||
squareHolePatternSketch = startSketchOn(startSketchOn(XZ))
|
||||
|> startProfileAt([-screenWidth / 2 + .100, 0], %)
|
||||
|> line(end = [squareHoleSideLength / 2, 0])
|
||||
|> line(end = [0, -squareHoleSideLength / 2])
|
||||
|> line(end = [-squareHoleSideLength / 2, 0])
|
||||
|> close()
|
||||
|> patternTransform2d(instances = 13, transform = transformX)
|
||||
|> patternTransform2d(instances = 11, transform = transformY)
|
||||
|
||||
// sketch the outer profile of the case and extrude with holes using the previously made profiles
|
||||
sketch005 = startSketchOn(startSketchOn(XZ))
|
||||
|> startProfileAt([
|
||||
-width / 2 + offset + caseTolerance,
|
||||
height / 2 - (chamferLength + (offset + caseTolerance) / 2 * cos(toRadians(45)))
|
||||
], %)
|
||||
|> angledLineToY({
|
||||
angle = 45,
|
||||
to = height / 2 - (offset + caseTolerance)
|
||||
}, %)
|
||||
|> line(endAbsolute = [
|
||||
width / 2 - (chamferLength + (offset + caseTolerance) / 2 * cos(toRadians(45))),
|
||||
height / 2 - (offset + caseTolerance)
|
||||
])
|
||||
|> angledLineToX({
|
||||
angle = -45,
|
||||
to = width / 2 - (offset + caseTolerance)
|
||||
}, %)
|
||||
|> line(endAbsolute = [
|
||||
width / 2 - (offset + caseTolerance),
|
||||
-(height / 2 - (chamferLength + (offset + caseTolerance) / 2 * cos(toRadians(45))))
|
||||
])
|
||||
|> angledLineToY({
|
||||
angle = -135,
|
||||
to = -height / 2 + offset + caseTolerance
|
||||
}, %)
|
||||
|> line(endAbsolute = [
|
||||
-(width / 2 - (chamferLength + (offset + caseTolerance) / 2 * cos(toRadians(45)))),
|
||||
-height / 2 + offset + caseTolerance
|
||||
])
|
||||
|> angledLineToX({
|
||||
angle = -225,
|
||||
to = -width / 2 + offset + caseTolerance
|
||||
}, %)
|
||||
|> close()
|
||||
|> hole(sketch006, %)
|
||||
|> hole(squareHolePatternSketch, %)
|
||||
|
||||
// create the Zoo logo
|
||||
|> hole(zLogo(startSketchOn(XZ), [-.30, -1.825], .20), %)
|
||||
|> hole(oLogo(startSketchOn(XZ), [-.075, -1.825], .20), %)
|
||||
|> hole(oLogo2(startSketchOn(XZ), [-.075, -1.825], .20), %)
|
||||
|> hole(oLogo(startSketchOn(XZ), [.175, -1.825], .20), %)
|
||||
|> hole(oLogo2(startSketchOn(XZ), [.175, -1.825], .20), %)
|
||||
case = extrude(sketch005, length = -0.0625)
|
||||
|> appearance(color = '#D0FF01', metalness = 0, roughness = 50)
|
||||
|
||||
return case
|
||||
// Create transform functions for the speaker grid pattern
|
||||
fn transformX(i) {
|
||||
return { translate = [.125 * i, 0] }
|
||||
}
|
||||
fn transformY(i) {
|
||||
return { translate = [0, -.125 * i] }
|
||||
}
|
||||
|
||||
// Sketch the square hole grid pattern
|
||||
squareHolePatternSketch = startSketchOn(XZ)
|
||||
|> startProfileAt([-screenWidth / 2 + .100, 0], %)
|
||||
|> line(end = [squareHoleSideLength / 2, 0])
|
||||
|> line(end = [0, -squareHoleSideLength / 2])
|
||||
|> line(end = [-squareHoleSideLength / 2, 0])
|
||||
|> close()
|
||||
|> patternTransform2d(instances = 13, transform = transformX)
|
||||
|> patternTransform2d(instances = 11, transform = transformY)
|
||||
|
||||
// Sketch the outer profile of the case and extrude with holes using the previously made profiles
|
||||
case = startSketchOn(XZ)
|
||||
|> startProfileAt([
|
||||
-width / 2 + offset + caseTolerance,
|
||||
height / 2 - (chamferLength + (offset + caseTolerance) / 2 * cos(toRadians(45)))
|
||||
], %)
|
||||
|> angledLineToY({
|
||||
angle = 45,
|
||||
to = height / 2 - (offset + caseTolerance)
|
||||
}, %)
|
||||
|> line(endAbsolute = [
|
||||
width / 2 - (chamferLength + (offset + caseTolerance) / 2 * cos(toRadians(45))),
|
||||
height / 2 - (offset + caseTolerance)
|
||||
])
|
||||
|> angledLineToX({
|
||||
angle = -45,
|
||||
to = width / 2 - (offset + caseTolerance)
|
||||
}, %)
|
||||
|> line(endAbsolute = [
|
||||
width / 2 - (offset + caseTolerance),
|
||||
-(height / 2 - (chamferLength + (offset + caseTolerance) / 2 * cos(toRadians(45))))
|
||||
])
|
||||
|> angledLineToY({
|
||||
angle = -135,
|
||||
to = -height / 2 + offset + caseTolerance
|
||||
}, %)
|
||||
|> line(endAbsolute = [
|
||||
-(width / 2 - (chamferLength + (offset + caseTolerance) / 2 * cos(toRadians(45)))),
|
||||
-height / 2 + offset + caseTolerance
|
||||
])
|
||||
|> angledLineToX({
|
||||
angle = -225,
|
||||
to = -width / 2 + offset + caseTolerance
|
||||
}, %)
|
||||
|> close()
|
||||
|> hole(screenSketch, %)
|
||||
|> hole(squareHolePatternSketch, %)
|
||||
|
||||
// Create the Zoo logo
|
||||
|> hole(zLogo(startSketchOn(XZ), [-.30, -1.825], .20), %)
|
||||
|> hole(oLogo(startSketchOn(XZ), [-.075, -1.825], .20), %)
|
||||
|> hole(oLogo2(startSketchOn(XZ), [-.075, -1.825], .20), %)
|
||||
|> hole(oLogo(startSketchOn(XZ), [.175, -1.825], .20), %)
|
||||
|> hole(oLogo2(startSketchOn(XZ), [.175, -1.825], .20), %)
|
||||
extrude(case, length = -0.0625)
|
||||
|> appearance(color = '#D0FF01', metalness = 0, roughness = 50)
|
||||
|
@ -1,28 +1,23 @@
|
||||
// Walkie talkie frequency knob
|
||||
// the frequency knob for the walkie talkie assembly
|
||||
// Walkie Talkie Frequency Knob
|
||||
// The frequency knob for the walkie talkie assembly
|
||||
|
||||
// set units
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// import constants
|
||||
import width, thickness, height, knobDiameter, knobHeight, knobRadius from "globals.kcl"
|
||||
// Import parameters
|
||||
import width, thickness, height, knobDiameter, knobHeight, knobRadius from "parameters.kcl"
|
||||
|
||||
// create a function to define the knob
|
||||
export fn knob() {
|
||||
// Create the knob sketch and revolve
|
||||
knob = startSketchOn(XZ)
|
||||
|> startProfileAt([0.0001, 0], %)
|
||||
|> xLine(length = knobDiameter / 2)
|
||||
|> yLine(length = knobHeight - 0.05)
|
||||
|> arc({
|
||||
angleStart = 0,
|
||||
angleEnd = 90,
|
||||
radius = .05
|
||||
}, %)
|
||||
|> xLine(endAbsolute = 0.0001)
|
||||
|> close()
|
||||
|> revolve(axis = Y)
|
||||
|> appearance(color = '#D0FF01', metalness = 90, roughness = 50)
|
||||
|
||||
return knob
|
||||
}
|
||||
// Create the knob sketch and revolve
|
||||
startSketchOn(XZ)
|
||||
|> startProfileAt([0.0001, 0], %)
|
||||
|> xLine(length = knobDiameter / 2)
|
||||
|> yLine(length = knobHeight - 0.05)
|
||||
|> arc({
|
||||
angleStart = 0,
|
||||
angleEnd = 90,
|
||||
radius = .05
|
||||
}, %)
|
||||
|> xLine(endAbsolute = 0.0001)
|
||||
|> close()
|
||||
|> revolve(axis = Y)
|
||||
|> appearance(color = '#D0FF01', metalness = 90, roughness = 50)
|
||||
|
@ -5,36 +5,36 @@
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// import constants
|
||||
import * from "globals.kcl"
|
||||
import * from "parameters.kcl"
|
||||
|
||||
// import parts and constants
|
||||
import body from "body.kcl"
|
||||
import case from "case.kcl"
|
||||
import antenna from "antenna.kcl"
|
||||
import talkButton from "talk-button.kcl"
|
||||
import knob from "knob.kcl"
|
||||
// import parts and parameters
|
||||
import "body.kcl" as body
|
||||
import "case.kcl" as case
|
||||
import "antenna.kcl" as antenna
|
||||
import "talk-button.kcl" as talkButton
|
||||
import "knob.kcl" as knob
|
||||
import button from "button.kcl"
|
||||
|
||||
// import the body
|
||||
body()
|
||||
// Import the body
|
||||
body
|
||||
|
||||
// import the antenna
|
||||
antenna()
|
||||
// Import the antenna
|
||||
antenna
|
||||
|> translate(x = -width / 2 + .45, y = -0.10, z = height / 2)
|
||||
|
||||
// import the case
|
||||
case()
|
||||
// Import the case
|
||||
case
|
||||
|> translate(x = 0, y = -1, z = 0)
|
||||
|
||||
// import the talk button
|
||||
talkButton()
|
||||
// Import the talk button
|
||||
talkButton
|
||||
|> translate(x = width / 2, y = -thickness / 2, z = .5)
|
||||
|
||||
// import the frequency knob
|
||||
knob()
|
||||
// Import the frequency knob
|
||||
knob
|
||||
|> translate(x = width / 2 - 0.70, y = -thickness / 2, z = height / 2)
|
||||
|
||||
// import the buttons
|
||||
// Import the buttons
|
||||
button()
|
||||
|> translate(x = -(screenWidth / 2 + tolerance), y = -1, z = screenYPosition)
|
||||
button()
|
||||
|