cfobel / storage-boxes

A CadQuery fork of the awesome assortment boxes by Alexandre Chappel.
MIT License
0 stars 1 forks source link

Virtualenv alternative to Conda #5

Open jeffeb3 opened 4 months ago

jeffeb3 commented 4 months ago

I'm not versed in the ways of Conda. I tried using the conda/miniconda docker image and I got an error that all of the packages were missing, and conda.compat was being deprecated:

# conda env create -n cadquery-boxes --file environment.yml
WARNING: The conda.compat module is deprecated and will be removed in a future release.
Collecting package metadata: done
Solving environment: failed

ResolvePackageNotFound:
  - argon2-cffi==20.1.0=py38he774522_1
  - tornado==6.1=py38h2bbff1b_0
  - icc_rt==2019.0.0=h0cc432a_1
  - lz4-c==1.9.2=hf4a77e7_3
  - jupyter_core==4.7.0=py38haa95532_0
  - mkl-service==2.3.0=py38h196d8e1_0
  - pillow==8.0.1=py38h4fa10fc_0
  - pyyaml==5.3.1=py38he774522_1
  - importlib_resources==4.1.1=py38haa244fe_0
  - m2w64-libwinpthread-git==5.0.0.4634.697f757=2
  - qt==5.9.7=vc14h73c81de_0
  - pandoc==2.11=h9490d1a_0
  - pyrsistent==0.17.3=py38he774522_0
  - libxml2==2.9.10=hb89e7f3_3
  - ipython==7.19.0=py38hd4e2768_0
  - openssl==1.1.1i=h8ffe710_0
  - m2w64-gcc-libs-core==5.3.0=7
  - freetype==2.10.4=hd328e21_0
  - tk==8.6.10=he774522_0
  - mypy_extensions==0.4.3=py38haa244fe_2
  - mistune==0.8.4=py38he774522_1000
  - pysocks==1.7.1=py38haa95532_0
  - pyzmq==20.0.0=py38hd77b12b_1
  - zstd==1.4.5=h04227a9_0
  - fontconfig==2.13.1=h2c6e35d_1000
  - six==1.15.0=py38haa95532_0
  - icu==58.2=ha925a31_3
  - markupsafe==1.1.1=py38he774522_0
  - pywin32==227=py38he774522_1
  - yaml==0.2.5=he774522_0
  - xz==5.2.5=h62dcd97_0
  - pyqt==5.9.2=py38ha925a31_4
  - pywinpty==0.5.7=py38_0
  - python==3.8.5=h5fd99cc_1
  - certifi==2020.12.5=py38haa244fe_1
  - typed-ast==1.4.1=py38h294d835_1
  - winpty==0.4.3=4
  - libtiff==4.1.0=h56a325e_1
  - libiconv==1.15=h1df5818_7
  - m2w64-gcc-libs==5.3.0=7
  - notebook==6.1.6=py38haa95532_0
  - matplotlib==3.3.2=haa95532_0
  - occt==7.4.0=h823b557_3
  - chardet==4.0.0=py38haa95532_1003
  - matplotlib-base==3.3.2=py38hba9282a_0
  - pip==20.2.4=py38haa95532_0
  - nodejs==15.3.0=h57928b3_0
  - wincertstore==0.2=py38_0
  - ocp==7.4=1_py3.8
  - win_inet_pton==1.1.0=py38haa95532_0
  - regex==2020.11.13=py38h294d835_0
  - libpng==1.6.37=h2a8f88b_0
  - sqlite==3.33.0=h2a8f88b_0
  - msys2-conda-epoch==20160418=1
  - scipy==1.5.2=py38h14eb087_0
  - zlib==1.2.11=h62dcd97_4
  - brotlipy==0.7.0=py38h2bbff1b_1003
  - pandocfilters==1.4.3=py38haa95532_1
  - pydantic==1.7.3=py38h294d835_0
  - vs2015_runtime==14.27.29016=h5e58377_2
  - cryptography==3.3.1=py38hcd4344a_0
  - zeromq==4.3.3=ha925a31_3
  - m2w64-gcc-libgfortran==5.3.0=6
  - m2w64-gmp==6.1.0=2
  - cffi==1.14.4=py38hcd4344a_0
  - tbb==2020.3=h74a9793_0
  - sip==4.19.13=py38ha925a31_0
  - numpy==1.19.4=py38h0cc643e_1
  - libsodium==1.0.18=h62dcd97_0
  - kiwisolver==1.3.0=py38hd77b12b_0
  - setuptools==51.0.0=py38haa95532_2
  - jpeg==9b=hb83a4c4_2
  - vc==14.2=h21ff451_1
  - ca-certificates==2020.12.5=h5b45459_0

What I did instead was to set up a quick python3 virtualenv:

virtualenv -p python3 .venv
source .venv/bin/activate
pip install cadquery typer pydantic
python -m storage_boxes.models --help

Then to get the default boxes:

mkdir boxes
python -m storage_boxes.models ./boxes

I have the purchased boxes from ALCH and I was hoping to just make a few weird custom ones. These are a great start, but they are not identical. The original boxes have a slight draft except for the top 10mm. There is a small lip (hard to tell if it is intentional or not). And some of the round overs are a little different. Still, for my purposes, I think using your .step files as a starting point is going to be a huge help. There are some weird corners in the ALCH models and I can't figure out how to made them, except binary cuts and a strange (to me) order of operations. Tracing STLs is never fun, is it?

jeffeb3 commented 4 months ago

This issue is only useful when it comes to the virtualenv stuff. But I just have to say: This is me, trying to figure out where the dimensions on ALCH's boxes came from:

conspiracy

Even just the sizes of the bottom faces of the 3x3 are 45.245, 45, 45.245mm wide. And the grid faces aren't symmetrical either. The outside edges are a slightly tighter fit than the inner ones.