[bug 4543] [crash] on applying fillet or chamfer

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!
User avatar
uwestoehr
Posts: 2677
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

[bug 4543] [crash] on applying fillet or chamfer

Postby uwestoehr » Thu Jan 14, 2021 2:55 pm

I get crashes on applying fillets. Maybe it is an OCC but, thus the question if anybody can reproduce this.

- take this example file:
Crash-MA-V1.FCStd
testcase
(127.36 KiB) Downloaded 41 times
- follow these steps:
5i7D9wFm0u.gif
screencast
5i7D9wFm0u.gif (267.94 KiB) Viewed 499 times

It is important to use the "Left" view then select the lower right edge as in the screencast (Edge 25), with other edges it won't crash.

EDIT: The crash also occurs when I apply a chamfer to this edge.

OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23704 (Git)
Build type: Release
Branch: master
Hash: 33ec7fb3e72d6817e7f09216f9b334e5defa9443
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: German/Germany (de_DE)
Last edited by uwestoehr on Mon Jan 25, 2021 2:38 am, edited 1 time in total.
User avatar
papyblaise
Posts: 3323
Joined: Thu Jun 13, 2019 4:28 pm
Location: France

Re: [crash] on applying fillet or chamfer

Postby papyblaise » Thu Jan 14, 2021 3:30 pm

You have to better constrain your sketches
you want to have coplanar faces (I think) so the faces must be connected without steps
and do "refine = true"
Attachments
fillet done.FCStd
(84.03 KiB) Downloaded 5 times
fillet.PNG
fillet.PNG (111.37 KiB) Viewed 481 times
kisolre
Posts: 3158
Joined: Wed Nov 21, 2018 1:13 pm

Re: [crash] on applying fillet or chamfer

Postby kisolre » Thu Jan 14, 2021 3:45 pm

Fillets follow tangent edges. Here the next edge from the previous fillet ends tangent to bottom surface and can not be filleted. Reversing the order of fillets should work. Of course crashing OCC should not crash FreeCAD but that is another topic.
User avatar
uwestoehr
Posts: 2677
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: [crash] on applying fillet or chamfer

Postby uwestoehr » Thu Jan 14, 2021 5:07 pm

kisolre wrote:
Thu Jan 14, 2021 3:45 pm
Of course crashing OCC should not crash FreeCAD but that is another topic.
I don't understand. The fillet is possible, I just filleted another edge, then I can fillet the problematic edge in a second fillet step without problems:
FreeCAD_Co58CL6EEw.png
FreeCAD_Co58CL6EEw.png (275.59 KiB) Viewed 447 times
(This trick works always for me when I see that a 0.1 mm fillet cannot be applied.)

What I don't understand is why FC crashes. So as you wrote, even when OCC crashes, FC must not crash too but issue an error message. And here I see an illegal storage access so the question is what storage is accesses that probably does no longer exists.
User avatar
uwestoehr
Posts: 2677
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: [crash] on applying fillet or chamfer

Postby uwestoehr » Mon Jan 25, 2021 2:38 am

I reported this now as issue #4543 since when working a lot with fillets you get crashes all the times making it very frustrating to work with FC.
User avatar
chennes
Posts: 831
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: [crash] on applying fillet or chamfer

Postby chennes » Mon Jan 25, 2021 4:28 pm

uwestoehr wrote:
Mon Jan 25, 2021 2:38 am
I reported this now as issue #4543 since when working a lot with fillets you get crashes all the times making it very frustrating to work with FC.
Have you done any looking into ways of resolving this? I don't want to duplicate efforts if you are already working on it.
Chris Hennes
Pioneer Library System
User avatar
uwestoehr
Posts: 2677
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: [crash] on applying fillet or chamfer

Postby uwestoehr » Mon Jan 25, 2021 4:41 pm

chennes wrote:
Mon Jan 25, 2021 4:28 pm
Have you done any looking into ways of resolving this? I don't want to duplicate efforts if you are already working on it.
No and I fear I won't find time soon. If you could have a look, I would be very happy. :D
chrisb
Posts: 33789
Joined: Tue Mar 17, 2015 9:14 am

Re: [crash] on applying fillet or chamfer

Postby chrisb » Mon Jan 25, 2021 9:31 pm

uwestoehr wrote:
Mon Jan 25, 2021 2:38 am
I reported this now as issue #4543
We have quite some tickets on crashes applying fillets. If I find the time I will check them for duplicates. I guess there is nothing special on this one?
In a comment from Werner he says that not much can be done. From another post which I couldn't find yet I remember that even for catching this error it needs a different architecture of calling the geometric kernel.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
chennes
Posts: 831
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: [crash] on applying fillet or chamfer

Postby chennes » Mon Jan 25, 2021 9:38 pm

chrisb wrote:
Mon Jan 25, 2021 9:31 pm
In a comment from Werner he says that not much can be done.
I am still buried in OCC code, but we certainly can't actually do anything about the bug itself. OCC is trying to find the edge where two faces mate together, at a point where it is guaranteed that the faces do mate, and the operation is failing to provide an edge. But the code simply assumes that it worked and goes forward. It may be that we can test for that failure manually before doing the fillet, I have not tried, and don't really know how.
Chris Hennes
Pioneer Library System
User avatar
uwestoehr
Posts: 2677
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: [crash] on applying fillet or chamfer

Postby uwestoehr » Mon Jan 25, 2021 10:00 pm

chennes wrote:
Mon Jan 25, 2021 9:38 pm
I am still buried in OCC code, but we certainly can't actually do anything about the bug itself.
Thanks for having a look.
Yes, as Werner said, the crash itself is in OCC and cannot be avoided. But what must be possible, I hope, is that FC can detect this crash.

It may be that we can test for that failure manually before doing the fillet
Yes, this was also my thought. OCC can fail so we must check if OCC could create the fillet and only then move on, otherwise abort/undo the operation.