Creation of Solid from Shell.


We having some problem tracking down why a valid Shell cannot be made into a Valid Solid.

In the FreeCAD code

            print("shell : "+str(shell.isValid()))
            fp.Shape = Part.Solid(shell)
            #fp.Shape = shell
            print("Shape : "+str(fp.Shape.isValid()))

Which prints True for the shell but False for the Shape.

I added the following code


And the Brep is attached

Similarly for the Shape which exports but still reports invalid when load.

We would like advice on how to determine why the creation of a solid from the shell is not valid

OS: Ubuntu 18.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.3.
Build type: Release
Python version: 3.6.8
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)




Sergey Slyadnev's picture

Notice that the top and bottom faces of your parts are inverted (wrong orientation of faces).

qa qa's picture

OpenCascade Technology has different validity criteria for different topological objects. Solid is a closed shell and coherent faces orientation. When you construct solid invalid orientations of faces you mentioned are reported.

qa qa

Keith Sloan's picture

Many thanks have now been able to sort code.

However please could you enlighten us how and what tools are you using to reveal the faces are inverted.

Sergey Slyadnev's picture

I would definitely advise finding a way to enable backface coloring in your visualization subsystem. This way you may colorize your faces depending on its side (determined by the orientation of the corresponding visualization facets). Alternatively, you may always fall back to good old Draw console:

restore shape_0.brep sh
normals sh
Keith Sloan's picture

SORRY POST IN WRONG THREAD and don't know how to delete