Giter Site home page Giter Site logo

mesh-tumbler's People

Contributors

dpohanlon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mesh-tumbler's Issues

IndexError: index 3 is out of bounds for axis 0 with size 3

Tried with the Grafana mascot grot stl that you can get from here https://www.printables.com/model/655662-grafana-grot-mascot/files

I tried with other STL and it seems to be able to process it but it failed with that one.

❯ python --version
Python 3.9.18
❯ mesh-tumbler --input_file ~/Downloads/grot.stl
Traceback (most recent call last):
  File "/home/academo/.asdf/installs/python/3.9.18/bin/mesh-tumbler", line 8, in <module>
    sys.exit(run())
  File "/home/academo/.asdf/installs/python/3.9.18/lib/python3.9/site-packages/mesh_tumbler/rotate_mesh.py", line 232, in run
    main(
  File "/home/academo/.asdf/installs/python/3.9.18/lib/python3.9/site-packages/mesh_tumbler/rotate_mesh.py", line 200, in main
    res = gp_minimize(
  File "/home/academo/.asdf/installs/python/3.9.18/lib/python3.9/site-packages/skopt/optimizer/gp.py", line 281, in gp_minimize
    return base_minimize(
  File "/home/academo/.asdf/installs/python/3.9.18/lib/python3.9/site-packages/skopt/optimizer/base.py", line 332, in base_minimize
    next_y = func(next_x)
  File "/home/academo/.asdf/installs/python/3.9.18/lib/python3.9/site-packages/mesh_tumbler/rotate_mesh.py", line 198, in opt
    return -log_prob(np.array(t), mesh, pitch, max_overhang_angle)
  File "/home/academo/.asdf/installs/python/3.9.18/lib/python3.9/site-packages/mesh_tumbler/rotate_mesh.py", line 190, in log_prob
    return rotation_overhangs(angles, mesh, pitch, max_overhang_angle)
  File "/home/academo/.asdf/installs/python/3.9.18/lib/python3.9/site-packages/mesh_tumbler/rotate_mesh.py", line 131, in rotation_overhangs
    return overhang_count(rotated_mesh, pitch, max_overhang_angle)
  File "/home/academo/.asdf/installs/python/3.9.18/lib/python3.9/site-packages/mesh_tumbler/rotate_mesh.py", line 115, in overhang_count
    overhangs, overhang_voxels = calculate_overhangs(
  File "/home/academo/.asdf/installs/python/3.9.18/lib/python3.9/site-packages/mesh_tumbler/rotate_mesh.py", line 42, in calculate_overhangs
    if is_overhang(point, normal, voxel_grid, max_overhang_angle, voxel_size):
  File "/home/academo/.asdf/installs/python/3.9.18/lib/python3.9/site-packages/mesh_tumbler/rotate_mesh.py", line 63, in is_overhang
    if voxel_grid[x, y, below_z]:
IndexError: index 3 is out of bounds for axis 0 with size 3

ModuleNotFoundError: No module named 'tqdm'

I ran pip install . (using asdf for a local python install) and got ModuleNotFoundError: No module named 'tqdm' when trying to run the tool.

After pip install tqdm it worked (for only specific stls)

"pipx install"ed version fails

$ pipx install .
  installed package mesh-tumbler 0.1.0, installed using Python 3.11.2
  These apps are now globally available
    - mesh-tumbler
done! ✨ 🌟 ✨
$ mesh-tumbler input.stl
Traceback (most recent call last):
  File "/home/jepler/.local/bin/mesh-tumbler", line 5, in <module>
    from mesh_tumbler.rotate_mesh import run
  File "/home/jepler/.local/pipx/venvs/mesh-tumbler/lib/python3.11/site-packages/mesh_tumbler/rotate_mesh.py", line 4, in <module>
    from tqdm import tqdm
ModuleNotFoundError: No module named 'tqdm'

I did not file a PR to depend on tqdm in part because tqdm is only used inside an unused function. However, with this modification, the pipx-installed version did run:

diff --git a/pyproject.toml b/pyproject.toml
index c773790..81e5133 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -16,6 +16,7 @@ pandas = "<=2.1.4"
 seaborn = "^0.13.2"
 matplotlib = "^3.9.0"
 trimesh = "^4.4.1"
+tqdm = "^4.66.4"
 
 
 [build-system]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.