discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Getting dimensions of imported shape?

L
lar3ry
Tue, Jun 11, 2019 1:58 PM

If you don't have numpy, could you try installing that. I have it in my
Python library, but don't remember if it was already there when I started.

Could it be that there are more than one stl modules?

I took a look at the link you posted, and what I find most interesting about
it is the number of problems polyfix pointed out. It surprised me, because I
could slice the model (in Slic3r) just fine.

I haven't looked at AngelCAD at all. Do you have pre-built binaries
available anywhere?

Larry

cacb wrote

I tried your python script, but got an error:

ModuleNotFoundError: No module named 'stl'

Then I tried: 'pip3 install stl' which seemed to work. However, when I
ran the script again, I got

python stldim.py
Traceback (most recent call last):
File "stldim.py", line 3, in
<module>
from stl import mesh
ImportError: cannot import name 'mesh' from 'stl'
(C:\Python\Python37\lib\site-packages\stl_init_.py)

So apparently there are some dependencies that need clarification.

Here is an alternative approach to the same problem (based on your STL)
using bounding boxes in AngelCAD
https://gist.github.com/arnholm/c06966e575173f9eaaafbac1d30e0c76

Carsten Arnholm


OpenSCAD mailing list

Discuss@.openscad

If you don't have numpy, could you try installing that. I have it in my Python library, but don't remember if it was already there when I started. Could it be that there are more than one stl modules? I took a look at the link you posted, and what I find most interesting about it is the number of problems polyfix pointed out. It surprised me, because I could slice the model (in Slic3r) just fine. I haven't looked at AngelCAD at all. Do you have pre-built binaries available anywhere? Larry cacb wrote > I tried your python script, but got an error: > > ModuleNotFoundError: No module named 'stl' > > Then I tried: 'pip3 install stl' which seemed to work. However, when I > ran the script again, I got > > python stldim.py > Traceback (most recent call last): > File "stldim.py", line 3, in > <module> > from stl import mesh > ImportError: cannot import name 'mesh' from 'stl' > (C:\Python\Python37\lib\site-packages\stl\__init__.py) > > So apparently there are some dependencies that need clarification. > > > Here is an alternative approach to the same problem (based on your STL) > using bounding boxes in AngelCAD > https://gist.github.com/arnholm/c06966e575173f9eaaafbac1d30e0c76 > > > Carsten Arnholm > > _______________________________________________ > OpenSCAD mailing list > Discuss@.openscad > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org -- Sent from: http://forum.openscad.org/
A
arnholm@arnholm.org
Tue, Jun 11, 2019 3:31 PM

On 2019-06-11 15:58, lar3ry wrote:

If you don't have numpy, could you try installing that. I have it in my
Python library, but don't remember if it was already there when I
started.

I will try again on a different computer and report back later.

I took a look at the link you posted, and what I find most interesting
about
it is the number of problems polyfix pointed out. It surprised me,
because I
could slice the model (in Slic3r) just fine.

Slicers are generally much more forgiving than cad programs, so many STL
files with issues can be printed without problems. Also important is the
fact that reading an STL file into a CAD program is a matter of
interpretation, so different software will report different issues.

I haven't looked at AngelCAD at all. Do you have pre-built binaries
available anywhere?

Yes, you can get it at https://github.com/arnholm/angelcad/releases
(Windows/Ubuntu)

Carsten Arnholm

On 2019-06-11 15:58, lar3ry wrote: > If you don't have numpy, could you try installing that. I have it in my > Python library, but don't remember if it was already there when I > started. I will try again on a different computer and report back later. > I took a look at the link you posted, and what I find most interesting > about > it is the number of problems polyfix pointed out. It surprised me, > because I > could slice the model (in Slic3r) just fine. Slicers are generally much more forgiving than cad programs, so many STL files with issues can be printed without problems. Also important is the fact that reading an STL file into a CAD program is a matter of interpretation, so different software will report different issues. > I haven't looked at AngelCAD at all. Do you have pre-built binaries > available anywhere? Yes, you can get it at https://github.com/arnholm/angelcad/releases (Windows/Ubuntu) Carsten Arnholm
CA
Carsten Arnholm
Tue, Jun 11, 2019 8:31 PM

On 11.06.2019 17:31, arnholm@arnholm.org wrote:

On 2019-06-11 15:58, lar3ry wrote:

If you don't have numpy, could you try installing that. I have it in my
Python library, but don't remember if it was already there when I
started.

I will try again on a different computer and report back later.

I had another try, this time on a Kubuntu 18.04 computer with Python3.7

First I got the same error as before and installed (using pip3) the
'stl' package, same problem. Then I tried to install a 'mesh' package,
still no success. Next I tried your suggestion numpy, but this was no
success either. After searching with DuckDuckGo for "python package stl
mesh", I noticed there is something called 'numpy-stl'. So I did

pip3 install numpy-stl

Then it worked fine, I was able to run your .scad code successfully. So
I think you might want to add the requirement to install the python
package numpy-stl in your github README.md

Carsten Arnholm

On 11.06.2019 17:31, arnholm@arnholm.org wrote: > On 2019-06-11 15:58, lar3ry wrote: >> If you don't have numpy, could you try installing that. I have it in my >> Python library, but don't remember if it was already there when I >> started. > > I will try again on a different computer and report back later. I had another try, this time on a Kubuntu 18.04 computer with Python3.7 First I got the same error as before and installed (using pip3) the 'stl' package, same problem. Then I tried to install a 'mesh' package, still no success. Next I tried your suggestion numpy, but this was no success either. After searching with DuckDuckGo for "python package stl mesh", I noticed there is something called 'numpy-stl'. So I did pip3 install numpy-stl Then it worked fine, I was able to run your .scad code successfully. So I think you might want to add the requirement to install the python package numpy-stl in your github README.md Carsten Arnholm
L
lar3ry
Tue, Jun 11, 2019 9:30 PM

Done. Thanks Carsten!

--
Sent from: http://forum.openscad.org/

Done. Thanks Carsten! -- Sent from: http://forum.openscad.org/