Compare commits

...

4 Commits

Author SHA1 Message Date
d4217405e1
TEMP build123d framework stuff part 2
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-07-05 17:23:11 -05:00
0dcd1cb5ff
TEMP build123d extremely basic panel demo
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-07-05 17:21:57 -05:00
e63a5da6a2
TEMP build123d framework stuff and test layout
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-07-04 21:58:43 -05:00
82d914c30c
TEMP build123d environment part 1
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-07-02 10:24:13 -05:00
12 changed files with 1799 additions and 0 deletions

5
.gitignore vendored
View File

@ -1,3 +1,8 @@
build/
venv/
*.egg-info/
.tox/
*.pyc
*.sw*
.coverage

2
.pylintrc Normal file
View File

@ -0,0 +1,2 @@
[MESSAGES CONTROL]
disable = W,C,R

53
pyproject.toml Normal file
View File

@ -0,0 +1,53 @@
[build-system]
requires = ["setuptools>=61.0", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"
[project]
name = "buildable-stick-system"
description = "Files for 3D printing an arcade stick."
readme = "README.md"
license = {text = "GPL-3.0-or-later"}
authors = [
{name = "Brian S. Stephan", email = "bss@incorporeal.org"},
]
requires-python = "<3.12,>=3.9"
dependencies = ["build123d"]
dynamic = ["version"]
classifiers = [
# TODO
]
[project.urls]
# TODO
[project.optional-dependencies]
dev = ["bandit", "flake8", "flake8-blind-except", "flake8-builtins", "flake8-docstrings",
"flake8-executable", "flake8-fixme", "flake8-isort", "flake8-logging-format", "flake8-mutable",
"flake8-pyproject", "mypy", "pip-tools", "pytest", "pytest-asyncio", "pytest-cov", "reuse",
"setuptools-scm", "tox", "twine"]
gui = ["cadquery>=2.2", "CQ-Editor@git+https://github.com/jdegenstein/jmwright-CQ-Editor"]
[project.scripts]
# TODO
[tool.flake8]
enable-extensions = "G,M"
exclude = [".tox/", "venv/", "_version.py", "tests/test-files/"]
extend-ignore = "T101"
max-complexity = 10
max-line-length = 120
[tool.isort]
line_length = 120
[tool.mypy]
ignore_missing_imports = true
[tool.pytest]
python_files = ["*_tests.py", "tests.py", "test_*.py"]
[tool.setuptools]
# TODO
[tool.setuptools_scm]
# TODO

View File

@ -0,0 +1,644 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --extra=dev --extra=gui --output-file=requirements/requirements-dev-and-gui.txt
#
alabaster==0.7.16
# via sphinx
anytree==2.12.1
# via build123d
arrow==1.3.0
# via cookiecutter
astroid==3.2.2
# via pylint
asttokens==2.4.1
# via stack-data
atomicwrites==1.4.1
# via spyder
attrs==23.2.0
# via
# jsonschema
# referencing
autopep8==2.0.4
# via python-lsp-server
babel==2.15.0
# via sphinx
backports-tarfile==1.2.0
# via jaraco-context
bandit==1.7.9
# via buildable-stick-system (pyproject.toml)
beautifulsoup4==4.12.3
# via nbconvert
binaryornot==0.4.4
# via
# cookiecutter
# reuse
black==24.4.2
# via python-lsp-black
bleach==6.1.0
# via nbconvert
boolean-py==4.0
# via
# license-expression
# reuse
build==1.2.1
# via pip-tools
build123d==0.4.0
# via buildable-stick-system (pyproject.toml)
cachetools==5.3.3
# via tox
cadquery==2.4.0
# via buildable-stick-system (pyproject.toml)
cadquery-ocp==7.7.2
# via
# build123d
# cadquery
# ocpsvg
casadi==3.6.5
# via cadquery
certifi==2024.6.2
# via requests
cffi==1.16.0
# via cryptography
chardet==5.2.0
# via
# binaryornot
# python-debian
# spyder
# tox
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via
# black
# cookiecutter
# pip-tools
cloudpickle==3.0.0
# via
# spyder
# spyder-kernels
colorama==0.4.6
# via tox
comm==0.2.2
# via ipykernel
cookiecutter==2.6.0
# via spyder
coverage[toml]==7.5.4
# via pytest-cov
cq-editor @ git+https://github.com/jdegenstein/jmwright-CQ-Editor
# via buildable-stick-system (pyproject.toml)
cryptography==42.0.8
# via secretstorage
debugpy==1.8.2
# via ipykernel
decorator==5.1.1
# via ipython
defusedxml==0.7.1
# via nbconvert
diff-match-patch==20230430
# via
# spyder
# three-merge
dill==0.3.8
# via pylint
distlib==0.3.8
# via virtualenv
docstring-to-markdown==0.15
# via python-lsp-server
docutils==0.21.2
# via
# readme-renderer
# sphinx
executing==2.0.1
# via stack-data
ezdxf==1.3.1
# via
# build123d
# cadquery
fastjsonschema==2.20.0
# via nbformat
filelock==3.15.4
# via
# tox
# virtualenv
flake8==7.0.0
# via
# buildable-stick-system (pyproject.toml)
# flake8-builtins
# flake8-docstrings
# flake8-executable
# flake8-isort
# flake8-mutable
# flake8-pyproject
# python-lsp-server
flake8-blind-except==0.2.1
# via buildable-stick-system (pyproject.toml)
flake8-builtins==2.5.0
# via buildable-stick-system (pyproject.toml)
flake8-docstrings==1.7.0
# via buildable-stick-system (pyproject.toml)
flake8-executable==2.1.3
# via buildable-stick-system (pyproject.toml)
flake8-fixme==1.1.1
# via buildable-stick-system (pyproject.toml)
flake8-isort==6.1.1
# via buildable-stick-system (pyproject.toml)
flake8-logging-format==2024.24.12
# via buildable-stick-system (pyproject.toml)
flake8-mutable==1.2.0
# via buildable-stick-system (pyproject.toml)
flake8-pyproject==1.2.3
# via buildable-stick-system (pyproject.toml)
fonttools==4.53.0
# via ezdxf
idna==3.7
# via requests
imagesize==1.4.1
# via sphinx
importlib-metadata==8.0.0
# via
# keyring
# twine
# yapf
inflection==0.5.1
# via qstylizer
iniconfig==2.0.0
# via pytest
intervaltree==3.1.0
# via spyder
ipykernel==6.29.5
# via
# qtconsole
# spyder-kernels
ipython==8.26.0
# via
# build123d
# cq-editor
# ipykernel
# spyder
# spyder-kernels
isort==5.13.2
# via
# flake8-isort
# pylint
jaraco-classes==3.4.0
# via keyring
jaraco-context==5.3.0
# via keyring
jaraco-functools==4.0.1
# via keyring
jedi==0.19.1
# via
# ipython
# python-lsp-server
# spyder
jeepney==0.8.0
# via
# keyring
# secretstorage
jellyfish==1.0.4
# via spyder
jinja2==3.1.4
# via
# cookiecutter
# nbconvert
# reuse
# sphinx
jsonschema==4.22.0
# via
# nbformat
# spyder
jsonschema-specifications==2023.12.1
# via jsonschema
jupyter-client==8.6.2
# via
# ipykernel
# nbclient
# qtconsole
# spyder-kernels
jupyter-core==5.7.2
# via
# ipykernel
# jupyter-client
# nbclient
# nbconvert
# nbformat
# qtconsole
jupyterlab-pygments==0.3.0
# via nbconvert
keyring==25.2.1
# via
# spyder
# twine
license-expression==30.3.0
# via reuse
logbook==1.7.0.post0
# via cq-editor
markdown-it-py==3.0.0
# via rich
markupsafe==2.1.5
# via
# jinja2
# nbconvert
matplotlib-inline==0.1.7
# via
# ipykernel
# ipython
mccabe==0.7.0
# via
# flake8
# pylint
# python-lsp-server
mdurl==0.1.2
# via markdown-it-py
mistune==3.0.2
# via nbconvert
more-itertools==10.3.0
# via
# jaraco-classes
# jaraco-functools
multimethod==1.9.1
# via cadquery
mypy==1.10.1
# via buildable-stick-system (pyproject.toml)
mypy-extensions==1.0.0
# via
# black
# mypy
nbclient==0.10.0
# via nbconvert
nbconvert==7.16.4
# via spyder
nbformat==5.10.4
# via
# nbclient
# nbconvert
nest-asyncio==1.6.0
# via ipykernel
nh3==0.2.17
# via readme-renderer
nlopt==2.7.1
# via cadquery
nptyping==2.0.1
# via cadquery
numpy==1.26.4
# via
# build123d
# casadi
# ezdxf
# nlopt
# nptyping
# numpy-stl
# pyqtgraph
# scipy
# svgpathtools
numpy-stl==3.1.1
# via build123d
numpydoc==1.7.0
# via spyder
ocpsvg==0.2.1
# via build123d
packaging==24.1
# via
# black
# build
# ipykernel
# nbconvert
# pyproject-api
# pytest
# pytoolconfig
# qtconsole
# qtpy
# setuptools-scm
# sphinx
# tox
pandocfilters==1.5.1
# via nbconvert
parso==0.8.4
# via
# jedi
# spyder
path==16.14.0
# via
# cadquery
# cq-editor
pathspec==0.12.1
# via black
pbr==6.0.0
# via stevedore
pexpect==4.9.0
# via
# ipython
# spyder
pickleshare==0.7.5
# via spyder
pip-tools==7.4.1
# via buildable-stick-system (pyproject.toml)
pkginfo==1.10.0
# via twine
platformdirs==4.2.2
# via
# black
# jupyter-core
# pylint
# pytoolconfig
# tox
# virtualenv
# yapf
pluggy==1.5.0
# via
# pytest
# python-lsp-server
# tox
prompt-toolkit==3.0.47
# via ipython
psutil==6.0.0
# via
# ipykernel
# spyder
ptyprocess==0.7.0
# via pexpect
pure-eval==0.2.2
# via stack-data
py-lib3mf==2.3.1
# via build123d
pycodestyle==2.11.1
# via
# autopep8
# flake8
# python-lsp-server
pycparser==2.22
# via cffi
pydocstyle==6.3.0
# via
# flake8-docstrings
# python-lsp-server
pyflakes==3.2.0
# via
# flake8
# python-lsp-server
pygments==2.18.0
# via
# ipython
# nbconvert
# qtconsole
# readme-renderer
# rich
# sphinx
# spyder
pylint==3.2.5
# via
# python-lsp-server
# spyder
pylint-venv==3.0.3
# via spyder
pyls-spyder==0.4.0
# via spyder
pyparsing==3.1.2
# via ezdxf
pyproject-api==1.7.1
# via tox
pyproject-hooks==1.1.0
# via
# build
# pip-tools
pyqt5==5.15.10
# via
# cq-editor
# pyqtwebengine
# spyder
pyqt5-qt5==5.15.14
# via pyqt5
pyqt5-sip==12.13.0
# via
# pyqt5
# pyqtwebengine
pyqtgraph==0.13.7
# via cq-editor
pyqtwebengine==5.15.6
# via spyder
pyqtwebengine-qt5==5.15.14
# via pyqtwebengine
pytest==8.2.2
# via
# buildable-stick-system (pyproject.toml)
# pytest-asyncio
# pytest-cov
pytest-asyncio==0.23.7
# via buildable-stick-system (pyproject.toml)
pytest-cov==5.0.0
# via buildable-stick-system (pyproject.toml)
python-dateutil==2.9.0.post0
# via
# arrow
# jupyter-client
python-debian==0.1.49
# via reuse
python-lsp-black==2.0.0
# via spyder
python-lsp-jsonrpc==1.1.2
# via python-lsp-server
python-lsp-server[all]==1.11.0
# via
# pyls-spyder
# python-lsp-black
# spyder
python-slugify==8.0.4
# via cookiecutter
python-utils==3.8.2
# via numpy-stl
pytoolconfig[global]==1.3.1
# via rope
pyxdg==0.28
# via spyder
pyyaml==6.0.1
# via
# bandit
# cookiecutter
pyzmq==26.0.3
# via
# ipykernel
# jupyter-client
# qtconsole
# spyder
# spyder-kernels
qdarkstyle==3.2.3
# via spyder
qstylizer==0.2.3
# via spyder
qtawesome==1.3.1
# via spyder
qtconsole==5.5.2
# via spyder
qtpy==2.4.1
# via
# qdarkstyle
# qtawesome
# qtconsole
# spyder
readme-renderer==43.0
# via twine
referencing==0.35.1
# via
# jsonschema
# jsonschema-specifications
requests==2.32.3
# via
# cookiecutter
# cq-editor
# requests-toolbelt
# sphinx
# twine
requests-toolbelt==1.0.0
# via twine
reuse==3.0.2
# via buildable-stick-system (pyproject.toml)
rfc3986==2.0.0
# via twine
rich==13.7.1
# via
# bandit
# cookiecutter
# twine
rope==1.13.0
# via python-lsp-server
rpds-py==0.18.1
# via
# jsonschema
# referencing
rtree==1.2.0
# via spyder
scipy==1.14.0
# via svgpathtools
secretstorage==3.3.3
# via keyring
setuptools-scm==8.1.0
# via buildable-stick-system (pyproject.toml)
six==1.16.0
# via
# anytree
# asttokens
# bleach
# python-dateutil
snowballstemmer==2.2.0
# via
# pydocstyle
# sphinx
sortedcontainers==2.4.0
# via intervaltree
soupsieve==2.5
# via beautifulsoup4
sphinx==7.3.7
# via
# numpydoc
# spyder
sphinxcontrib-applehelp==1.0.8
# via sphinx
sphinxcontrib-devhelp==1.0.6
# via sphinx
sphinxcontrib-htmlhelp==2.0.5
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.7
# via sphinx
sphinxcontrib-serializinghtml==1.1.10
# via sphinx
spyder==5.5.5
# via cq-editor
spyder-kernels==2.5.2
# via spyder
stack-data==0.6.3
# via ipython
stevedore==5.2.0
# via bandit
svgelements==1.9.6
# via ocpsvg
svgpathtools==1.6.1
# via
# build123d
# ocpsvg
svgwrite==1.4.3
# via svgpathtools
tabulate==0.9.0
# via numpydoc
text-unidecode==1.3
# via python-slugify
textdistance==4.6.2
# via spyder
three-merge==0.1.1
# via spyder
tinycss2==1.3.0
# via
# nbconvert
# qstylizer
tomli==2.0.1
# via yapf
tomlkit==0.12.5
# via pylint
tornado==6.4.1
# via
# ipykernel
# jupyter-client
tox==4.15.1
# via buildable-stick-system (pyproject.toml)
traitlets==5.14.3
# via
# comm
# ipykernel
# ipython
# jupyter-client
# jupyter-core
# matplotlib-inline
# nbclient
# nbconvert
# nbformat
# qtconsole
trianglesolver==1.2
# via build123d
twine==5.1.1
# via buildable-stick-system (pyproject.toml)
types-python-dateutil==2.9.0.20240316
# via arrow
typing-extensions==4.12.2
# via
# build123d
# ezdxf
# ipython
# mypy
# python-utils
typish==1.9.3
# via cadquery
ujson==5.10.0
# via
# python-lsp-jsonrpc
# python-lsp-server
urllib3==2.2.2
# via
# requests
# twine
virtualenv==20.26.3
# via tox
watchdog==4.0.1
# via spyder
wcwidth==0.2.13
# via prompt-toolkit
webencodings==0.5.1
# via
# bleach
# tinycss2
whatthepatch==1.0.5
# via python-lsp-server
wheel==0.43.0
# via pip-tools
wurlitzer==3.1.1
# via spyder-kernels
yapf==0.40.2
# via python-lsp-server
zipp==3.19.2
# via importlib-metadata
# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools

View File

@ -0,0 +1,295 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --extra=dev --output-file=requirements/requirements-dev.txt
#
anytree==2.12.1
# via build123d
asttokens==2.4.1
# via stack-data
backports-tarfile==1.2.0
# via jaraco-context
bandit==1.7.9
# via buildable-stick-system (pyproject.toml)
binaryornot==0.4.4
# via reuse
boolean-py==4.0
# via
# license-expression
# reuse
build==1.2.1
# via pip-tools
build123d==0.5.0
# via buildable-stick-system (pyproject.toml)
cachetools==5.3.3
# via tox
cadquery-ocp==7.7.2
# via
# build123d
# ocpsvg
certifi==2024.6.2
# via requests
cffi==1.16.0
# via cryptography
chardet==5.2.0
# via
# binaryornot
# python-debian
# tox
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via pip-tools
colorama==0.4.6
# via tox
coverage[toml]==7.5.4
# via pytest-cov
cryptography==42.0.8
# via secretstorage
decorator==5.1.1
# via ipython
distlib==0.3.8
# via virtualenv
docutils==0.21.2
# via readme-renderer
executing==2.0.1
# via stack-data
ezdxf==1.3.1
# via build123d
filelock==3.15.4
# via
# tox
# virtualenv
flake8==7.1.0
# via
# buildable-stick-system (pyproject.toml)
# flake8-builtins
# flake8-docstrings
# flake8-executable
# flake8-isort
# flake8-mutable
# flake8-pyproject
flake8-blind-except==0.2.1
# via buildable-stick-system (pyproject.toml)
flake8-builtins==2.5.0
# via buildable-stick-system (pyproject.toml)
flake8-docstrings==1.7.0
# via buildable-stick-system (pyproject.toml)
flake8-executable==2.1.3
# via buildable-stick-system (pyproject.toml)
flake8-fixme==1.1.1
# via buildable-stick-system (pyproject.toml)
flake8-isort==6.1.1
# via buildable-stick-system (pyproject.toml)
flake8-logging-format==2024.24.12
# via buildable-stick-system (pyproject.toml)
flake8-mutable==1.2.0
# via buildable-stick-system (pyproject.toml)
flake8-pyproject==1.2.3
# via buildable-stick-system (pyproject.toml)
fonttools==4.53.0
# via ezdxf
idna==3.7
# via requests
importlib-metadata==8.0.0
# via
# keyring
# twine
iniconfig==2.0.0
# via pytest
ipython==8.26.0
# via build123d
isort==5.13.2
# via flake8-isort
jaraco-classes==3.4.0
# via keyring
jaraco-context==5.3.0
# via keyring
jaraco-functools==4.0.1
# via keyring
jedi==0.19.1
# via ipython
jeepney==0.8.0
# via
# keyring
# secretstorage
jinja2==3.1.4
# via reuse
keyring==25.2.1
# via twine
license-expression==30.3.0
# via reuse
markdown-it-py==3.0.0
# via rich
markupsafe==2.1.5
# via jinja2
matplotlib-inline==0.1.7
# via ipython
mccabe==0.7.0
# via flake8
mdurl==0.1.2
# via markdown-it-py
more-itertools==10.3.0
# via
# jaraco-classes
# jaraco-functools
mypy==1.10.1
# via buildable-stick-system (pyproject.toml)
mypy-extensions==1.0.0
# via mypy
nh3==0.2.17
# via readme-renderer
numpy==1.26.4
# via
# build123d
# ezdxf
# numpy-stl
# scipy
# svgpathtools
numpy-stl==3.1.1
# via build123d
ocpsvg==0.2.1
# via build123d
packaging==24.1
# via
# build
# pyproject-api
# pytest
# setuptools-scm
# tox
parso==0.8.4
# via jedi
pbr==6.0.0
# via stevedore
pexpect==4.9.0
# via ipython
pip-tools==7.4.1
# via buildable-stick-system (pyproject.toml)
pkginfo==1.10.0
# via twine
platformdirs==4.2.2
# via
# tox
# virtualenv
pluggy==1.5.0
# via
# pytest
# tox
prompt-toolkit==3.0.47
# via ipython
ptyprocess==0.7.0
# via pexpect
pure-eval==0.2.2
# via stack-data
py-lib3mf==2.3.1
# via build123d
pycodestyle==2.12.0
# via flake8
pycparser==2.22
# via cffi
pydocstyle==6.3.0
# via flake8-docstrings
pyflakes==3.2.0
# via flake8
pygments==2.18.0
# via
# ipython
# readme-renderer
# rich
pyparsing==3.1.2
# via ezdxf
pyproject-api==1.7.1
# via tox
pyproject-hooks==1.1.0
# via
# build
# pip-tools
pytest==8.2.2
# via
# buildable-stick-system (pyproject.toml)
# pytest-asyncio
# pytest-cov
pytest-asyncio==0.23.7
# via buildable-stick-system (pyproject.toml)
pytest-cov==5.0.0
# via buildable-stick-system (pyproject.toml)
python-debian==0.1.49
# via reuse
python-utils==3.8.2
# via numpy-stl
pyyaml==6.0.1
# via bandit
readme-renderer==43.0
# via twine
requests==2.32.3
# via
# requests-toolbelt
# twine
requests-toolbelt==1.0.0
# via twine
reuse==3.0.2
# via buildable-stick-system (pyproject.toml)
rfc3986==2.0.0
# via twine
rich==13.7.1
# via
# bandit
# twine
scipy==1.14.0
# via svgpathtools
secretstorage==3.3.3
# via keyring
setuptools-scm==8.1.0
# via buildable-stick-system (pyproject.toml)
six==1.16.0
# via
# anytree
# asttokens
snowballstemmer==2.2.0
# via pydocstyle
stack-data==0.6.3
# via ipython
stevedore==5.2.0
# via bandit
svgelements==1.9.6
# via ocpsvg
svgpathtools==1.6.1
# via
# build123d
# ocpsvg
svgwrite==1.4.3
# via svgpathtools
tox==4.15.1
# via buildable-stick-system (pyproject.toml)
traitlets==5.14.3
# via
# ipython
# matplotlib-inline
trianglesolver==1.2
# via build123d
twine==5.1.1
# via buildable-stick-system (pyproject.toml)
typing-extensions==4.12.2
# via
# build123d
# ezdxf
# ipython
# mypy
# python-utils
urllib3==2.2.2
# via
# requests
# twine
virtualenv==20.26.3
# via tox
wcwidth==0.2.13
# via prompt-toolkit
wheel==0.43.0
# via pip-tools
zipp==3.19.2
# via importlib-metadata
# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools

View File

@ -0,0 +1,508 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --extra=gui --output-file=requirements/requirements-gui.txt
#
alabaster==0.7.16
# via sphinx
anytree==2.12.1
# via build123d
arrow==1.3.0
# via cookiecutter
astroid==3.2.2
# via pylint
asttokens==2.4.1
# via stack-data
atomicwrites==1.4.1
# via spyder
attrs==23.2.0
# via
# jsonschema
# referencing
autopep8==2.0.4
# via python-lsp-server
babel==2.15.0
# via sphinx
backports-tarfile==1.2.0
# via jaraco-context
beautifulsoup4==4.12.3
# via nbconvert
binaryornot==0.4.4
# via cookiecutter
black==24.4.2
# via python-lsp-black
bleach==6.1.0
# via nbconvert
build123d==0.5.0
# via buildable-stick-system (pyproject.toml)
cadquery==2.4.0
# via buildable-stick-system (pyproject.toml)
cadquery-ocp==7.7.2
# via
# build123d
# cadquery
# ocpsvg
casadi==3.6.5
# via cadquery
certifi==2024.6.2
# via requests
cffi==1.16.0
# via cryptography
chardet==5.2.0
# via
# binaryornot
# spyder
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via
# black
# cookiecutter
cloudpickle==3.0.0
# via
# spyder
# spyder-kernels
comm==0.2.2
# via ipykernel
cookiecutter==2.6.0
# via spyder
cq-editor @ git+https://github.com/jdegenstein/jmwright-CQ-Editor
# via buildable-stick-system (pyproject.toml)
cryptography==42.0.8
# via secretstorage
debugpy==1.8.2
# via ipykernel
decorator==5.1.1
# via ipython
defusedxml==0.7.1
# via nbconvert
diff-match-patch==20230430
# via
# spyder
# three-merge
dill==0.3.8
# via pylint
docstring-to-markdown==0.15
# via python-lsp-server
docutils==0.21.2
# via sphinx
executing==2.0.1
# via stack-data
ezdxf==1.3.1
# via
# build123d
# cadquery
fastjsonschema==2.20.0
# via nbformat
flake8==7.0.0
# via python-lsp-server
fonttools==4.53.0
# via ezdxf
idna==3.7
# via requests
imagesize==1.4.1
# via sphinx
importlib-metadata==8.0.0
# via
# keyring
# yapf
inflection==0.5.1
# via qstylizer
intervaltree==3.1.0
# via spyder
ipykernel==6.29.5
# via
# qtconsole
# spyder-kernels
ipython==8.26.0
# via
# build123d
# cq-editor
# ipykernel
# spyder
# spyder-kernels
isort==5.13.2
# via pylint
jaraco-classes==3.4.0
# via keyring
jaraco-context==5.3.0
# via keyring
jaraco-functools==4.0.1
# via keyring
jedi==0.19.1
# via
# ipython
# python-lsp-server
# spyder
jeepney==0.8.0
# via
# keyring
# secretstorage
jellyfish==1.0.4
# via spyder
jinja2==3.1.4
# via
# cookiecutter
# nbconvert
# sphinx
jsonschema==4.22.0
# via
# nbformat
# spyder
jsonschema-specifications==2023.12.1
# via jsonschema
jupyter-client==8.6.2
# via
# ipykernel
# nbclient
# qtconsole
# spyder-kernels
jupyter-core==5.7.2
# via
# ipykernel
# jupyter-client
# nbclient
# nbconvert
# nbformat
# qtconsole
jupyterlab-pygments==0.3.0
# via nbconvert
keyring==25.2.1
# via spyder
logbook==1.7.0.post0
# via cq-editor
markdown-it-py==3.0.0
# via rich
markupsafe==2.1.5
# via
# jinja2
# nbconvert
matplotlib-inline==0.1.7
# via
# ipykernel
# ipython
mccabe==0.7.0
# via
# flake8
# pylint
# python-lsp-server
mdurl==0.1.2
# via markdown-it-py
mistune==3.0.2
# via nbconvert
more-itertools==10.3.0
# via
# jaraco-classes
# jaraco-functools
multimethod==1.9.1
# via cadquery
mypy-extensions==1.0.0
# via black
nbclient==0.10.0
# via nbconvert
nbconvert==7.16.4
# via spyder
nbformat==5.10.4
# via
# nbclient
# nbconvert
nest-asyncio==1.6.0
# via ipykernel
nlopt==2.7.1
# via cadquery
nptyping==2.0.1
# via cadquery
numpy==1.26.4
# via
# build123d
# casadi
# ezdxf
# nlopt
# nptyping
# numpy-stl
# pyqtgraph
# scipy
# svgpathtools
numpy-stl==3.1.1
# via build123d
numpydoc==1.7.0
# via spyder
ocpsvg==0.2.1
# via build123d
packaging==24.1
# via
# black
# ipykernel
# nbconvert
# pytoolconfig
# qtconsole
# qtpy
# sphinx
pandocfilters==1.5.1
# via nbconvert
parso==0.8.4
# via
# jedi
# spyder
path==16.14.0
# via
# cadquery
# cq-editor
pathspec==0.12.1
# via black
pexpect==4.9.0
# via
# ipython
# spyder
pickleshare==0.7.5
# via spyder
platformdirs==4.2.2
# via
# black
# jupyter-core
# pylint
# pytoolconfig
# yapf
pluggy==1.5.0
# via python-lsp-server
prompt-toolkit==3.0.47
# via ipython
psutil==6.0.0
# via
# ipykernel
# spyder
ptyprocess==0.7.0
# via pexpect
pure-eval==0.2.2
# via stack-data
py-lib3mf==2.3.1
# via build123d
pycodestyle==2.11.1
# via
# autopep8
# flake8
# python-lsp-server
pycparser==2.22
# via cffi
pydocstyle==6.3.0
# via python-lsp-server
pyflakes==3.2.0
# via
# flake8
# python-lsp-server
pygments==2.18.0
# via
# ipython
# nbconvert
# qtconsole
# rich
# sphinx
# spyder
pylint==3.2.5
# via
# python-lsp-server
# spyder
pylint-venv==3.0.3
# via spyder
pyls-spyder==0.4.0
# via spyder
pyparsing==3.1.2
# via ezdxf
pyqt5==5.15.10
# via
# cq-editor
# pyqtwebengine
# spyder
pyqt5-qt5==5.15.14
# via pyqt5
pyqt5-sip==12.13.0
# via
# pyqt5
# pyqtwebengine
pyqtgraph==0.13.7
# via cq-editor
pyqtwebengine==5.15.6
# via spyder
pyqtwebengine-qt5==5.15.14
# via pyqtwebengine
python-dateutil==2.9.0.post0
# via
# arrow
# jupyter-client
python-lsp-black==2.0.0
# via spyder
python-lsp-jsonrpc==1.1.2
# via python-lsp-server
python-lsp-server[all]==1.11.0
# via
# pyls-spyder
# python-lsp-black
# spyder
python-slugify==8.0.4
# via cookiecutter
python-utils==3.8.2
# via numpy-stl
pytoolconfig[global]==1.3.1
# via rope
pyxdg==0.28
# via spyder
pyyaml==6.0.1
# via cookiecutter
pyzmq==26.0.3
# via
# ipykernel
# jupyter-client
# qtconsole
# spyder
# spyder-kernels
qdarkstyle==3.2.3
# via spyder
qstylizer==0.2.3
# via spyder
qtawesome==1.3.1
# via spyder
qtconsole==5.5.2
# via spyder
qtpy==2.4.1
# via
# qdarkstyle
# qtawesome
# qtconsole
# spyder
referencing==0.35.1
# via
# jsonschema
# jsonschema-specifications
requests==2.32.3
# via
# cookiecutter
# cq-editor
# sphinx
rich==13.7.1
# via cookiecutter
rope==1.13.0
# via python-lsp-server
rpds-py==0.18.1
# via
# jsonschema
# referencing
rtree==1.2.0
# via spyder
scipy==1.14.0
# via svgpathtools
secretstorage==3.3.3
# via keyring
six==1.16.0
# via
# anytree
# asttokens
# bleach
# python-dateutil
snowballstemmer==2.2.0
# via
# pydocstyle
# sphinx
sortedcontainers==2.4.0
# via intervaltree
soupsieve==2.5
# via beautifulsoup4
sphinx==7.3.7
# via
# numpydoc
# spyder
sphinxcontrib-applehelp==1.0.8
# via sphinx
sphinxcontrib-devhelp==1.0.6
# via sphinx
sphinxcontrib-htmlhelp==2.0.5
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.7
# via sphinx
sphinxcontrib-serializinghtml==1.1.10
# via sphinx
spyder==5.5.5
# via cq-editor
spyder-kernels==2.5.2
# via spyder
stack-data==0.6.3
# via ipython
svgelements==1.9.6
# via ocpsvg
svgpathtools==1.6.1
# via
# build123d
# ocpsvg
svgwrite==1.4.3
# via svgpathtools
tabulate==0.9.0
# via numpydoc
text-unidecode==1.3
# via python-slugify
textdistance==4.6.2
# via spyder
three-merge==0.1.1
# via spyder
tinycss2==1.3.0
# via
# nbconvert
# qstylizer
tomli==2.0.1
# via yapf
tomlkit==0.12.5
# via pylint
tornado==6.4.1
# via
# ipykernel
# jupyter-client
traitlets==5.14.3
# via
# comm
# ipykernel
# ipython
# jupyter-client
# jupyter-core
# matplotlib-inline
# nbclient
# nbconvert
# nbformat
# qtconsole
trianglesolver==1.2
# via build123d
types-python-dateutil==2.9.0.20240316
# via arrow
typing-extensions==4.12.2
# via
# build123d
# ezdxf
# ipython
# python-utils
typish==1.9.3
# via cadquery
ujson==5.10.0
# via
# python-lsp-jsonrpc
# python-lsp-server
urllib3==2.2.2
# via requests
watchdog==4.0.1
# via spyder
wcwidth==0.2.13
# via prompt-toolkit
webencodings==0.5.1
# via
# bleach
# tinycss2
whatthepatch==1.0.5
# via python-lsp-server
wurlitzer==3.1.1
# via spyder-kernels
yapf==0.40.2
# via python-lsp-server
zipp==3.19.2
# via importlib-metadata
# The following packages are considered to be unsafe in a requirements file:
# setuptools

View File

@ -0,0 +1,89 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --output-file=requirements/requirements.txt
#
anytree==2.12.1
# via build123d
asttokens==2.4.1
# via stack-data
build123d==0.5.0
# via buildable-stick-system (pyproject.toml)
cadquery-ocp==7.7.2
# via
# build123d
# ocpsvg
decorator==5.1.1
# via ipython
executing==2.0.1
# via stack-data
ezdxf==1.3.1
# via build123d
fonttools==4.53.0
# via ezdxf
ipython==8.26.0
# via build123d
jedi==0.19.1
# via ipython
matplotlib-inline==0.1.7
# via ipython
numpy==1.26.4
# via
# build123d
# ezdxf
# numpy-stl
# scipy
# svgpathtools
numpy-stl==3.1.1
# via build123d
ocpsvg==0.2.1
# via build123d
parso==0.8.4
# via jedi
pexpect==4.9.0
# via ipython
prompt-toolkit==3.0.47
# via ipython
ptyprocess==0.7.0
# via pexpect
pure-eval==0.2.2
# via stack-data
py-lib3mf==2.3.1
# via build123d
pygments==2.18.0
# via ipython
pyparsing==3.1.2
# via ezdxf
python-utils==3.8.2
# via numpy-stl
scipy==1.14.0
# via svgpathtools
six==1.16.0
# via
# anytree
# asttokens
stack-data==0.6.3
# via ipython
svgelements==1.9.6
# via ocpsvg
svgpathtools==1.6.1
# via
# build123d
# ocpsvg
svgwrite==1.4.3
# via svgpathtools
traitlets==5.14.3
# via
# ipython
# matplotlib-inline
trianglesolver==1.2
# via build123d
typing-extensions==4.12.2
# via
# build123d
# ezdxf
# ipython
# python-utils
wcwidth==0.2.13
# via prompt-toolkit

1
src/bss/__init__.py Normal file
View File

@ -0,0 +1 @@
"""The Buildable Stick System, code to generate arcade stick components."""

68
src/bss/core.py Normal file
View File

@ -0,0 +1,68 @@
"""Shared parameters and foundational objects.
Reminder that the default unit is millimeters.
SPDX-FileCopyrightText: © 2023 Brian S. Stephan <bss@incorporeal.org>
SPDX-License-Identifier: GPL-3.0-or-later
"""
import build123d as bd
####################
# measurements for holes and connectors
####################
HOLE_TOLERANCE = 0.15
M4_BOLT_RADIUS = 2 + HOLE_TOLERANCE
M4_BOLT_COUNTERSINK_RADIUS = M4_BOLT_RADIUS + 2
####################
# basic dimensions necessary for proper object composition
####################
# these are for ONE frame box, not the overall case, which may be composed
# of multiple frames
FRAME_X = 233
FRAME_Y = 208
FRAME_Z = 57
# the "wall" is the space inside the frame that is reserved to make a lip for panels
FRAME_WALL = 4
# panel dimensions for either an inset panel or the inner tray of an overhang panel
PANEL_X = FRAME_X - (FRAME_WALL * 2)
PANEL_Y = FRAME_Y - (FRAME_WALL * 2)
PANEL_Z = 5
# the center point of where the standoff and bolts connecting a panel to a frame go,
# relative to a centered object
PANEL_TO_FRAME_POINT_OFFSET = 10
PANEL_TO_FRAME_POINT_X = (PANEL_X/2) - PANEL_TO_FRAME_POINT_OFFSET
PANEL_TO_FRAME_POINT_Y = (PANEL_Y/2) - PANEL_TO_FRAME_POINT_OFFSET
####################
# commonly used button dimensions
####################
BUTTON_30MM_RADIUS = 15 + HOLE_TOLERANCE
BUTTON_24MM_RADIUS = 12 + HOLE_TOLERANCE
# carve out space for snap-ins
# judgng by https://www.slagcoin.com/joystick/attributes_brands.html 2.5mm is good for everything
BUTTON_SNAP_IN_THICKNESS = 2.5
# make sure the carve out space is also enough for screw-in nuts
# slagcoin has screw-in nut diameter at 36mm for 30mm buttons, 29.5 for 24mm buttons
# radius + value below should leave space for the nut and for fingers to grab the nut
BUTTON_30MM_RADIUS_CONNECTOR_SPACE = 6
####################
# arcade stick parts that are relevant in a number of contexts
####################
class CutoutButtonHole(bd.CounterBoreHole):
"""Use an inverted counter bore hole as the button hole with the extra thin space for snap-ins."""
def __init__(self, radius, **kwargs):
"""Initialize the inverted counter bore hole with the right thinness for e.g. a panel to take snap-ins."""
super().__init__(radius, radius+BUTTON_30MM_RADIUS_CONNECTOR_SPACE, BUTTON_SNAP_IN_THICKNESS, **kwargs)

31
src/bss/layouts.py Normal file
View File

@ -0,0 +1,31 @@
"""Button and other component layouts for use in panels.
SPDX-FileCopyrightText: © 2023 Brian S. Stephan <bss@incorporeal.org>
SPDX-License-Identifier: GPL-3.0-or-later
"""
import build123d as bd
from bss import core
####################
# collected points and related data, to be used to construct a layout
####################
# 3x3, centered on top left (P1) button
SEGA_2P_SIX_BUTTON = {'radius': core.BUTTON_30MM_RADIUS,
'positions': [(0, 0), (30.5, 11 + 9), (30.5 + 36, 11 + 9),
(0, -19 - 9 - 11), (30.5, -19), (30.5 + 36, -19)]}
####################
# Layouts are Locations with extra stuff to document what it is
####################
class Layout(bd.Locations):
"""A set of button positions that can be adjusted relative to some parameters."""
def __init__(self, layout, *args, distance_scale=1.00, **kwargs):
"""Lay out the points for the buttons, etc. but can be scaled."""
self.points = list(map(lambda x: (x[0] * distance_scale, x[1] * distance_scale), layout['positions']))
self.button_radius = layout['radius']
super().__init__(self.points, *args, **kwargs)

45
src/bss/panels.py Normal file
View File

@ -0,0 +1,45 @@
"""The base panel from which all other panels inherit.
SPDX-FileCopyrightText: © 2023 Brian S. Stephan <bss@incorporeal.org>
SPDX-License-Identifier: GPL-3.0-or-later
"""
import logging
import build123d as bd
from bss import core, layouts
logger = logging.getLogger(__name__)
class Panel(bd.BasePartObject):
"""A panel meant to be secured to the top or bottom of a base.
This is a hard box by default as an inset panel will be flush with the frame.
"""
def __init__(self, *args, **kwargs):
"""Create our part."""
with bd.BuildPart() as panel:
bd.Box(core.PANEL_X, core.PANEL_Y, core.PANEL_Z)
logger.info(panel.faces().sort_by(bd.Axis.Z))
with bd.Locations(panel.faces().sort_by(bd.Axis.Z)[-1]):
with bd.Locations((core.PANEL_TO_FRAME_POINT_X, core.PANEL_TO_FRAME_POINT_Y),
(-core.PANEL_TO_FRAME_POINT_X, core.PANEL_TO_FRAME_POINT_Y),
(-core.PANEL_TO_FRAME_POINT_X, -core.PANEL_TO_FRAME_POINT_Y),
(core.PANEL_TO_FRAME_POINT_X, -core.PANEL_TO_FRAME_POINT_Y)):
bd.CounterSinkHole(core.M4_BOLT_RADIUS, core.M4_BOLT_COUNTERSINK_RADIUS)
super().__init__(panel.part, *args, **kwargs)
with bd.BuildPart() as sega_2p_panel:
panel = Panel()
with layouts.Layout(layouts.SEGA_2P_SIX_BUTTON):
with bd.Locations((5, 45)):
with bd.Locations(panel.faces().sort_by(bd.Axis.Z)[0]):
core.CutoutButtonHole(layouts.SEGA_2P_SIX_BUTTON['radius'])
try:
show_object(sega_2p_panel)
except NameError:
pass

58
tox.ini Normal file
View File

@ -0,0 +1,58 @@
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
isolated_build = true
envlist = begin,py311,coverage,bandit,lint,reuse
[testenv]
allow_externals = pytest, coverage
deps =
-rrequirements/requirements-dev.txt
[testenv:begin]
# clean up potential previous coverage runs
skip_install = true
commands = coverage erase
[testenv:py311]
# run pytest with coverage
commands =
pytest --cov-append --cov={envsitepackagesdir}/bss/ --cov-branch
[testenv:coverage]
# report on coverage runs from above
skip_install = true
commands =
coverage report --fail-under=90 --show-missing
[testenv:bandit]
commands =
bandit ./src/bss/ -r
[testenv:lint]
# run style checks
commands =
flake8
mypy src/bss
- flake8 --disable-noqa --ignore= --select=E,W,F,C,D,A,G,B,I,T,M,DUO
[testenv:reuse]
# check license documentation
commands =
reuse lint
[coverage:paths]
source =
./
.tox/**/site-packages/
[coverage:run]
branch = True
omit =
**/_version.py
**/proto_snapshot/*