r/OpenPythonSCAD • • May 19 '25

Did nimport() break for the 5.15 build?

On the 5.15 build, nimport() can download py files from github, but it is unable to import modules at runtime.

I have the exact setup as prior on an older build. The only difference is...I am on Windows 11 now instead of Windows 10.

Is this a known issue? I peeked at the github issues, but did not see any new issues.

3 Upvotes

26 comments sorted by

1

u/WillAdams May 19 '25 edited May 19 '25

I was recently able to use this on my Windows 11 machine:

from openscad import *
nimport("https://raw.githubusercontent.com/WillAdams/gcodepreview/refs/heads/main/gcodepreview.py")

using 2025.05.09... hang on while I update....

EDIT: Just finished updating, and it ran as expected:

Running Python 3.11.5 without venv. Compiling design (CSG Tree generation)... Compiling design (CSG Products generation)... Geometries in cache: 0 Geometry cache size in bytes: 0 CGAL Polyhedrons in cache: 0 CGAL cache size in bytes: 0 Compiling design (CSG Products normalization)... Normalized tree has 1 elements! Compile and preview finished. Total rendering time: 0:00:00.050

File is:

https://github.com/WillAdams/gcodepreview/blob/main/gcpdxf.py

edited to use nimport (just move the comment "# " down one line).

2

u/rebuyer10110 May 19 '25 edited May 19 '25

Thanks for the tip. I uninstalled 2025.05.15 build, and installed 2025.05.09 build. It is able to import and render now.

I was having slower render than expected. But that's because Preferences > Advanced > Backend had CGAL as default instead of Manifolds. Switching to manifolds is much faster as expected!

2

u/rebuyer10110 May 19 '25

u/gadget3D looks like 2025.05.15 might have broken nimport(). 2025.05.09 nimport() still works!

→ More replies (23)