Material improvements

Apologies for the delay - I’ve rebased Eivind’s work on to the latest master at https://github.com/ianrrees/FreeCAD_tinkering/commits/20170226-material2-rebase . Haven’t been able to compile it yet, as my machine is only setup for building against Python 3 at the moment, which wasn’t supported by the old branch.

OK, I’ve got a compile (pushed a few fixes to my branch), but am running in to a crash on startup, which seems to relate to initialising Python types. I’m really rusty in this area, and can’t see an easy solution:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff54eab38 in PyUnicode_InternInPlace () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
(gdb) bt
#0  0x00007ffff54eab38 in PyUnicode_InternInPlace () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
#1  0x00007ffff54eac0d in PyUnicode_InternFromString () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
#2  0x00007ffff5595545 in PyType_Ready () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
#3  0x00007ffff5597408 in PyType_Ready () from /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
#4  0x00007ffff5b0fac2 in Py::PythonType::readyType (this=0x5555557b60f0)
    at /home/irees/Projects/freecad-code/src/CXX/Python3/cxx_extensions.cxx:283
#5  0x00007ffff64866e3 in Py::SolidMaterialArray::init_type ()
    at /home/irees/Projects/freecad-code/src/App/PropertyPartMaterial.cpp:321
#6  0x00007ffff64860f4 in Py::PropertyPartMaterial::init_type ()
    at /home/irees/Projects/freecad-code/src/App/PropertyPartMaterial.cpp:423
#7  0x00007ffff64d4615 in App::Application::initTypes ()
    at /home/irees/Projects/freecad-code/src/App/Application.cpp:1359
#8  0x00007ffff64d4421 in App::Application::init (argc=1, argv=0x7fffffffdbe8)
    at /home/irees/Projects/freecad-code/src/App/Application.cpp:1253
#9  0x000055555555c38e in main (argc=1, argv=0x7fffffffdbe8)
    at /home/irees/Projects/freecad-code/src/Main/MainGui.cpp:192

Great :smiley: compiles and starts for me on Python2 . It even rebases on the latest commits from master

OS: Debian GNU/Linux 9.5 (stretch)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14805 (Git)
Build type: Unknown
Branch: materialian2
Hash: e16950459ae4e9c8e9ffd3852f8ccbe017443d01
Python version: 2.7.13
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
Locale: German/Switzerland (de_CH)


first find … it is not possible to load a saved file. Not one saved with master not one saved with this branch.

It still rebases on master https://github.com/berndhahnebach/FreeCAD_bhb/commits/materialian

but still the problems resist …

first find … it is not possible to load a saved file. Not one saved with master not one saved with this branch.

https://github.com/berndhahnebach/FreeCAD_bhb/commits/materialeivind

still rebases, but not the material editor ui, but this is no that important. C++ code is still not finished. It would be a pitty if this development would be for trash eventually.


Rebased on current master: https://github.com/eivindkv/FreeCAD/tree/Material2

It compiles, and it didn’t crash when I opened a file :slight_smile:

Eivind

Great! it is compiling … Seams yor are still on Python2 At the moment I switched back to Py2 too because I had some compile error on Py3. I well report back.

Just a quote from eivind an ealier post to know what is this branch about:



with Python2 and Qt5 I am able to compile this branch. But as soon as an object which has a Shape property is created FreeCAD crashes. Files with meshes or for example an FEM file without the shape saves and reopens fine.

OS: Debian GNU/Linux buster/sid (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16369 (Git)
Build type: Unknown
Branch: materialeivind
Hash: 159b004261e6fc932af376978710911aee26fc4e
Python version: 2.7.16rc1
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Switzerland (de_CH)

I discovered that as well, and I’m looking into it now…

Eivind

https://github.com/FreeCAD/FreeCAD/pull/2102 see 3651b9b8 add basic card handling. Far far from your development but much better than we had.

If you find a minute it still would be cool to get it at least working without crash.

bernd

I tried compiling the Material fork too. The compiling rebased to upstream worked well for Python3 and Qt5.
But starting the application results in a crash in PropertyPartMaterial.cpp in function SolidMaterialArray::init_type()

  1. Py::PropertyPartMaterial        ::init_type(); from Application.cpp
    
  2. SolidMaterialArray::init_type(); line 423 from PropertyPartMaterial.cpp
  3.     behaviors().readyType(); line 321 from PropertyPartMaterial.cpp
    

Because the coupling C++ to Python is new to me, I have to discover this for a while…

Dietmar

Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x37840) [0x7f7a29a44840]
#1  /lib/x86_64-linux-gnu/libpython3.7m.so.1.0(PyTuple_New+0xf7) [0x7f7a2c12e427]
#2  /lib/x86_64-linux-gnu/libpython3.7m.so.1.0(PyType_Ready+0x1ab2) [0x7f7a2bf8eb62]
#3  /lib/x86_64-linux-gnu/libpython3.7m.so.1.0(PyType_Ready+0x1ee8) [0x7f7a2bf8ef98]
#4  0x7f7a2c90dd7e in Py::PythonType::readyType() from /home/dietmar/Code/FreeCAD/freecad-build-master/lib/libFreeCADBase.so+0x1c
#5  0x7f7a2d2c494e in Py::SolidMaterialArray::init_type() from /home/dietmar/Code/FreeCAD/freecad-build-master/lib/libFreeCADApp.so+0x69
#6  0x7f7a2d2c43d0 in Py::PropertyPartMaterial::init_type() from /home/dietmar/Code/FreeCAD/freecad-build-master/lib/libFreeCADApp.so+0x16
#7  0x7f7a2d313480 in App::Application::initTypes() from /home/dietmar/Code/FreeCAD/freecad-build-master/lib/libFreeCADApp.so+0x1a0
#8  0x7f7a2d31329b in App::Application::init(int, char**) from /home/dietmar/Code/FreeCAD/freecad-build-master/lib/libFreeCADApp.so+0x35
#9  /home/dietmar/Code/FreeCAD/freecad-build-master/bin/FreeCAD(main+0x6b8) [0x562b10108cb7]
#10  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb) [0x7f7a29a3109b]
#11  /home/dietmar/Code/FreeCAD/freecad-build-master/bin/FreeCAD(_start+0x2a) [0x562b101084ca]
*** Beendet mit Rückgabewert: 01 ***

Since I am a Python guy I am not of a big help here. That is the main reason nothing has been fixed in this branch, because IMHO the would be a big step forward in materials in FreeCAD.

Best to do is to encapsulate the problem and ask a specific question in developer part of the forum. For sure I will help with testing if you would do further developing.

bernd

Ok, I will do so

The big App::Link merge has taken place. On rebase I get merge conflicts in a few files:

       von beiden geändert:    src/App/DynamicProperty.cpp
        von beiden geändert:    src/App/DynamicProperty.h
        von beiden geändert:    src/App/Property.h
        von beiden geändert:    src/App/PropertyExpressionEngine.cpp
        von beiden geändert:    src/App/PropertyStandard.cpp
        von beiden geändert:    src/Mod/Spreadsheet/App/Cell.cpp

If you are still on this it might makes sense to rebase to up to date master.

Something for this weekend…

I managed to compile it on a rebased master today.

Eivind

:slight_smile: wow which branch on https://github.com/eivindkv/FreeCAD? On Py2 or Py3?

How about this ?


Off-topic, but just wanted to say, Nice to see you :wave:

:wave: :smiley:

Eivind