Code: Select all
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
first find ... it is not possible to load a saved file. Not one saved with master not one saved with this branch.
eivindkvedalen wrote: ping
Rebased on current master: https://github.com/eivindkv/FreeCAD/tree/Material2bernd wrote: ↑Wed Feb 27, 2019 5:17 pmhttps://github.com/berndhahnebach/FreeC ... rialeivind
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.
eivindkvedalen wrote: ↑Sun Aug 21, 2016 8:19 amThings more or less done:
- Added a MaterialDatabase class. This is the collection of various sources described below. Material queries happens from this database.
- Added a DefaultMaterialSource class. This source is read-only and contains the original pre-defined materials that could be selected in FreeCAD. It also contains a DEFAULT material, that all other materials can inherit from, to ensure that visual properties are defined.
- Added a DocumentMaterialSource class. Per-document materials are stored here. If visualization materials are changed, a copy is stored here.
- Added a FileMaterialSource class. FCMat materials cards are provided by this source. Multiple sources may be added (system/user).
- Added a PropertyPartMaterial class. This class and its helper classes encapsulates materials for solids and surfaces.
- Added a PropertyPartMaterial member Material to Part::Feature, along with its Shape.
I've been focusing on the data structure part now; almost nothing is done on the Gui part, except propagating material colors from the Material property to the view provider, so the colors of the parts change.
I have also added a Python interface (this is what I actually use for testing), and a typical use-case could be:
This will assign the PLA material to solid 0 of Box. Properties can then be queried, e.gCode: Select all
App.ActiveDocument.Box.Material.setSolidMaterial(0, "PLA");
Surface materials are accessed as e.gCode: Select all
App.ActiveDocument.Box.Material.Solid[0].YoungsModulus
(provided that Solid[0] has been set first).Code: Select all
App.ActiveDocument.Box.Material.Solid[0].setSurfaceMaterial(0, "GOLD")
The material databases are accessed either atorCode: Select all
App.getMaterialDatabase()
(ideally they should have the same syntax; something for later). The material database in App is the application-wide database, so adding/removing/editing materials should be possible to do without an open document. The material database in the document links to the application-wide one, but also provides a private material source for materials specific for the document.Code: Select all
doc.MaterialDatabase
The file-based materials are supposed to be in either
orCode: Select all
getResourceDir() + "/Mod/Material/StandardMaterial"
Code: Select all
getUserAppDataDir() + "Materials"
I discovered that as well, and I'm looking into it now...