Material improvements

A forum to discuss the implementation of a good Materials system in FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
eivindkvedalen
Posts: 602
Joined: Tue Jan 29, 2013 10:35 pm

Re: Material improvements

Post by eivindkvedalen »

bernd wrote: Wed Aug 28, 2019 10:45 am :) wow which branch on https://github.com/eivindkv/FreeCAD? On Py2 or Py3?

How about this ?

eivindkvedalen wrote: Tue Apr 02, 2019 6:54 pm
bernd wrote: Tue Apr 02, 2019 5:16 pm 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.
I discovered that as well, and I'm looking into it now...

Eivind
I haven't had time to clean up and push anything. I'll see if I get time to at least push something this weekend.

Eivind
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Material improvements

Post by bernd »

8-)
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Material improvements

Post by Kunda1 »

Related:
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Material improvements

Post by bernd »

eivindkvedalen wrote: Fri Aug 23, 2019 6:05 pm
bernd wrote: Mon Aug 19, 2019 5:21 am The big App::Link merge has taken place. On rebase I get merge conflicts in a few files:

Code: Select all

       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.
I managed to compile it on a rebased master today.

Eivind
eivindkvedalen wrote: Fri Sep 06, 2019 7:07 pm ... I haven't had time to clean up and push anything. I'll see if I get time to at least push something this weekend.
Eivind


Reminder.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Material improvements

Post by bernd »

eivind ...

would you make your latest dev public?
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Material improvements

Post by realthunder »

I didn't go through this entire thread. I jumped from here. Just to clarify some related issue about map accessing. The linked post uses Python code injection for map key retrieval, which has been removed during the big merge for obvious security reason. The current expression parser supports similar list/slice/map accessing syntax as Python. And it accepts expression as index or key. For example, the code in the linked post can be changed to (assuming 'Density' is a property of the current object)

Code: Select all

Panel014.Material.Material[.Density]
It can even be shortened to the following with some small modification to the 'Material' property (I don't know what type exactly), similar to the modification here to sketch's PropertyConstraintList.

Code: Select all

Panel014.Material[.Density]
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
eivindkvedalen
Posts: 602
Joined: Tue Jan 29, 2013 10:35 pm

Re: Material improvements

Post by eivindkvedalen »

bernd wrote: Mon Jan 20, 2020 8:58 pm eivind ...

would you make your latest dev public?
Something rebased on current master that compiles, but lacking both testing and features: https://github.com/eivindkv/FreeCAD/tre ... al_rebased

Eivind
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Material improvements

Post by bernd »

very cool :) just gave it a try ...

had a compile error on gcc on linux debian buster ...

Code: Select all

hugo@Ahorn:~/build$ make
[  0%] Built target MEFISTO2
[  1%] Built target SMDS
[  1%] Built target SMESHDS
[  1%] Built target Driver
[  2%] Built target DriverSTL
[  2%] Built target DriverDAT
[  2%] Built target DriverUNV
[  3%] Built target SMESH
[  5%] Built target StdMeshers
[  8%] Built target FreeCADBase
[  9%] Generating version_check
git
/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/src/Build/Version.h.out written
[  9%] Generating Version.h
[  9%] Built target fc_version
[  9%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/MaterialDatabase.cpp.o
/home/hugo/Documents/dev/freecad/freecadbhb_dev/freecad/src/App/MaterialDatabase.cpp: In static member function ‘static boost::any App::MaterialDatabase::python2string(const PyObject*)’:
/home/hugo/Documents/dev/freecad/freecadbhb_dev/freecad/src/App/MaterialDatabase.cpp:150:26: error: ‘PyString_AsString’ was not declared in this scope
     std::string string = PyString_AsString(unicode);
                          ^~~~~~~~~~~~~~~~~
/home/hugo/Documents/dev/freecad/freecadbhb_dev/freecad/src/App/MaterialDatabase.cpp:150:26: note: suggested alternative: ‘PyBytes_AsString’
     std::string string = PyString_AsString(unicode);
                          ^~~~~~~~~~~~~~~~~
                          PyBytes_AsString
make[2]: *** [src/App/CMakeFiles/FreeCADApp.dir/build.make:728: src/App/CMakeFiles/FreeCADApp.dir/MaterialDatabase.cpp.o] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:789: src/App/CMakeFiles/FreeCADApp.dir/all] Fehler 2
make: *** [Makefile:130: all] Fehler 2
hugo@Ahorn:~/build$ 
eivindkvedalen
Posts: 602
Joined: Tue Jan 29, 2013 10:35 pm

Re: Material improvements

Post by eivindkvedalen »

bernd wrote: Wed Mar 04, 2020 9:42 am very cool :) just gave it a try ...

had a compile error on gcc on linux debian buster ...
Probably a python 2/3 issue. I've made a change so please pull the branch again.

Eivind
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Material improvements

Post by bernd »

eivindkvedalen wrote: Wed Mar 04, 2020 7:54 pm
bernd wrote: Wed Mar 04, 2020 9:42 am had a compile error on gcc on linux debian buster ...
Probably a python 2/3 issue. I've made a change so please pull the branch again.
done. compiles on Debian Buster with Py3, but on startup ...

Code: Select all

hugo@Ahorn:~/Documents/dev/freecad/freecadbhb_dev/build$
hugo@Ahorn:~/Documents/dev/freecad/freecadbhb_dev/build$ ./bin/FreeCAD
Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x37840) [0x7f076e0e0840]
#1  /lib/x86_64-linux-gnu/libpython3.7m.so.1.0(PyTuple_New+0xf7) [0x7f0770969fb7]
#2  /lib/x86_64-linux-gnu/libpython3.7m.so.1.0(PyType_Ready+0x1ab2) [0x7f07707cab62]
#3  /lib/x86_64-linux-gnu/libpython3.7m.so.1.0(PyType_Ready+0x1ee8) [0x7f07707caf98]
#4  0x7f0771367f6e in Py::PythonType::readyType() from /home/hugo/Documents/dev/freecad/freecadbhb_dev/build/lib/libFreeCADBase.so+0x1c
#5  0x7f0772115d0b in Py::SolidMaterialArray::init_type() from /home/hugo/Documents/dev/freecad/freecadbhb_dev/build/lib/libFreeCADApp.so+0x46
#6  0x7f07721157b4 in Py::PropertyPartMaterial::init_type() from /home/hugo/Documents/dev/freecad/freecadbhb_dev/build/lib/libFreeCADApp.so+0x16
#7  0x7f077216aa71 in App::Application::initTypes() from /home/hugo/Documents/dev/freecad/freecadbhb_dev/build/lib/libFreeCADApp.so+0x1ff
#8  0x7f077216a82d in App::Application::init(int, char**) from /home/hugo/Documents/dev/freecad/freecadbhb_dev/build/lib/libFreeCADApp.so+0x35
#9  ./bin/FreeCAD(main+0x6ef) [0x556880aa3d29]
#10  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb) [0x7f076e0cd09b]
#11  ./bin/FreeCAD(_start+0x2a) [0x556880aa34ca]
hugo@Ahorn:~/Documents/dev/freecad/freecadbhb_dev/build$
Post Reply