FreeCad crash using Thickness on a Loft with elliptic section

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
wschildbach
Posts: 8
Joined: Thu Feb 01, 2018 11:20 pm

FreeCad crash using Thickness on a Loft with elliptic section

Postby wschildbach » Tue Mar 03, 2020 8:43 pm

I am reporting what I believe to be a Freecad bug here to get a) confirmation this is a bug before entering into Mantis b) in the hopes of finding general advice on how to avoid trouble using the Thickness tool in non-pathological situations.

What I found is that making a loft in the part design workbench involving an ellipse, and then applying thickness on the loft, results in "surprising" behavior. The attached file contains a loft from a circle ("bottom" sketch) to an ellipse ("top" sketch). Both sketches are fully constrained.
shelltest.png
shelltest.png (56.05 KiB) Viewed 286 times
The top ellipse can be turned (through an angular constraint) around its center. Whatever the angle, the actual body should be identical (disregarding a rotation).

If the top ellipse is constrained to be either (sketch-)horizontal (angle = 0) or vertical (angle = 90), then a thickness operation (selecting the top face first) succeeds.
If the top ellipse is turned to 45 degrees, then the thickness operation fails with the dreaded message

"0 <App> Document.cpp(3464): Failed to recompute shelltest3#Thickness: BRep_API: command not done
Recompute failed! Please check report view."

I guess this is an OCC problem, which I understand FreeCad devs cannot do anything about. Is there any general guidance ("avoid overlapping split lines") that might save the thickness operation?

Now on to the actual bug, if I turn the ellipse to 89 degrees, then FreeCad crashes. Should I report this as a bug in Mantis? I have seen https://tracker.freecadweb.org/view.php?id=4262 but that bug apparently involves pathological geometry so may or may not have the same root cause.

I ran into this while trying to make a somewhat more complex model (the body/hull of a glider plane); I don't think there is any easy way to replace thickness which is why I really need the thickness operation to succeed (rather than other workarounds).

Here is the example file:
shelltest3.FCStd
(21.21 KiB) Downloaded 11 times
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19694 (Git)
Build type: Release
Branch: master
Hash: 288456ee4beb9e8dc27d50a7984c40c45467161f
Python version: 3.7.3
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
wschildbach
Posts: 8
Joined: Thu Feb 01, 2018 11:20 pm

Re: FreeCad crash using Thickness on a Loft with elliptic section

Postby wschildbach » Tue Mar 03, 2020 8:59 pm

PS: I understand that the Thickness tool is rather buggy so don't really expect to get a solution :cry:

This post https://forum.freecadweb.org/viewtopic.php?t=27708 has also reported crashes on the thickness operation.
chrisb
Posts: 30661
Joined: Tue Mar 17, 2015 9:14 am

Re: FreeCad crash using Thickness on a Loft with elliptic section

Postby chrisb » Tue Mar 03, 2020 11:59 pm

Thicknes fails with a value of 1.0, it works with 0.9 and 0.8, and fails again with 0.7. If it fails it doesn't crash, it shows a message in report view instead.

OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19717 (Git)
Build type: Release
Branch: master
Hash: 43e6be9020199e6453653e1b041679679efee574
Python version: 3.8.1
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: C/Default (C)
You need at least FreeCAD 0.19.23300 to edit my current sketches.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
papyblaise
Posts: 2871
Joined: Thu Jun 13, 2019 4:28 pm
Location: France

Re: FreeCad crash using Thickness on a Loft with elliptic section

Postby papyblaise » Wed Mar 04, 2020 7:49 am

Why you turn the elips at 45° : it generate 2 generatrices
pass at 0 (parallel at X) , all it's Ok
Attachments
elips.PNG
elips.PNG (66.03 KiB) Viewed 249 times
wschildbach
Posts: 8
Joined: Thu Feb 01, 2018 11:20 pm

Re: FreeCad crash using Thickness on a Loft with elliptic section

Postby wschildbach » Wed Mar 04, 2020 9:10 am

papyblaise wrote:
Wed Mar 04, 2020 7:49 am
Why you turn the elips at 45° : it generate 2 generatrices
pass at 0 (parallel at X) , all it's Ok
Yes indeed, 0 and 90 degrees work, 45 throws an error message and 89 crashes Freecad.

This is just an example file, and there is indeed no purpose of the angle=45 other than showing that (seemingly) identical geometrical bodies can make the thickness command react in very different ways.

I am interested though in what you write about generatrices --
a) is there anywhere where I can read up on what a generatrix is, and what role it plays in constructions and the loft in particular?
b) specifically, it seems that when generatrices coincide in a construction, that is asking for trouble (read this in a different post that I can't find right now). Is there any more wisdom on this?

Thanks for your help.

- Wolfgang
l3VGV
Posts: 36
Joined: Sat Oct 12, 2019 11:04 am

Re: FreeCad crash using Thickness on a Loft with elliptic section

Postby l3VGV » Wed Mar 04, 2020 9:34 am

Basically - everything involving bsplines or curved surfaces in any way, will produce strange behavior or crash.

Here is my experience with thickness https://forum.freecadweb.org/viewtopic.php?f=3&t=43458
User avatar
papyblaise
Posts: 2871
Joined: Thu Jun 13, 2019 4:28 pm
Location: France

Re: FreeCad crash using Thickness on a Loft with elliptic section

Postby papyblaise » Wed Mar 04, 2020 12:22 pm

There are no general rules,
you can read in the forum that you must have the same number of segments between a base and the other with connection points in parallel planes (which will generate common generators), and there are exceptions,
you can also read that the loft generates B-spline that Fc manages very badly, and there are exceptions
you can read that shells go better inside than outside, and there are exceptions
with all these exceptions, only a try will tell you if it's ok
otherwise you have to find a workaround: make a 1/2 shell, or make an extrusion of 2 faces with an outside outline and an inside, or do a boolean subtraction of the outside volume minus a scaled clone, or do a reduced inside volume of the thickness to keep and booleen subtraction
you have a lot of solution, you have to find the right one and there are no general rules, they all have advantages and disadvantages, and vice versa
wschildbach
Posts: 8
Joined: Thu Feb 01, 2018 11:20 pm

Re: FreeCad crash using Thickness on a Loft with elliptic section

Postby wschildbach » Thu Mar 05, 2020 7:35 am

Thanks @chrisb for the bug confirmation and @papyblaise for the general advice / hints. What I take away from this is
  • stay away from Thickness when the Part has any curved surfaces (i.e., Lofts in particular)
  • The problem is in the OCC kernel; and the crash happens there, too. Besides catching/masking the fault and exiting gracefully, FreeCad can 't do much about it
  • I won't be reporting a bug as there are a number of other bug reports in Mantis already that have that same solution (catching the fault)
Cheers
- Wolfgang
chrisb wrote:
Tue Mar 03, 2020 11:59 pm
papyblaise wrote:
Wed Mar 04, 2020 12:22 pm
chrisb
Posts: 30661
Joined: Tue Mar 17, 2015 9:14 am

Re: FreeCad crash using Thickness on a Loft with elliptic section

Postby chrisb » Thu Mar 05, 2020 7:45 am

wschildbach wrote:
Thu Mar 05, 2020 7:35 am
I won't be reporting a bug as there are a number of other bug reports in Mantis already that have that same solution (catching the fault)
Good idea not to spoil the tracker. The real problem, that it doesn't work can't be fixed anyway by the FreeCAD team.
You need at least FreeCAD 0.19.23300 to edit my current sketches.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.