Fillet operation hangs windows
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 30
- Joined: Mon Apr 23, 2018 2:57 pm
Fillet operation hangs windows
Fillet operation hangs windows. See model and image for green edge that causes issue
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)
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
Re: Fillet operation hangs windows
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.
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.
Re: Fillet operation hangs windows
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.
Re: Fillet operation hangs windows
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.
Re: Fillet operation hangs windows
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.
Re: Fillet operation hangs windows
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 } }
Re: Fillet operation hangs windows
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...):
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...
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;
}
- tanderson69
- Veteran
- Posts: 1626
- Joined: Thu Feb 18, 2010 1:07 am
Re: Fillet operation hangs windows
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.tanderson69 wrote: ↑Tue Feb 09, 2021 1:03 pm FYI: I am not getting the 'hang'/infinite loop on debian 10. Fillet just fails.
- tanderson69
- Veteran
- Posts: 1626
- Joined: Thu Feb 18, 2010 1:07 am