Adding fillet in Part Design causes FreeCAD to crash

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!
Post Reply
User avatar
mfraz74
Posts: 161
Joined: Mon Apr 05, 2021 9:19 am
Contact:

Adding fillet in Part Design causes FreeCAD to crash

Post by mfraz74 »

Code: Select all

OS: Ubuntu 22.04.2 LTS (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.21.0.32457 (Git) AppImage
Build type: Release
Branch: master
Hash: 85216bd12730bbc4c3cbf8f0bc50416ab1556cbb
Python 3.10.9, Qt 5.15.8, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * sheetmetal 0.2.61
  * freecad.gears 1.0.0
  * Manipulator 1.5.0
  * lattice2 1.0.0
  * fcgear 1.0.0
  * Lithophane
  * Curves 0.6.8
  * Assembly4 0.12.4
  * kicadStepUpMod 10.17.1
  * InventorLoader 1.3.0
  * fasteners 0.4.55
  * A2plus 0.4.60k
  * QuickMeasure 2022.10.28
  * ThreadProfile 1.84.0
  * VendorParts
With the attached part, if I select any edge on Face4 such as Edges 3,6 or 9 and try to add a fillet FreeCAD with crash.

Running from the command line, I get this

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7f733c471520]
#1  0x7f731b8d6437 in TopLoc_Location::Multiplied(TopLoc_Location const&) const from /tmp/.mount_FreeCAMDmW6c/usr/lib/./libTKMath.so.7+0x17
#2  0x7f731c151c40 in BRep_Tool::Surface(TopoDS_Face const&, TopLoc_Location&) from /tmp/.mount_FreeCAMDmW6c/usr/lib/./libTKBRep.so.7+0x30
#3  0x7f731c166ca7 in BRepAdaptor_Surface::Initialize(TopoDS_Face const&, bool) from /tmp/.mount_FreeCAMDmW6c/usr/lib/./libTKBRep.so.7+0x97
#4  0x7f731de22541 in ChFi3d_Builder::StartSol(opencascade::handle<ChFiDS_Spine> const&, opencascade::handle<BRepAdaptor_Surface>&, gp_Pnt2d&, opencascade::handle<BRepAdaptor_Curve2d>&, double&, opencascade::handle<ChFiDS_SurfData> const&, bool, int, opencascade::handle<BRepAdaptor_Surface>&, opencascade::handle<BRepAdaptor_Curve2d>&, bool&, bool&, bool&, bool&, opencascade::handle<BRepAdaptor_Surface>&, gp_Pnt2d&, bool, TopoDS_Vertex const&) const from /tmp/.mount_FreeCAMDmW6c/usr/lib/./libTKFillet.so.7+0x931
#5  0x7f731de28c01 in ChFi3d_Builder::PerformSetOfSurfOnElSpine(opencascade::handle<ChFiDS_ElSpine> const&, opencascade::handle<ChFiDS_Stripe>&, opencascade::handle<BRepTopAdaptor_TopolTool>&, opencascade::handle<BRepTopAdaptor_TopolTool>&, bool) from /tmp/.mount_FreeCAMDmW6c/usr/lib/./libTKFillet.so.7+0xd91
#6  0x7f731de2add9 in ChFi3d_Builder::PerformSetOfKGen(opencascade::handle<ChFiDS_Stripe>&, bool) from /tmp/.mount_FreeCAMDmW6c/usr/lib/./libTKFillet.so.7+0x109
#7  0x7f731de3047a in ChFi3d_Builder::PerformSetOfSurf(opencascade::handle<ChFiDS_Stripe>&, bool) from /tmp/.mount_FreeCAMDmW6c/usr/lib/./libTKFillet.so.7+0x6a
#8  0x7f731ddf3797 in ChFi3d_Builder::Compute() from /tmp/.mount_FreeCAMDmW6c/usr/lib/./libTKFillet.so.7+0x437
#9  0x7f731df85bbe in BRepFilletAPI_MakeFillet::Build(Message_ProgressRange const&) from /tmp/.mount_FreeCAMDmW6c/usr/lib/./libTKFillet.so.7+0x2e
#10  0x7f72d0b5b4c4 in PartDesign::Fillet::execute() from /tmp/.mount_FreeCAMDmW6c/usr/lib/_PartDesign.so+0x9e4
#11  0x7f733dadfbd2 in App::DocumentObject::recompute() from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libFreeCADApp.so+0xc2
#12  0x7f731eedd7ba in Part::Feature::recompute() from /tmp/.mount_FreeCAMDmW6c/usr/lib/Part.so+0xa
#13  0x7f733da7363d in App::Document::_recomputeFeature(App::DocumentObject*) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libFreeCADApp.so+0x41d
#14  0x7f733dac15aa in App::Document::recompute(std::vector<App::DocumentObject*, std::allocator<App::DocumentObject*> > const&, bool, bool*, int) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libFreeCADApp.so+0xb4a
#15  0x7f733db48d8f in App::DocumentPy::recompute(_object*) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libFreeCADApp.so+0x2ff
#16  0x7f733db48eb9 in App::DocumentPy::staticCallback_recompute(_object*, _object*) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libFreeCADApp.so+0x29
#17  /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libpython3.10.so.1.0(+0x144308) [0x7f733dfa6308]
#18  /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libpython3.10.so.1.0(_PyObject_MakeTpCall+0x27b) [0x7f733df9f96b]
#19  /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libpython3.10.so.1.0(_PyEval_EvalFrameDefault+0x57e0) [0x7f733df9b710]
#20  /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libpython3.10.so.1.0(+0x1e05d2) [0x7f733e0425d2]
#21  /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libpython3.10.so.1.0(PyEval_EvalCode+0x8c) [0x7f733e04251c]
#22  /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libpython3.10.so.1.0(+0x2118a4) [0x7f733e0738a4]
#23  /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libpython3.10.so.1.0(+0x20c79b) [0x7f733e06e79b]
#24  /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libpython3.10.so.1.0(PyRun_StringFlags+0x7d) [0x7f733e0668ad]
#25  0x7f733d786d8c in Base::InterpreterSingleton::runString[abi:cxx11](char const*) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libFreeCADBase.so+0x6c
#26  0x7f733e72d445 in Gui::Command::_runCommand(char const*, int, Gui::Command::DoCmd_Type, char const*) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libFreeCADGui.so+0x95
#27  0x7f733e72d5d6 in Gui::Command::_doCommand(char const*, int, Gui::Command::DoCmd_Type, char const*, ...) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libFreeCADGui.so+0xe6
#28  0x7f733e72d6f5 in Gui::Command::updateActive() from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libFreeCADGui.so+0x45
#29  0x7f728bd1928e in finishFeature(Gui::Command const*, App::DocumentObject*, App::DocumentObject*, bool, bool) from /tmp/.mount_FreeCAMDmW6c/usr/lib/PartDesignGui.so+0x4de
#30  0x7f728bd1a82c in finishDressupFeature(Gui::Command const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Part::Feature*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) from /tmp/.mount_FreeCAMDmW6c/usr/lib/PartDesignGui.so+0x91c
#31  0x7f728bd2d288 in makeChamferOrFillet(Gui::Command*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) from /tmp/.mount_FreeCAMDmW6c/usr/lib/PartDesignGui.so+0x178
#32  0x7f728bd2d3f8 in CmdPartDesignFillet::activated(int) from /tmp/.mount_FreeCAMDmW6c/usr/lib/PartDesignGui.so+0x48
#33  0x7f733e7360f6 in Gui::Command::_invoke(int, bool) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libFreeCADGui.so+0x276
#34  0x7f733e7365c7 in Gui::Command::invoke(int, Gui::Command::TriggerSource) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libFreeCADGui.so+0x127
#35  /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Core.so.5(+0x1dff9b) [0x7f733ca3cf9b]
#36  0x7f733d26c136 in QAction::triggered(bool) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Widgets.so.5+0x32
#37  0x7f733d26dc20 in QAction::activate(QAction::ActionEvent) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Widgets.so.5+0xc6
#38  /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Widgets.so.5(+0x2036cb) [0x7f733d30a6cb]
#39  0x7f733d30a7a7 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Widgets.so.5+0x79
#40  0x7f733d3a30d0 in QToolButton::mouseReleaseEvent(QMouseEvent*) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Widgets.so.5+0xa
#41  0x7f733d29b202 in QWidget::event(QEvent*) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Widgets.so.5+0x134
#42  0x7f733d271087 in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Widgets.so.5+0xd9
#43  0x7f733d27536d in QApplication::notify(QObject*, QEvent*) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Widgets.so.5+0x663
#44  0x7f733e6e8479 in Gui::GUIApplication::notify(QObject*, QEvent*) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libFreeCADGui.so+0x99
#45  0x7f733ca1fa18 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Core.so.5+0x8e
#46  0x7f733d274981 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Widgets.so.5+0x283
#47  /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Widgets.so.5(+0x1a338d) [0x7f733d2aa38d]
#48  /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Widgets.so.5(+0x1a4505) [0x7f733d2ab505]
#49  0x7f733d271087 in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Widgets.so.5+0xd9
#50  0x7f733e6e8479 in Gui::GUIApplication::notify(QObject*, QEvent*) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libFreeCADGui.so+0x99
#51  0x7f733ca1fa18 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Core.so.5+0x8e
#52  0x7f733cdeb56e in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Gui.so.5+0x6b6
#53  0x7f733cdd8091 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Gui.so.5+0x57
#54  /tmp/.mount_FreeCAMDmW6c/usr/plugins/platforms/../../lib/libQt5XcbQpa.so.5(+0x5672c) [0x7f733701c72c]
#55  /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/./libglib-2.0.so.0(g_main_context_dispatch+0x25c) [0x7f7338dd31bc]
#56  /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/./libglib-2.0.so.0(+0x58489) [0x7f7338dd3489]
#57  /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/./libglib-2.0.so.0(g_main_context_iteration+0x31) [0x7f7338dd3551]
#58  0x7f733ca50d50 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Core.so.5+0x5c
#59  0x7f733ca1d5d8 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Core.so.5+0x180
#60  0x7f733ca217af in QCoreApplication::exec() from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libQt5Core.so.5+0x107
#61  0x7f733e65bc49 in Gui::Application::runApplication() from /tmp/.mount_FreeCAMDmW6c/usr/bin/../lib/libFreeCADGui.so+0x22b9
#62  /tmp/.mount_FreeCAMDmW6c/usr/bin/freecad(+0x8a92) [0x55aafba62a92]
#63  /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7f733c458d90]
#64  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7f733c458e40]
#65  /tmp/.mount_FreeCAMDmW6c/usr/bin/freecad(+0x8de1) [0x55aafba62de1]
Attachments
Spool Roller Test.FCStd
(29.95 KiB) Downloaded 9 times
User avatar
papyblaise
Veteran
Posts: 8001
Joined: Thu Jun 13, 2019 4:28 pm
Location: France

