Fillet operation hangs windows

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
PJtraveler
Posts: 30
Joined: Mon Apr 23, 2018 2:57 pm

Fillet operation hangs windows

Post by PJtraveler »

Fillet operation hangs windows. See model and image for green edge that causes issue
Fillet op 2021-02-05_14-11-26.png
Fillet op 2021-02-05_14-11-26.png (176.43 KiB) Viewed 1760 times
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23756 (Git)
Build type: Release
Branch: master
Hash: 9c6e9184930a52b165a0b7274e3a45d1006bfe67
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
Attachments
Fuji Plate 5-straps offset.1.FCStd
(102.69 KiB) Downloaded 81 times
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Fillet operation hangs windows

Post by chrisb »

The problem is, that there isn't enough space for the Fillet starting with the 1mm default.

Workaround: Select some other edge where 1mm succeeds; change the radius to e.g. 0.4mm; add the edge you want to fillet; remove the helper edge.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Fillet operation hangs windows

Post by chennes »

There is also a replacement DLL that you can drop in to replace the existing TKFillet.dll. It won't make the 1mm fillet succeed, but it will prevent the crash when it fails.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Fillet operation hangs windows

Post by chrisb »

In this case it doesn't crash, it hangs.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Fillet operation hangs windows

Post by chennes »

chrisb wrote: Fri Feb 05, 2021 11:47 pm In this case it doesn't crash, it hangs.
Oops, right. And the problem is totally different, it's getting trapped in a function called FixIntersectingWires. The logic there is a little hard to follow, but it's almost like there's a repeated point that it's getting stuck on.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Fillet operation hangs windows

Post by chennes »

I don't know if there are any coordinate transforms going on here, but the point it's stuck on is at:

Code: Select all

Pnt11 = {coord={x=-35.757359312880716 y=8.3852815230029538 z=80.000000000000000 } }
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Fillet operation hangs windows

Post by chennes »

I'm posting this mostly as a note-to-myself so I can find it again later... The cause of the problem appears to be a missing increment operation in the OCCT function FixIntersectingWires. They have the following set of loops (tons of code omitted...):

Code: Select all

  for(Standard_Integer n1=1; n1<=SeqWir.Length()-1; n1++) { 
    for(Standard_Integer n2=n1+1; n2<=SeqWir.Length(); n2++) { 
      Standard_Integer NbModif=0;
      for(Standard_Integer num1 = 1; num1<=sewd1->NbEdges() && NbModif<30; num1++) {
        for(Standard_Integer num2 = 1; num2<=sewd2->NbEdges() && NbModif<30; num2++) {
                // Lots of code that looks like this, spread out over about 400 lines of code inside the inner loop
                if(isSplitEdge2) {
                  NbModif++;
                  num2--;
                }
                // BUT... one of them looks like this instead:
                if( IsModified1 || IsModified2 ) {
                  num2--;
                  hasModifWire = Standard_True; //gka 06.09.04
                  continue;
                }
So the key thing is that it looks like a loop over some fixed number of edges, except that number of edges keeps increasing, so they keep decrementing the loop variable. In most places they keep track of this and maintain the NbModif counter, whose only function is to break the loops if they go on too long. You can guess the rest :). One missing increment of that variable, and you have an infinite loop...
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: Fillet operation hangs windows

Post by tanderson69 »

chennes wrote: Tue Feb 09, 2021 3:21 am I'm posting this mostly as a note-to-myself so I can find it again later...
FYI: I am not getting the 'hang'/infinite loop on debian 10. Fillet just fails.
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Fillet operation hangs windows

Post by chennes »

tanderson69 wrote: Tue Feb 09, 2021 1:03 pm FYI: I am not getting the 'hang'/infinite loop on debian 10. Fillet just fails.
Which version of OCCT is that? I don't know why it gets into the infinite loop in the first place, it looks to me like it's trying to split a zero-length segment, and just keeps doing it over and over.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: Fillet operation hangs windows

Post by tanderson69 »

chennes wrote: Tue Feb 09, 2021 1:24 pm Which version of OCCT is that?
My branch off 7.5.0. You might want to see if you can reproduce the error in DRAWEXE. That will make sure that you don't have any freecad influence.
Post Reply