Shape missing from FC saved file

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!
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Shape missing from FC saved file

Post by wmayer »

Code: Select all

shape = App.ActiveDocument.Shape003.Shape
shape.Face1.Surface
shape.Face2.Surface
shape.Face3.Surface
shape.Face4.Surface
shape.Face5.Surface
shape.Face6.Surface
shape.Face7.Surface
shape.Face8.Surface
shape.Face9.Surface
shape.Face10.Surface
shape.Face11.Surface
shape.Face12.Surface
shape.Face13.Surface
shape.Face14.Surface
shape.Face15.Surface
shape.Face16.Surface
When running the above snippet then for Face1 and Face5 you will get this error:
Traceback (most recent call last):
File "<input>", line 1, in <module>
Base.FreeCADError: Unknown exception while reading attribute 'Surface' of object 'TopoShape'
Do you see this also with FreeCAD v.018 with the older OCC version?

On my FreeCAD v.019 I get the same as Syres

Code: Select all

OS: Ubuntu 22.04.1 LTS (XFCE/xubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24416 (Git)
Build type: Unknown
Branch: releases/FreeCAD-0-19
Hash: 0a49fd05a46447aba70b6f18b5bb8210175dd471
Python version: 3.10.6
Qt version: 5.15.3
Coin version: 4.0.0
OCC version: 7.5.1
Locale: German/Germany (de_DE)
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Shape missing from FC saved file

Post by wmayer »

This is to create a partially correct shape instead of nothing: https://github.com/FreeCAD/FreeCAD/pull/8310
User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: Shape missing from FC saved file

Post by easyw-fc »

wmayer wrote: Tue Jan 31, 2023 1:29 pm This is to create a partially correct shape instead of nothing: https://github.com/FreeCAD/FreeCAD/pull/8310
but the issue is when loading or when saving the file?
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Shape missing from FC saved file

Post by wmayer »

easyw-fc wrote: Fri Feb 03, 2023 10:56 am
wmayer wrote: Tue Jan 31, 2023 1:29 pm This is to create a partially correct shape instead of nothing: https://github.com/FreeCAD/FreeCAD/pull/8310
but the issue is when loading or when saving the file?
It's rather unlikely that the loading or saving has corrupted the shape but it's more likely that the way how it was created is the problem. But what we see here are the symptoms, i.e. the tessellating fails and some OCCT C++ classes even raise an exception when trying to analyse it -- until now I have never seen that instantiating a BRepAdaptor_Surface could fail.

If you run the geometry checker from Part you will see that four faces are broken because of an invalid wire with a wrong domain.

Now the question is whether it's possible to rework the creation process or at least apply the healing algorithms to fix it afterwards.
User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: Shape missing from FC saved file

Post by easyw-fc »

wmayer wrote: Fri Feb 03, 2023 11:12 am If you run the geometry checker from Part you will see that four faces are broken because of an invalid wire with a wrong domain.

Now the question is whether it's possible to rework the creation process or at least apply the healing algorithms to fix it afterwards.
I'm rewriting the building process...
still it is strange that the shapes are just available in the 3D viewer and the issue appears only after saving those and reloading the file (which was not an issue in FC <= 01.8)
When exporting it to step, the issue is gone... probably import/export is applying a sort of healing process...

Anyway thanks for working on that.

Maurice
Post Reply