Is this an interesting bug?

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Is this an interesting bug?

Post by sliptonic »

I was doing some work with sections and came across this edge case. Is this a known bug? Avoidable?
Open the attached file and select the shape. Then do a cross section at 10 mm. That's the level at which the flat section meets the cylinders.
2022-08-16_12-09.png
2022-08-16_12-09.png (12.82 KiB) Viewed 972 times
That gives what looks like a good section. No errors in the console but selecting it shows something odd in the selection highlighting.
2022-08-16_12-09_1.png
2022-08-16_12-09_1.png (7.11 KiB) Viewed 972 times
Then selecting it and "Part->Make Face from wires" creates a face but shows an error.
2022-08-16_12-10.png
2022-08-16_12-10.png (6.67 KiB) Viewed 972 times

Code: Select all

12:09:58  <Part> ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of facebug#Face: NCollection_Array1::Value
Attachments
facebug.FCStd
(35.85 KiB) Downloaded 16 times
chrisb
Veteran
Posts: 53922
Joined: Tue Mar 17, 2015 9:14 am

Re: Is this an interesting bug?

Post by chrisb »

I cannot confirm here. This looks to me like one of those coplanar issues. What does CheckGeometry say?

Code: Select all

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.21.29997 (Git)
Build type: Release
Branch: master
Hash: b52967d52ac46eff7c59e74d991f3f5b298944ef
Python 3.10.5, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: C/Default (C)
Installed mods: 
  * FC_SU
  * FeedsAndSpeeds 0.4.0
  * fcgear 1.0.0
  * fasteners 0.3.51
  * sheetmetal 0.2.56
  * ExplodedAssembly
  * Curves 0.5.4
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
mfro
Posts: 663
Joined: Sat Sep 23, 2017 8:15 am

Re: Is this an interesting bug?

Post by mfro »

works fine for me as well
section.png
section.png (22.58 KiB) Viewed 920 times

Code: Select all

OS: Debian GNU/Linux bookworm/sid (GNOME/gnome)
Word size of FreeCAD: 64-bit
Version: 0.21.30119 (Git)
Build type: Debug
Branch: attach_to_wire
Hash: f0e63ac5faded83da95352e69699e879c5bde360
Python 3.10.5, Qt 5.15.4, Coin 4.0.0, Vtk 7.1.1, OCC 7.7.0.dev
Locale: German/Germany (de_DE)
Cheers,
Markus
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Is this an interesting bug?

Post by sliptonic »

check geometry on the section shows no errors.
Check geometry after making a face from the wires shows errors.
2022-08-16_14-15.png
2022-08-16_14-15.png (52.3 KiB) Viewed 896 times

Code: Select all

OS: Linux Mint 20 (i3/i3)
Word size of FreeCAD: 64-bit
Version: 0.21.30116 +1 (Git)
Build type: Unknown
Branch: littlefixes
Hash: 78df46b0f0039c67798080ec986c33f7083381bf
Python 3.8.10, Qt 5.12.8, Coin 4.0.0, Vtk 7.1.1, OCC 7.5.2
Locale: English/United States (en_US)
Installed mods: 
  * Assembly4 0.12.3
  * Behave-Dark-Colors 0.1.1
  * 3DfindIT 1.2.0
  * ProDarkThemePreferencePack 1.0.0
  * sheetmetal 0.2.52
  * FeedsAndSpeeds
  * ExtremeProDark 1.0.4
  * FeedsAndSpeeds.bak
  * Dracula 0.0.2
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Is this an interesting bug?

Post by wandererfan »

sliptonic wrote: Tue Aug 16, 2022 5:18 pm I was doing some work with sections and came across this edge case. Is this a known bug? Avoidable?
The circles are duplicated in the cross section. If you explode the cross section, you will get 5 pieces instead of the expected 3. Choosing the outer boundary and two circles after exploding gives a good face.
Attachments
facebug_exploded.FCStd
(43.45 KiB) Downloaded 10 times
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Is this an interesting bug?

Post by sliptonic »

wandererfan wrote: Tue Aug 16, 2022 7:35 pm
sliptonic wrote: Tue Aug 16, 2022 5:18 pm I was doing some work with sections and came across this edge case. Is this a known bug? Avoidable?
The circles are duplicated in the cross section. If you explode the cross section, you will get 5 pieces instead of the expected 3. Choosing the outer boundary and two circles after exploding gives a good face.
Ok. So is that a bug in the cross-section logic?
User avatar
mfro
Posts: 663
Joined: Sat Sep 23, 2017 8:15 am

Re: Is this an interesting bug?

Post by mfro »

@sliptonic

compared to @chrisb's and my FreeCAD version, you seem to have a rather old OCC library in use.
Cheers,
Markus
chrisb
Veteran
Posts: 53922
Joined: Tue Mar 17, 2015 9:14 am

Re: Is this an interesting bug?

Post by chrisb »

I see the same 5 pieces when I explode the cross section.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Is this an interesting bug?

Post by wandererfan »

sliptonic wrote: Tue Aug 16, 2022 7:41 pm Ok. So is that a bug in the cross-section logic?
I guess it is. You'd expect the section cut to deliver a prism where the top face has two extra wires for the circles, or a prism (without any circles) plus two faces for the circles. Here we get both the extra wire and the extra faces.

To deliver a trouble free result in this case, the cross section would have to check for duplicate wires in the result and drop them.
Attachments
facebug_debug.FCStd
(41.32 KiB) Downloaded 10 times
User avatar
mfro
Posts: 663
Joined: Sat Sep 23, 2017 8:15 am

Re: Is this an interesting bug?

Post by mfro »

sliptonic wrote: Tue Aug 16, 2022 5:18 pm Then selecting it and "Part->Make Face from wires" creates a face but shows an error.
...

Code: Select all

12:09:58  <Part> ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of facebug#Face: NCollection_Array1::Value
Now we discuss a coplanar issue (which is not really surprising as we see that elsewhere as well).

The original post, however, objected about the error message (that I - and @chrisb don't see). Not the same thing.
Cheers,
Markus
Post Reply