glider workbench

Show off your FreeCAD projects here!
looo
Posts: 2655
Joined: Mon Nov 11, 2013 5:29 pm

Re: glider workbench

Postby looo » Wed Mar 28, 2018 1:08 pm

Yes, it works perfectly. I can move the points, create some new line attachment points, create lines in-between and validate.
The glider is displayed with the change in the lines.

But the others menu I mentioned just show an error and the glider disappears.
Please try this code-snippets in the console of FreeCAD. Both methods should create a new scene with a cone. For me both methods work:

Code: Select all

import FreeCAD as App
import FreeCADGui as Gui
from pivy import coin

App.newDocument()
class Container(coin.SoSeparator):
    def __init__(self):
        super(Container, self).__init__()

a = Container()
a += [coin.SoCone()]
sg = Gui.ActiveDocument.ActiveView.getSceneGraph()
sg += a

Code: Select all

import FreeCAD as App
import FreeCADGui as Gui
from pivy import coin

App.newDocument()
class Container(coin.SoSeparator):
    def __init__(self):
        super(Container, self).__init__()
        self += [coin.SoCone()]

a = Container()
sg = Gui.ActiveDocument.ActiveView.getSceneGraph()
sg += a
Mx74
Posts: 22
Joined: Fri Dec 08, 2017 12:39 pm

Re: glider workbench

Postby Mx74 » Thu Mar 29, 2018 9:18 am

And for me both fail with exactly the same error:

Code: Select all

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/usr/lib/freecad-daily/Mod/freecad/freecad_glider/tools/_tools.py", line 16, in SoGroup__iadd__
    raise(AttributeError('rhs must be list'))
AttributeError: rhs must be list
looo
Posts: 2655
Joined: Mon Nov 11, 2013 5:29 pm

Re: glider workbench

Postby looo » Thu Mar 29, 2018 11:18 am

sry, there are some inconsistency between pivy and a freecad-glider monkey patch, which were not allowing the function to work if freecad-glider workbench was activated. I edited the tests. Please try again.

Code: Select all

import FreeCAD as App
import FreeCADGui as Gui
from pivy import coin

App.newDocument()
class Container(coin.SoSeparator):
    def __init__(self):
        super(Container, self).__init__()

a = Container()
a += [coin.SoCone()]
sg = Gui.ActiveDocument.ActiveView.getSceneGraph()
sg += [a]

Code: Select all

import FreeCAD as App
import FreeCADGui as Gui
from pivy import coin

App.newDocument()
class Container(coin.SoSeparator):
    def __init__(self):
        super(Container, self).__init__()
        self += [coin.SoCone()]

a = Container()
sg = Gui.ActiveDocument.ActiveView.getSceneGraph()
sg += [a]
Mx74
Posts: 22
Joined: Fri Dec 08, 2017 12:39 pm

Re: glider workbench

Postby Mx74 » Thu Mar 29, 2018 11:59 am

Both fail too, with the same error message:

Code: Select all

Traceback (most recent call last):
  File "<input>", line 1, in <module>
TypeError: unsupported operand type(s) for +=: 'SoSeparator' and 'list'
looo
Posts: 2655
Joined: Mon Nov 11, 2013 5:29 pm

Re: glider workbench

Postby looo » Thu Mar 29, 2018 12:30 pm

ok, I assume this time you haven't opened the glider-workbench before you run the two tests. So this shows, that you are still using the system pivy. So I guess something went wrong with the installation of pivy.

Maybe you can find which pivy is used. Maybe there are two pivy packages installed on your system...

Code: Select all

import pivy
pivy.__file__
Mx74
Posts: 22
Joined: Fri Dec 08, 2017 12:39 pm

Re: glider workbench

Postby Mx74 » Thu Mar 29, 2018 2:13 pm

Oh, yes, sorry, I haven't open the glider workbench before.
Both solution works now.

your last test gives "'/usr/lib/python2.7/dist-packages/pivy/__init__.pyc'"
looo
Posts: 2655
Joined: Mon Nov 11, 2013 5:29 pm

Re: glider workbench

Postby looo » Thu Mar 29, 2018 2:27 pm

can you have a look if there is another pivy:

Code: Select all

locate pivy |grep __init__.py
or looking into the following directories:
/usr/local/lib/python2.7/site-packages
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/site-packages
~/.local/lib/site-packages
~/.local/lib/dist-packages

The easier way is to redo the pivy installation and post the full output.
Mx74
Posts: 22
Joined: Fri Dec 08, 2017 12:39 pm

Re: glider workbench

Postby Mx74 » Fri Mar 30, 2018 7:59 am

Only one installation of pivy, this i'm sure as I started again with a fresh install.

Looo... I'm confused.
I had to switch off my computer this morning, and after reboot, now everything works...
I did restart freecad, the session, but not the computer itself. Weird.

I'm really really sorry for the loss of time.
looo
Posts: 2655
Joined: Mon Nov 11, 2013 5:29 pm

Re: glider workbench

Postby looo » Fri Mar 30, 2018 8:49 am

no problem. It is known that the installation of this workbench is difficult ;)
Any feedback is welcome.
Mx74
Posts: 22
Joined: Fri Dec 08, 2017 12:39 pm

Re: glider workbench

Postby Mx74 » Fri Mar 30, 2018 9:42 am

Yes, it's not the easiest one :-)
Again many many thanks for your help.

For questions about its use, should I ask here or create another topic?
Or somewhere else?

As you guessed, I'm not a developer, so i can't really help coding, but if I may help help in any way, ask me.
If I'm able to do it, that would be a pleasure.