Chamfer/Fillet crashes FreeCAD 0.19 on Windows 10.

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!
flynth
Posts: 22
Joined: Sun Dec 20, 2020 4:03 pm

Chamfer/Fillet crashes FreeCAD 0.19 on Windows 10.

Postby flynth » Sat Feb 13, 2021 1:44 pm

I'm using latest github release for Windows and I'm encountering a problem that looks like a bug.

Please let me know if I'm doing something wrong or should this be reported on the bug tracker.

I extracted the feature that causes the problem into a new document and I managed to replicate it there consistently. I'm attaching that document here. It is only a part of a larger model, but shows the problem.

I have a sketch like this:
1.png
1.png (259.47 KiB) Viewed 382 times
I have those construction lines there to constrain arcs in a way that doesn't brake when underlying dimensions change. If I simply constrain each arc point and its center this causes a problem described elsewhere. This is my current workaround. I hope it is not what causes the fillet to fail.

Then this is padded by 10mm.
2.png
2.png (223.82 KiB) Viewed 382 times
And finally if any of the top edges are selected and chamfer/fillet tool is used the part disappears and an error is shown on the bottom:
14:38:25 Illegal storage access...
14:38:25 <Exception> Illegal storage access! Please save your work under a new file name and restart the application!
It is also on the screenshot below:
3.png
3.png (185.25 KiB) Viewed 382 times
Additionally if the whole top face is selected and Chamfer/Fillet is pressed FreeCAD freezes for few seconds and crashes with no message.

This is my freecad version:
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23709 (Git)
Build type: Release
Branch: master
Hash: 625502bb4770e8bb0d3f4eb5e2150fa353c8c7fb
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
Attachments
broken.FCStd
(20.89 KiB) Downloaded 11 times
User avatar
papyblaise
Posts: 3323
Joined: Thu Jun 13, 2019 4:28 pm
Location: France

Re: Chamfer/Fillet crashes FreeCAD 0.19 on Windows 10.

Postby papyblaise » Sat Feb 13, 2021 3:16 pm

there are non-tangent points and very short segments which disturb the good execution of the fillet
Attachments
fillet.PNG
fillet.PNG (14.74 KiB) Viewed 368 times
fillet.FCStd
(36.3 KiB) Downloaded 9 times
chrisb
Posts: 33789
Joined: Tue Mar 17, 2015 9:14 am

Re: Chamfer/Fillet crashes FreeCAD 0.19 on Windows 10.

Postby chrisb » Sat Feb 13, 2021 4:02 pm

The solution is as described by papyblaise, However, you are not really using the latest 0.19, and since your version serious improvements have been made. They won't let the fillet succeed, but they sheuld keep FreeCAD from crashing.
Please update and report back.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
flynth
Posts: 22
Joined: Sun Dec 20, 2020 4:03 pm

Re: Chamfer/Fillet crashes FreeCAD 0.19 on Windows 10.

Postby flynth » Sat Feb 13, 2021 6:08 pm

papyblaise wrote:
Sat Feb 13, 2021 3:16 pm
there are non-tangent points and very short segments which disturb the good execution of the fillet
Thank you both. I opened those two files side by side in two instances of freecad to compare. I see the changes you made, but I'm not quite clear on their meaning. Could you comment on the below, please?

After removing two short lines you used tangent constraints to close resulting gaps. Those tangent constraints were used with two vertices each. I'm not sure how a vertex/point can be tangent to another vertex/point geometrically. It makes no sense to me when tangency is usually defined as meeting in one point in space while a vertex only has one point in space so being tangent to another point is exactly the same as being coincident...(but I'm no math phd) But then I tried to create two points in sketcher and give them a tangent constrain and I did get an expected error message saying "Cannot add a tangency constraint at an unconnected point." Ah, an unconnected point! So this means there is some concept of point to point tangency (I assume different than coincidence) if those points are final points of a line or curve. Again I can't differentiate (no pun intended :-) this concept from coincidence of final points in my head. Could you elaborate, or point me in a direction of some docs or previous discussions about this? Or at least tell me when to use one or another, please?

TLDR/ why tangent constrain and not coincident between same points?

Also you mentioned short sections may cause difficulty for fillet feature. I see you removed two short lines (one in larger sketch and one in left bottom corner of the small sketch). This changed the shape quite a bit. I have to match this shape exactly (or at least sufficiently closely that the difference is invisible to the naked eye) so I have to use some short sections. The question is how short is too short.

TLDR/ Is it because those sections were shorter than fillet radius?

Finally regarding testing with newer version. I'm compiling the latest version and I'll test once it is done.
flynth
Posts: 22
Joined: Sun Dec 20, 2020 4:03 pm

Re: Chamfer/Fillet crashes FreeCAD 0.19 on Windows 10.

Postby flynth » Sat Feb 13, 2021 6:29 pm

OK, I'm done compiling. I tested with the below version, Unfortunately it crashes too. The previous version crashed the first time I pressed fillet tool with the front face of the object selected. This new version didn't crash for the first time. However, when I cancelled and did it again it did crash.

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24047 (Git)
Build type: Release
Branch: master
Hash: 95fcaccfd807e321383be684b70a1e87f42915fe
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)


Also, I guess I can answer at least partially my own question (for anyone who encounters the same problem). I did succeed applying fillet to the entire face of the part as long as its radius was smaller or equal a quarter of length of the shortest line segment. The short line I have there is 0.2mm. Fillets with radius 0.05mm and under appear to work fine.

The tangency question remains, perhaps by changing those constraints it can be made to work with shorter lines, or it may be more resilient to dimension change, I don't know yet.
chrisb
Posts: 33789
Joined: Tue Mar 17, 2015 9:14 am

Re: Chamfer/Fillet crashes FreeCAD 0.19 on Windows 10.

Postby chrisb » Sat Feb 13, 2021 8:28 pm

flynth wrote:
Sat Feb 13, 2021 6:08 pm
Could you comment on the below, please?
The different modes of tangency are explained in the document linked in my signature.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
flynth
Posts: 22
Joined: Sun Dec 20, 2020 4:03 pm

Re: Chamfer/Fillet crashes FreeCAD 0.19 on Windows 10.

Postby flynth » Sun Feb 14, 2021 12:53 pm

chrisb wrote:
Sat Feb 13, 2021 8:28 pm
flynth wrote:
Sat Feb 13, 2021 6:08 pm
Could you comment on the below, please?
The different modes of tangency are explained in the document linked in my signature.
Thanks, the document is pretty good. It makes it clear that this kind of constraint(tangent between end points) is supposed to be used to fix lines to arcs if one wants a smooth connection. It seems the connection being smooth is a condition of fillet feature working correctly in FreeCAD(or underlying OCC).

Regarding crashing. I searched thee bug tracker and I found something that looks like the same bug https://tracker.freecadweb.org/view.php?id=4543. The entry in bug tracker says there is a patch that fixes this bug, but it is not integrated with the current master branch as (it is my understanding)it appears to be a bug in OCC.

Should I add the link to this thread to that bug in bug tracker so the person eventually testing the fix has another test file to test with?
chrisb
Posts: 33789
Joined: Tue Mar 17, 2015 9:14 am

Re: Chamfer/Fillet crashes FreeCAD 0.19 on Windows 10.

Postby chrisb » Sun Feb 14, 2021 3:35 pm

flynth wrote:
Sun Feb 14, 2021 12:53 pm
Should I add the link to this thread to that bug in bug tracker so the person eventually testing the fix has another test file to test with?
Yes please. This crash is different from the one in the tracker, which were about fillets reaching the next border
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.