-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ac280cb
Showing
9 changed files
with
890 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "saturday" | ||
time: "09:00" | ||
- package-ecosystem: "github-actions" | ||
directory: "/.github/workflows/" | ||
schedule: | ||
interval: "weekly" | ||
day: "saturday" | ||
time: "09:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: "Dependabot Pull Request Approve and Merge" | ||
|
||
on: "pull_request_target" | ||
|
||
permissions: | ||
pull-requests: "write" | ||
contents: "write" | ||
|
||
jobs: | ||
dependabot: | ||
runs-on: "ubuntu-latest" | ||
# Checking the actor will prevent your Action run failing on non-Dependabot | ||
# PRs but also ensures that it only does work for Dependabot PRs. | ||
if: "${{ github.actor == 'dependabot[bot]' }}" | ||
steps: | ||
# This first step will fail if there's no metadata and so the approval | ||
# will not occur. | ||
- name: "Dependabot metadata" | ||
id: "dependabot-metadata" | ||
uses: "dependabot/fetch-metadata@v1" | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
# Here the PR gets approved. | ||
- uses: actions/checkout@v4 | ||
- name: "Approve a PR" | ||
run: "gh pr review --approve $PR_URL" | ||
env: | ||
PR_URL: "${{ github.event.pull_request.html_url }}" | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
# Finally, this sets the PR to allow auto-merging for patch and minor | ||
# updates if all checks pass | ||
- name: "Enable auto-merge for Dependabot PRs" | ||
#if: "${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}" | ||
run: "gh pr merge --auto --squash $PR_URL" | ||
env: | ||
PR_URL: "${{ github.event.pull_request.html_url }}" | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "Main" | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_dispatch: { } | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | ||
permissions: | ||
contents: "read" # to read the repository contents | ||
pull-requests: "read" # to read pull requests | ||
pages: "write" # to deploy to Pages | ||
id-token: "write" # to verify the deployment originates from an appropriate source | ||
|
||
# Deploy to the github-pages environment | ||
environment: | ||
name: "github-pages" | ||
# url: "${{ steps.deployment.outputs.page_url }}" | ||
|
||
steps: | ||
- uses: "actions/checkout@v4" | ||
|
||
- uses: "actions/setup-python@v4" | ||
with: | ||
python-version: "3.11" | ||
cache: "poetry" | ||
|
||
- run: "poetry install" | ||
|
||
- uses: "Yeicor/[email protected]" | ||
with: | ||
scripts: "main.py" | ||
# formats: "STL|STEP|AMF|SVG|TJS|DXF|VRML|VTP|3MF|GLTF" | ||
# website: "." | ||
# website-screenshot: "true" | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/venv/ | ||
/build/ | ||
/.idea/ | ||
/*.iml | ||
/*.stl | ||
/.ocp_vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"emeraldwalk.runonsave": { | ||
"commands": [ | ||
{ | ||
"match": "\\.py$", | ||
"isAsync": false, | ||
"cmd": "poetry run python ${file}" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Boot protector | ||
|
||
You can download the latest builds from the [workflow runs](https://github.com/Yeicor/boot-protector/actions/workflows/main.yml). | ||
|
||
You can preview the model in an interactive demo by clicking the following render of the latest design: | ||
|
||
[![boot-protector.png](https://yeicor.github.io/boot-protector/models/main/boot-protector.png)](https://yeicor.github.io/boot-protector/) | ||
|
||
![boot-protector.svg](https://yeicor.github.io/boot-protector/models/main/boot-protector.svg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from build123d import * | ||
from contextlib import suppress | ||
with suppress(ImportError): import ocp_vscode # Optional, for visualizing the model in VSCode instead of CQ-editor or exporting to STL | ||
|
||
|
||
# ================== PARAMETERS ================== | ||
# 3D printing basics | ||
tol = 0.1 * MM # Tolerance (tighter than usual) | ||
wall_min = 0.4 * MM # Minimum wall width | ||
wall = 3 * wall_min # Recommended width for most walls of this print | ||
eps = 1e-5 * MM # A small number | ||
|
||
# ... | ||
|
||
|
||
# ================== MODELLING ================== | ||
|
||
with BuildPart() as obj: | ||
Box(100*MM, 100*MM, 20*MM) | ||
|
||
# ================== SHOWING/EXPORTING ================== | ||
|
||
export = True | ||
try: | ||
if 'ocp_vscode' in locals(): | ||
import socket | ||
tmp_socket = socket.socket() | ||
tmp_socket.connect(('localhost', ocp_vscode.get_port())) | ||
tmp_socket.close() | ||
ocp_vscode.reset_show() | ||
ocp_vscode.show_all() | ||
export = False # If the connection fails, export to STL instead | ||
elif 'show_object' in locals(): | ||
show_object(obj, 'boot-protector') # type: ignore | ||
except Exception as ex: | ||
print("Cannot show model, exporting to STL instead (%s)" % ex) | ||
|
||
if export: | ||
obj.export_stl('boot-protector.stl') |
Oops, something went wrong.