Ipython Qt Console

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Ipython Qt Console

Post by ickby »

nice work! I will definitly try this when I find some time. I also made a project idea for GSoC in the direction of notebook visualisation: http://www.freecadweb.org/wiki/index.ph ... ntegration
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Ipython Qt Console

Post by looo »

thanks. I will try to make a little video showing how to connect sympy mechanics from ipython notebook with FreeCAD. But first I have to learn sympy mechanics :)

Nice to see these interesting projects. Hopefully there will be many students working on FreeCAD this summer.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Ipython Qt Console

Post by looo »

Here is a short notebook, which takes a box from FreeCAD, computes the motion due to gravity force with sympy.mechanics and PyDy (box is fixed at the origin) and visualize the rotation in FreeCAD.
Maninesan
Posts: 11
Joined: Wed Mar 09, 2016 4:07 am

Re: Ipython Qt Console

Post by Maninesan »

Import Part in ipython console cause an Import error! //ImportError: /home/workspace/freecad-build/Mod/Part/Part.so: undefined symbol: _ZN7gp_Trsf9SetValuesEdddddddddddd // Why is this happening?
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Ipython Qt Console

Post by looo »

Import Part in ipython console cause an Import error! //ImportError: /home/workspace/freecad-build/Mod/Part/Part.so: undefined symbol: _ZN7gp_Trsf9SetValuesEdddddddddddd // Why is this happening?
does this problem also happen with the console of freecad?
Last edited by looo on Tue Mar 15, 2016 8:48 pm, edited 1 time in total.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Ipython Qt Console

Post by looo »

This shows why FreeCAD and the Ipython-notebook are such a good match:
demo showing a dynamic simulation using the Ipython notebook with FreeCAD.
Maninesan
Posts: 11
Joined: Wed Mar 09, 2016 4:07 am

Re: Ipython Qt Console

Post by Maninesan »

looo wrote: does this problem also happen with the console of freecad?
Yes. Also an Import Error happens when I try to import 'Mesh'! Actually this happens when I manually build the FreeCAD using the source, But when I added the PPA and installed FreeCAD via the console on ubuntu works fine!(Both Part and Mesh).
Is it means my manual build contains errors? but I get a successfully build log!
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Ipython Qt Console

Post by ickby »

Maninesan wrote:
looo wrote: does this problem also happen with the console of freecad?
Yes. Also an Import Error happens when I try to import 'Mesh'! Actually this happens when I manually build the FreeCAD using the source, But when I added the PPA and installed FreeCAD via the console on ubuntu works fine!(Both Part and Mesh).
Is it means my manual build contains errors? but I get a successfully build log!
there is definitly something wring with yiur build. Please add a new thread in the install/compile subforum and add some more Details about your Platform and build process.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Ipython Qt Console

Post by looo »

just had a look at this again...
to start freecad from jupyter-notebook you have to open a new python2 notebook and run this code. there is no need for a jupyter kernel...

Code: Select all

import sys, os
os.environ["QT_API"] = "pyside"
%gui qt4
sys.path.append("DIR_which_contains_FreeCADGui")
import FreeCADGui
FreeCADGui.showMainWindow()
This also works with jupyter-qtconsole and jupyter-console. But there are many different versions of jupyter. so there are maybe some problems with some versions. But I have the feeling with latest jupyter version this gets more stable.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Ipython Qt Console

Post by triplus »

Thanks for sharing the info. I might try it out someday.
Post Reply