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
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: surface flattening

Post by looo »

Yes, an updated eigen and pybind11 (also quite new) are necessary.

For conda it will be difficult to add back 32bit package. I learned to not swim against the grain. There are already too many problems when trying to follow the mainstream.
LibrEars
Posts: 29
Joined: Wed Apr 14, 2021 3:43 pm

Re: surface flattening

Post by LibrEars »

Just an update for people who want to use this awesome feature (thank you developers!). It is already included in FreeCAD 0.19. (at least for In Debian11) and you can find it in the mesh workbench (Meshes/Unwrap Face):

unwrap_face.png
unwrap_face.png (122.03 KiB) Viewed 1212 times
User avatar
jmr
Posts: 35
Joined: Fri Feb 09, 2018 3:32 pm

Re: surface flattening

Post by jmr »

looo wrote: Thu Apr 26, 2018 6:37 pm I uploaded conda-builds for linux and windows. These builds make the functionality available.

To build the flatmesh library you have to use pybind11 instead of boost-python.

edit: @sgrogan pybind11 is also available from pip.
Hi,
I use Slackware 14.2, and after last two days I finally got opencamlib for Path working, with FreeCAD-0.18.4 which does compile here. It seemed that I need Mesh WB for that but I do not, however I would like to get it working too. Possibly the last thing missing is the "flatmesh library" - i get the "flatmesh needs pybind11..." , pybind11 IS there, however there is no flatmesh python module. No mention on pypi.org too. Search engine responds with a lot of unrelated garbage... And You seem to have it installed by default. Where does it (flatmesh) come from? I don't think the 0.19 solves that by itself, does it? If you can get me the debian/ubuntu package name I will get the source and possibly another day full of dependencies and the it will then just work, along with FEM too.
Another question, is the current FreeCAD fully compatible with python3? Last time I tried, there were parts that were not (possibly from Path WB).
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: surface flattening

Post by onekk »

Yes it is compatible with Python3 but if you use outdated versions on distribution very conservative like Slackware probably the problem is not FreeCAD.

Regards.

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
jmr
Posts: 35
Joined: Fri Feb 09, 2018 3:32 pm

Re: surface flattening

Post by jmr »

yeah most likely it is not FreeCAD, its the depencencies... which are not always clearly labelled and pointed out during building. Another problem is less conservative search engines returning garbage when you try to look for "flatmesh", as the problem now seems to be directly related to "import flatmesh" returning error. pip search does not work either.
Can You look up on your distro what package does it come from?
Thanks
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: surface flattening

Post by onekk »

jmr wrote: Sun Dec 04, 2022 12:03 am ...
Can You look up on your distro what package does it come from?
Thanks
I'm actually using Arch Linux and usually I use an AppImage, plus, I'm using stable version so 0.20.1 to be short.

You have a specific need to use old versions?

Probably the most quick way is using a 0.20.1 AppImage (or wait as 0.20.2 point release is imminent).

Sadly different distributions use very different package names, Arch Linux use a different scheme fro Debian and so on, and as example make packages for pip packages too, I don't know if Slackware has similar packages, or if it rely on pip to install python packages, my Slackware use was short and has occurred probably more then a decade ago.

Maybe you could have more success if you make this question on the Install/Compile forum thread, as probably there "low level" technical informations are more taylored, than here.

But as said 0.18.4 and 0.19 are way too old.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: surface flattening

Post by looo »

jmr wrote: Sun Dec 04, 2022 12:03 am yeah most likely it is not FreeCAD, its the depencencies... which are not always clearly labelled and pointed out during building. Another problem is less conservative search engines returning garbage when you try to look for "flatmesh", as the problem now seems to be directly related to "import flatmesh" returning error. pip search does not work either.
Can You look up on your distro what package does it come from?
Thanks

flatmesh is a python module included in the freecad source. To enable it you have to set "-DBUILD_FLAT_MESH=TRUE" before building freecad from source: https://github.com/FreeCAD/FreeCAD/blob ... ts.txt#L96

flatmesh is in principal a LSCM (least-square-conformal-mapping [1]) algorithm to find a flat representation of a mesh + a fem relaxation algorithm to find a representation which minimize the stresses.

[1] https://members.loria.fr/Bruno.Levy/pap ... H_2002.pdf
User avatar
jmr
Posts: 35
Joined: Fri Feb 09, 2018 3:32 pm

Re: surface flattening

Post by jmr »

Thanks! That was what I was looking for. And really, out of all the garbage this topic was the only one serious search result. Mesh Design with Basic face unfolding now works.
But still... I get a segfault when doing Create mesh from shape, it has something to do with libMEFISTO which is also from FreeCAD. It does not look like something is missing now, it looks like an error... Segfault looks very much alike the one I get when doing the 3D surface - looks like it works for simple shapes, but those that have to be converted to a mesh trigger a problem. I will try to get the newest version to work now, as this may be fixed by now.
BTW I am using 0.18.4 just because it is stable on our production machine with linuxcnc where it relies on some of my ugly patches to do the job. It work since the time it was the freshest without an issue. Would not want to break that. Of course I am "trying" on a copy to get some more functionality (aka opencamlib with path...) but it seems now is the time to prepare an upgrade. Sadly Slackware 15.0 came out broken (WTF!?), X has serious issues on pre-core2duo 686, like Athlon XP which runs another machine with ISA I/O. I don't know if Patrick even cares about IA32 anymore... It just prints "illegal instruction" and it was supposed to be compiled for i586 i think... It was to be so good, with all the QT5 stuff correctly integrated :? Maybe 0.20.1 will still go on Slack 14.2, lets hope I will not run into glibc too old after a week or two of upgrades.
Assembly workbench is another thing I want to look into. Surely there was a lot going on when I was not looking, maybe when I get my patches to work again (I bet they will break) they will be good enough to upload as they are doing the job nicely. I should do a showcase of the machine, its a monster like this one: https://www.youtube.com/watch?v=immFI6vdk44
Post Reply