Re: Adding fillet in Part Design causes FreeCAD to crash

Post by papyblaise »

there are 2 conditions:
make "Refine " = true so that the edge between the 2 Pads is really defined
the radius between the 2 pads must be less than the ecrat between the 2 (R=0.95mm max)
Attachments
test.JPG
test.JPG (34.6 KiB) Viewed 655 times
test.FCStd
(140.91 KiB) Downloaded 4 times
wieszak17
Posts: 250
Joined: Fri Jan 10, 2014 7:59 pm

Re: Adding fillet in Part Design causes FreeCAD to crash

Post by wieszak17 »

Fillets and Chamfers are often tricky operations. Problem is that OpeCascade kernel which FC uses for all work have trouble in some scenarios. Devs of OCC are improving it but goes slowly.

So for now you can only learn how to mitigate that problem. In your case problem is that fillet starts with 1mm radius as default, but 1mm is not allowed in your shape. Here is a trick you can use: select and edge where such radius is not a problem, start fillet tool, change radius to smaller radius (0.5mm works) then without closing tool add desired edges and remove that first added one. I know that it looks strange, but works ;-)

ADD: If you need to do fillet with bigger radius you need to change order of operations. First do Pad1, then fillet it as desired, then Pad and second fillet:

with 2mm radius:
test2.jpg
test2.jpg (22.13 KiB) Viewed 629 times
Spool Roller Test2.FCStd
(139.44 KiB) Downloaded 2 times
Last edited by wieszak17 on Sun Mar 26, 2023 8:54 am, edited 1 time in total.
User avatar
mfraz74
Posts: 161
Joined: Mon Apr 05, 2021 9:19 am
Contact:

