Skip to content
/ pylele Public

Python based Ukulele and other String Instrument 3D Model Generator

License

Notifications You must be signed in to change notification settings

bguan/pylele

Repository files navigation

Pylele

(Pronounced as "Pie-Lay-Lay")

Python based Ukulele and other String Instrument 3D Model Generator similar to my other projects:

Implemented by clean portable wrapper around one of the following Python 3D Modeling Library:

  • CadQuery (Most Accurate)
  • Blender (Still a little buggy...)
  • Trimesh (Faster)
  • SolidPython2 (Supports .stl, .svg, .scad, and BOSL2 library import, fast when using manifold option)
  • manifold3d: (Fastests) 3d modeling library used by trimesh and openscad

Code and view generated models in your favorite development environment!

image

image

Installation

Simplest

Install with pip.

pip install git+https://github.com/bguan/pylele@main
pylele1 --help # first implementation, more stable
pylele2 --help # newer implementation, more options available

Cadquery, Trimesh and Manifold apis should be available on most systems with this method.

Simple (for Ubuntu/Debian)

Install on Ubuntu/Debian should be as simple as running the script:

  ./install_dependencies.sh
  pip install -r requirements.txt

This was developed on Ubuntu 22.04.4. CI is currently testing with python 3.10 and 3.11 .

Detailed

  • Python
    • MacOS
      • install xcode developer tools. Using admin user accout, in terminal command line shell:
        xcode-select --install
        
      • install Homebrew. Using admin user accout, in terminal command line shell:
        > /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
        
      • install Python 3.11 (Blender only support this version). Using admin user accout, in terminal command line shell:
        > brew install [email protected]
        
      • install Virtualenv.
        > brew install virtualenv
        
      • create a python 3.11 based virtual env then activate it. Using admin user accout, in terminal command line shell:
        > virtualenv --python=/opt/homebrew/bin/python3.11 venv3.11
        > . venv3.11/bin/activate
        
  • CadQuery
    • Note: if you ever get error messages about bool8 missing from numpy, downgrade from numpy 2.x back to numpy 1.26.4 e.g.
      > pip install --force-reinstall numpy==1.26.4
      
    • Linux installation of dependencies (I tried on Intel I7 Asus laptop running Ubuntu 24.04 Noble Numbat)
      • In a terminal shell inside a python 3.11+ virtual env:
        > pip install cadquery
        > pip install PyQt5 spyder pyqtgraph logbook
        > pip install git+https://github.com/CadQuery/CQ-editor.git
        
    • MacOS Apple Silicon installation (I tried on M2 Macbook Air running Sonoma 14.5)
      • Due to perculiar build magic for CAD Query OCP wrapper for OCCT not yet working with pip (reason why CQ devs encourage using conda instead of pip, but I prefer pip for other reasons), I needed to download and install prebuilt wheels for caquery_ocp and nlopt
      • In a terminal shell inside a python 3.11+ virtual env:
        > wget https://github.com/biggestT/cadquery-dist-macos-arm64/releases/download/v0.0.1/cadquery_ocp-7.7.0.1-cp311-cp311-macosx_11_0_arm64.whl
        > wget https://github.com/biggestT/cadquery-dist-macos-arm64/releases/download/v0.0.1/nlopt-2.7.1-cp311-cp311-macosx_14_0_arm64.whl
        > pip install cadquery_ocp-7.7.0.1-cp311-cp311-macosx_11_0_arm64.whl
        > pip install nlopt-2.7.1-cp311-cp311-macosx_14_0_arm64.whl
        > pip install --force-reinstall numpy==1.26.4
        > pip install cadquery
        > pip install PyQt5 spyder pyqtgraph logbook
        > pip install git+https://github.com/CadQuery/CQ-editor.git
        
  • Blender (Still a little buggy...)
    • Linux installation of dependencies (I tried on Intel I7 Asus laptop running Ubuntu 24.04 Noble Numbat)
      • In a terminal shell inside a python 3.11+ virtual env:
        > pip install bpy
        
    • MacOS Apple Silicon installation (I tried on M2 Macbook Air running Sonoma 14.5)
      • In a terminal shell inside a python 3.11+ virtual env:
        > pip install bpy
        
  • Trimesh (Still missing 3D text and filleting...)
    • Linux installation of dependencies (I tried on Intel I7 Asus laptop running Ubuntu 24.04 Noble Numbat)
      • In a terminal shell inside a python 3.11+ virtual env:
        > pip install trimesh
        
    • MacOS Apple Silicon installation (I tried on M2 Macbook Air running Sonoma 14.5)
      • In a terminal shell inside a python 3.11+ virtual env:
        > pip install trimesh
        
  • SolidPython2 (Still missing filleting...)
    • Linux installation of dependencies (I tried on Intel I7 Asus laptop running Ubuntu 24.04 Noble Numbat)
      • In a terminal shell inside a python 3.11+ virtual env:
        > sudo apt install openscad
        > pip install solidpython2
        
    • MacOS Apple Silicon installation (I tried on M2 Macbook Air running Sonoma 14.5)
      • In a terminal shell inside a python 3.11+ virtual env:
        > brew install openscad
        > pip install solidpython2
        

Similar Projects

About

Python based Ukulele and other String Instrument 3D Model Generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published