Importing 3D CAD files in python as dask array - python

I am trying to import a 3D file created by TexGen in python. I would like to have a dask array at the end for further analysis. My file is in ".igs" format. I can open it with FreeCAD and export it in a variety of formats. I just don't know which format to use and which library in python is more helpful.
I found this question (Import CAD object in Python and store as array) and tried installing FreeCAD package in python but I was unsuccessful. I get a conflict error (incompatible packages) which I can't solve.
I found this question (3D CAD to OpenGL) and installed PyOpenGL but I don't know how to use OpenGL to import STL file.
Any suggestions?

You can have a look at the opencascade python module
OpenCascade is the library FreeCAD is based on, it can also import/export .stp (and I guess .igs) files and transform it into a mesh.

Related

Distribute embed-cython-compiled .exe and run another machine without python

I have a small pyqt5 project written in python. I generate .cpp file using cython --embed , compiled with MSVC and it is working in my machine with no problem but I want to distribute .exe with no python installed target machines. Pretty much confused about pyqt import as I get error initialization of QtCore failed without raising an exception. I tried various stuff, I put my effort a whole day but briefly put necessary files to .exe location and removed python36._pth , which is as follows
.\python36.dll
.\python36.zip (from python-3.6.5-embed-amd64.zip)
.\PyQt5 (copied from Anaconda3\Lib\site-packages)
.\platforms (required plugins for windows)
I guess it requires also sip but I could not figure out elegant way to add pyqt5 as there is no documentation about distribution of embedded python with imported modules (site-packages).
Any help would be extremely great.
I solved adding .\sip.pyd. Then I checked resulting folder size , it was around 20 MB. With Pyinstaller, resulting .exe is about 43 MB

Missing numpy dependency

I'm trying to build a python script that is suppose to feed into another Matlab program. the script uses (among other things) numpy and pandas.
Here's the matlab code when I try to load the script:
path='C:\XXXXXX\Local\Continuum\anaconda3\python.exe';
pyversion(path)
algo=py.importlib.import_module('Algo_Pres');
When I try to load the script into matlab, I get an import error that seems to originate from python:
I understand the error as: pandas is missing a numpy dependency.
And yet when I turn back to python and run the script in python it works smoothly...
Where do you think the problem comes from?
PS: I checked my Library using conda list in the Prompt.
For some reason numpy is listed in the anaconda channel, whereas anything else is listed without any channel. Do you think it could be linked?

Cannot import Python Statistics Library

I have a small python script that needs to do some simple stats on some lists of numbers - the sort of thing the statistics.py library seems suitable for.
From what I can make out of the info on python.org, it should be part of the standard library in python 3.4.1 (on Win 64 bit), but I'm struggling to access the functions.
import statistics just gives a 'no module named 'statistics' error
Looking through the python34\Lib directory doesn't seem to show a statistics folder, and creating one and saving the statistics.py file available from python.org doesn't seem to make any difference.
Googling for how to install python libraries gives lots of examples referencing setup.py files and command line sequences, but i don't see how they relate to the statistics.py file available.
I'm obviously missing something (probably obvious!) but being a newbie at this i can't work out what it is. Any pointers?
I had the same problem, and instead of:
import statistics
I wrote:
from Lib import statistics
Good Luck!

There are some missing modules: ['matplotlib.patches', 'matplotlib.path', 'matplotlib.pylab', 'matplotlib.pyplot']

I have a problem to create .p3d file using packp3d.
The problem is that: when I try generate the .p3d file, I get this warning:
There are some missing modules: ['matplotlib.patches', 'matplotlib.path', 'matplotlib.pylab', 'matplotlib.pyplot']
If I try to launch my p3d file it gives me an error because matplotlib modules are missing.
I'm new on python and panda3d developing so I asked a co-worker, who is an expert in Panda3D, and he said me that probably is a python problem.

panda 3d importing module error

I'm trying to learn panda 3d, but I'm getting this error
importerror no module named direct.showbase.showbase
I'm using the latest versions of panda 3d 1.7.2, python 2.7 on windows xp, how to fix the error?
http://www.panda3d.org/forums/viewtopic.php?t=10363
Panda 3D on Windows comes with a special version of python that is preconfigured to work correctly with Panda, that python is run with ppython.
Otherwise you need to add the Panda libraries to your Python path from the Panda install. There is a file called panda3d.pth which has the python path necessary, and you can copy that file to C:\[Python Version]\Lib\site-packages.
I don't know what Panda3d's version of python is, but you will need to be running that if you don't want to use ppython.

Categories