Self test error on testTaperedHole

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Self test error on testTaperedHole

Post by PrzemoF »

wmayer wrote: Fri Apr 17, 2020 12:50 pm With OCC7.4 it apparently fails to revolve the sketch. I get this error when loading the project but as soon as a recompute the document the error disappears and the hole becomes conical. Here is the file how it looks after recompute:

hole_test_fails_occ73.FCStd

So I am not sure what's best how to handle the issue as it seems to be another regression of OCC7.4.
I checked our "hole" code - there is plenty happening there. I need to export the parameters of the polyline that causes the OCCT to fail. I have a "test bed" ready in OCCT preferred format (TCL script executable under DRAWEXE test harness)

For the brave:

Code: Select all

pload MODELING VISUALIZATION
polyline w 2 2 0 1.5 1.5 0  1.5 1.5 3 1 1 5 2 2 5 2 2 0
revol s w 2 2 2 0 0 1 360
checkshape s
vdisplay s
vfit
Save to a file, start DRAWEXE and load with "source file_name". It shoudl produce this:
Zrzut ekranu z 2020-05-14 14-49-48.png
Zrzut ekranu z 2020-05-14 14-49-48.png (8.41 KiB) Viewed 1090 times
fcaduser
Posts: 448
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

Re: Self test error on testTaperedHole

Post by fcaduser »

I confirm the bug for this version :

################################################
OS: Debian GNU/Linux 10 (buster) (GNOME/gnome)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20816 (Git)
Build type: Release
Branch: master
Hash: bc107eacc8e020a779b2bbcb21559283ee440268
Python version: 3.7.3
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.4.1.dev <-------------------------------------------------------------------------------------------------------------------
Locale: French/France (fr_FR)
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Self test error on testTaperedHole

Post by PrzemoF »

Patch:

Code: Select all

diff --git a/src/Mod/PartDesign/App/FeatureHole.cpp b/src/Mod/PartDesign/App/FeatureHole.cpp
index 5343d9cce7..b7ca2a50a7 100644
--- a/src/Mod/PartDesign/App/FeatureHole.cpp
+++ b/src/Mod/PartDesign/App/FeatureHole.cpp
@@ -1134,6 +1134,9 @@ App::DocumentObjectExecReturn *Hole::execute(void)
         }
         mkWire.Add( BRepBuilderAPI_MakeEdge(lastPoint, firstPoint) );
 
+       std::cout << "First point:" << firstPoint.X() << ", " << firstPoint.Y()  << ", " << firstPoint.Z() << std::endl;^M
+       std::cout << "Last point:" << lastPoint.X() << ", " << lastPoint.Y()  << ", " << lastPoint.Z() << std::endl;^M
+^M
 
         TopoDS_Wire wire = mkWire.Wire();
Result:

Code: Select all

First point:0, 0, 0
Last point:-0, -0, 25
First point:0, 0, 0
Last point:-0, -0, 5
Looks like it's A to B, A to C sketch. Maybe thats the problem. Minus zero might be another problem or it's just c++ :mrgreen:
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Self test error on testTaperedHole

Post by PrzemoF »

I just realised the those 2 edges overlap...Maybe that's the problem?
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Self test error on testTaperedHole

Post by PrzemoF »

With help from Opencascade forum I got our test case. And the results are weird:

Code: Select all

$ cat test
pload MODELING VISUALIZATION

vertex  A 0 0 0
vertex  B 0 0 25
vertex  C 0 0 0
vertex  D 0 0 5

edge e1 A B
edge e2 C D

wire w1 e1 e2

revol s1 w1 -5 5 0 0 0 1 360

vdisplay s1 

vfit