Re: Adding fillet in Part Design causes FreeCAD to crash

Post by mfraz74 »

wieszak17 wrote: Sun Mar 26, 2023 8:39 am Fillets and Chamfers are often tricky operations. Problem is that OpeCascade kernel which FC uses for all work have trouble in some scenarios. Devs of OCC are improving it but goes slowly.

So for now you can only learn how to mitigate that problem. In your case problem is that fillet starts with 1mm radius as default, but 1mm is not allowed in your shape. Here is a trick you can use: select and edge where such radius is not a problem, start fillet tool, change radius to smaller radius (0.5mm works) then without closing tool add desired edges and remove that first added one. I know that it looks strange, but works ;-)
That's what I ended up doing, but normally FreeCAD will just bring up an error box rather than crashing.
wieszak17
Posts: 250
Joined: Fri Jan 10, 2014 7:59 pm

Re: Adding fillet in Part Design causes FreeCAD to crash

Post by wieszak17 »

It
mfraz74 wrote: Sun Mar 26, 2023 8:47 am That's what I ended up doing, but normally FreeCAD will just bring up an error box rather than crashing.
It is because OCC improves - more often OCC reports that it is not doable, so FC just not show preview of fillet. But still in some cases OCC crashes and FC can only do the same...
User avatar
onekk
Veteran
Posts: 6206
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Adding fillet in Part Design causes FreeCAD to crash

