surface flattening

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: surface flattening

Post by sgrogan »

looo wrote: Tue May 01, 2018 7:30 pm Can you explain why vs2015 is no option currently for you... I don't see any big show stoppers.
Building the whole .debug Libpack?
wmayer wrote: Tue May 01, 2018 5:00 pm C:/Projects/FreeCADLibs_12.0_x64_VC12
Are you using QT5 as well?
"fight the good fight"
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: surface flattening

Post by wmayer »

Ah you are right. I forgot about this hurdle.
Can you explain why vs2015 is no option currently for you... I don't see any big show stoppers.
Building the libpack is one thing. It requires a lot of time and memory, e.g. only building Qt5 takes a full day and needs 60GB. Then IMO we should try to support older compiler versions as long as possible and I don't see why for a single class I should upgrade to msvc14.
Hmm I have to say, that I do not like the double effort to create the bindings. Any change has to be done on both bindings...
Such solution is not very clean in my eyes. I think it's better to disable the flatmesh library if no pybind11 is available.
I got it already working for Part faces with almost no effort, it's only for meshes where I have problems.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: surface flattening

Post by looo »

I got it already working for Part faces with almost no effort, it's only for meshes where I have problems.
I guess adding the gui-commands with c++ is the easier solution to make this functionality available without pybind11. It was only my lack of c++ knowledge, why I have chosen to use python for the gui...
Then IMO we should try to support older compiler versions as long as possible and I don't see why for a single class I should upgrade to msvc14.
I am just saying to not support the flatmesh for builds without pybind11. I am not saying we have to move to newer compilers. I don't want to make building/developing for FreeCAD more difficult, and I don't want to develop the boost-python bindings, if I change anything inside this library.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: surface flattening

Post by wmayer »

I guess adding the gui-commands with c++ is the easier solution to make this functionality available without pybind11. It was only my lack of c++ knowledge, why I have chosen to use python for the gui...
On the other hand having a Python binding is always good because:
1. the GUI actions are macro recordable
2. it helps to reduce or avoid hard dependencies at build time.
I am just saying to not support the flatmesh for builds without pybind11. I am not saying we have to move to newer compilers. I don't want to make building/developing for FreeCAD more difficult, and I don't want to develop the boost-python bindings, if I change anything inside this library.
Well, for me the main point was to see what the result of the flattening will be and due to the lack of C++14 support I used boost.python as alternative. Also, I never used boost.python before and it is a good opportunity to get familiar with it a bit.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: surface flattening

Post by looo »

On the other hand having a Python binding is always good because:
1. the GUI actions are macro recordable
2. it helps to reduce or avoid hard dependencies at build time.
nice to know.


I have experienced build difficulties with boost-python already, and I am not the biggest fan of this library...
Anyway, in my eyes adding support for numpy<->eigen wrapping with pycxx would be the ideal solution. (Pybind11 / boost-python adds quite some memory/cpu usage...)
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: surface flattening

Post by looo »

swig would be another option:
https://github.com/rdeits/swig-eigen-numpy
cython has also an extension to wrap eigen <-> numpy
https://github.com/wouterboomsma/eigency
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: surface flattening

Post by wmayer »

I have experienced build difficulties with boost-python already, and I am not the biggest fan of this library...
Do you mean to build boost.python or using the library? At least with version 1.67 we recently also had a problem to detect it via cmake because now the component name must include Python's version number, i.e. instead of writing

Code: Select all

find_package( Boost COMPONENTS python REQUIRED)
you must write

Code: Select all

find_package( Boost COMPONENTS python36 REQUIRED)
.

But I am not a big fan either. Once we started to implement the Python bindings for the most important C++ classes in FreeCAD boost.python was considered as an option but decided against it because it's known to create bloated executables due to heavy use of templates and that the build process takes considerably more time. Also, in many cases we don't want to have a 1:1 interface of C++ and Python class. Thus, we decided to implement our own little framework where we have full control and flexibility.
Anyway, in my eyes adding support for numpy<->eigen wrapping with pycxx would be the ideal solution.
Indeed that would be great.
User avatar
kkremitzki
Veteran
Posts: 2511
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: surface flattening

Post by kkremitzki »

BTW pybind11 2.2.2 just migrated to Debian Testing so with all likelihood it'll be in Ubuntu 18.10.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: surface flattening

Post by looo »

Do you mean to build boost.python or using the library?
using the library. pybind11 is much simpler because it is header only.
indeed that would be great.
any ideas where to start?
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: surface flattening

Post by wmayer »

any ideas where to start?
No, I first have to have a closer look at the offered solutions.
Post Reply