localhost:/home/przemo/software/FreeCAD/OCCT
$ DRAWEXE -f test
corrupted size vs. prev_size in fastbins
Przerwane (zrzut pamięci)
localhost:/home/przemo/software/FreeCAD/OCCT
$ DRAWEXE -f test
corrupted size vs. prev_size in fastbins
Przerwane (zrzut pamięci)
localhost:/home/przemo/software/FreeCAD/OCCT
$ DRAWEXE -f test
corrupted size vs. prev_size in fastbins
Przerwane (zrzut pamięci)
localhost:/home/przemo/software/FreeCAD/OCCT
$ DRAWEXE -f test
*** Abort *** an exception was raised, but no catch was found.
	... The exception is:SIGSEGV 'segmentation violation' detected. Address 269
malloc(): unsorted double linked list corrupted
Przerwane (zrzut pamięci)
localhost:/home/przemo/software/FreeCAD/OCCT
$ DRAWEXE -f test
*** Abort *** an exception was raised, but no catch was found.
	... The exception is:SIGSEGV 'segmentation violation' detected. Address 1d9
localhost:/home/przemo/software/FreeCAD/OCCT
$ DRAWEXE -f test
*** Abort *** an exception was raised, but no catch was found.
	... The exception is:SIGSEGV 'segmentation violation' detected. Address 89
localhost:/home/przemo/software/FreeCAD/OCCT
$ DRAWEXE -f test
corrupted size vs. prev_size in fastbins
Przerwane (zrzut pamięci)
localhost:/home/przemo/software/FreeCAD/OCCT
$ which DRAWEXE
/usr/bin/DRAWEXE
localhost:/home/przemo/software/FreeCAD/OCCT
$ rpm -qf /usr/bin/DRAWEXE 
opencascade-draw-7.4.0-3.fc32.x86_64
localhost:/home/przemo/software/FreeCAD/OCCT
$ uname -a
Linux localhost.localdomain 5.6.7-300.fc32.x86_64 #1 SMP Thu Apr 23 14:13:50 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
I need someone with opencascade 7.3.0 to do a test:
- copy the content of my est script to a file and save it somewhere
- open that firectory in terminal and run DRAW -f -your-test-file-name
- do it few times, see if the output is consistent
- run DRAWEXE and load the test file from interactive session with "source test". Expected result:
Zrzut ekranu z 2020-05-21 08-12-58.png
Zrzut ekranu z 2020-05-21 08-12-58.png (8.91 KiB) Viewed 1008 times
I can't do the test in VM as it seems to mess with graphical drivers - I get some MESA error.
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Self test error on testTaperedHole

Post by PrzemoF »

I posted the problem again on opencascade forum - looks like the first one never made it through the wires. The post waits for moderation...
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Self test error on testTaperedHole

Post by PrzemoF »

PrzemoF wrote: Mon May 25, 2020 10:31 am I posted the problem again on opencascade forum - looks like the first one never made it through the wires. The post waits for moderation...
Looks like my post won't see the opencascade forum - it's still with [not published] status.
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Self test error on testTaperedHole

Post by PrzemoF »

PrzemoF wrote: Mon May 25, 2020 10:31 am I posted the problem again on opencascade forum - looks like the first one never made it through the wires. The post waits for moderation...
My message finally made it! Maybe we'll get someone to test/confirm the problem.

https://www.opencascade.com/content/inc ... -drawexe-0
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Self test error on testTaperedHole

Post by PrzemoF »

Looks like OCC-7.4.0-beta got the problem fixed or something in FreeCAD fixed the problem. Latest local build:
OS: Fedora 32 (Workstation Edition) (GNOME/gnome-xorg)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21734 (Git)
Build type: Unknown
Branch: master
Hash: 5613793f5352285fcb8d0e16e11241b6a29d61ac
Python version: 3.8.3
Qt version: 5.14.2
Coin version: 4.0.0a
OCC version: 7.4.0.beta
Locale: Polish/Poland (pl_PL)
self test from command line:

Code: Select all

testStairs (TestArch.ArchTest) ... ok
testStructure (TestArch.ArchTest) ... ok
testWall (TestArch.ArchTest) ... ok
testWindow (TestArch.ArchTest) ... ok

----------------------------------------------------------------------
Ran 479 tests in 132.277s

OK
System exit
Post Reply