Post by onekk »

wieszak17 wrote: Sun Mar 26, 2023 8:39 am ...
Devs of OCC are improving it but goes slowly.
...
I will be happy if this is true, but from last information seen around, probably fillet code will be not improved as is old unmaintained code, and usually CADs that use OCCT will employ different functions to "make fillets".


Maybe @tanderson69 have some fresh information, and I will be very happy to be wrong.

Edit: Very happy to be wrong

Regards

Carlo D.
Last edited by onekk on Sun Mar 26, 2023 12:56 pm, edited 1 time in total.
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/
Syres
Veteran
Posts: 2899
Joined: Thu Aug 09, 2018 11:14 am

Re: Adding fillet in Part Design causes FreeCAD to crash

Post by Syres »

onekk wrote: Sun Mar 26, 2023 12:18 pm I will be happy if this is true, but from last information seen around, probably fillet code will be not improved as is old unmaintained code, and usually CADs that use OCCT will employ different functions to "make fillets".
Just look at the latest commits https://git.dev.opencascade.org/gitweb/ ... a=shortlog 5th one down
User avatar
papyblaise
Veteran
Posts: 8001
Joined: Thu Jun 13, 2019 4:28 pm
Location: France

Re: Adding fillet in Part Design causes FreeCAD to crash

Post by papyblaise »

another solution with variable R, using 2 profiles and an addPipe
Attachments
test2.JPG
test2.JPG (23.65 KiB) Viewed 495 times
test2.FCStd
(203.26 KiB) Downloaded 3 times
User avatar
mfraz74
Posts: 161
Joined: Mon Apr 05, 2021 9:19 am
Contact:

Re: Adding fillet in Part Design causes FreeCAD to crash

Post by mfraz74 »

This is what I've ended up with. Hoping this will work.
Screenshot_20230327_113428.png
Screenshot_20230327_113428.png (66.83 KiB) Viewed 402 times
User avatar
papyblaise
Veteran
Posts: 8001
Joined: Thu Jun 13, 2019 4:28 pm
Location: France

Re: Adding fillet in Part Design causes FreeCAD to crash

Post by papyblaise »

In my opinion, your departure is not good
start with the first horseshoe and make the nets, you can duplicate it to have the one that finishes
then make the center using the Pad tool in 2 directions
Attachments
testPPB.JPG
testPPB.JPG (32.96 KiB) Viewed 381 times
testPPB.FCStd
(60.49 KiB) Downloaded 3 times
Post Reply