Importing and Editing STL, "Shape is not a shell".

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!
xanatos
Posts: 14
Joined: Tue Feb 07, 2023 6:05 pm

Importing and Editing STL, "Shape is not a shell".

Post by xanatos »

Tried searching here but the search function always rejects the search: "ignored because they are too common words: shell shape not is a."

FreeCAD 0.20.1, revision 29410 (Git) 2022/08/10, Win10, 64 bit

I've got an stl file, downloaded from manufacturer's website.
I import stl file, select the mesh.
Select the Part workbench.
From Part dropdown, I select "Create shape from mesh..."
I select tolerance to be 0.01.
I wait :) Shape is successfully created.
I select the new shape.
From the Part dropdown I select "Convert to solid"
I wait again :) I get:

Code: Select all

13:22:28  Traceback (most recent call last):
  File "<string>", line 2, in <module>
<class 'Part.OCCError'>: Shape is not a shell
13:22:28  Cannot convert _900_QTPY_RP2040001 because Shape is not a shell.
I entered the following into the Python Console:

Code: Select all

App.ActiveDocument.ActiveObject.Shape.ShapeType
Console returns 'Compound'

Not really sure what's going on. Would love to upload the .FCStd file, but it's 7MB, board won't allow. The raw stl is 2.18MB, also too large to upload :(

What am I missing? Thanks for any help
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Importing and Editing STL, "Shape is not a shell".

Post by Roy_043 »

Without the mesh we can only guess.
Two things you can do:
Use Mesh_SplitComponents to see if the mesh contains multiple components.
Check the mesh with Mesh_Evaluation.
xanatos
Posts: 14
Joined: Tue Feb 07, 2023 6:05 pm

Re: Importing and Editing STL, "Shape is not a shell".

Post by xanatos »

There are 1539 components.

I also did a "Meshes > Analyze > Evaluate and Repair Mesh", and it fixed some issues with - I believe - duplicated points and degenerated faces, which it repaired, however, subsequent attempts to convert to a solid on the repaired mesh yield the same "Shape is not a shell" error.

If I place the FCStd and stl files up available for download somewhere - is that permittable on this board?
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Importing and Editing STL, "Shape is not a shell".

Post by chrisb »

xanatos wrote: Tue Feb 07, 2023 10:23 pm If I place the FCStd and stl files up available for download somewhere - is that permittable on this board?
The forum rules linked above encourage you to do so.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
xanatos
Posts: 14
Joined: Tue Feb 07, 2023 6:05 pm

Re: Importing and Editing STL, "Shape is not a shell".

Post by xanatos »

Great!

step file: https://xanatos.com/downloads/4900 QTPY-RP2040.step
stl file: https://xanatos.com/downloads/4900 QTPY-RP2040.stl

Hopefully this will be more useful to folks to see what's different about these items. Thanks!
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: Importing and Editing STL, "Shape is not a shell".

Post by -alex- »

xanatos wrote: Tue Feb 07, 2023 6:31 pm From Part dropdown, I select "Create shape from mesh..."
I select tolerance to be 0.01.
Did you enabled "sew shape option"? Try this.
Then Part_CheckGeometry -> shape content menu to check you've got a shell (and only one shell, otherwise see Part_CompoundFilter)
If so, then convert to solid.
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: Importing and Editing STL, "Shape is not a shell".

Post by -alex- »

xanatos wrote: Tue Feb 07, 2023 10:52 pm step file: https://xanatos.com/downloads/4900 QTPY-RP2040.step
If you have a step file, work with it, just let down the stl.
xanatos
Posts: 14
Joined: Tue Feb 07, 2023 6:05 pm

Re: Importing and Editing STL, "Shape is not a shell".

Post by xanatos »

-alex- wrote: Tue Feb 07, 2023 10:54 pm Did you enabled "sew shape option"? Try this.
Then Part_CheckGeometry -> shape content menu to check you've got a shell (and only one shell, otherwise see Part_CompoundFilter)
If so, then convert to solid.
Yes, I checked the box for Sew Shape, and set the tolerance to the most accurate, 0.01

I am running the Check Geometry thing now, it's been running for a few minutes now... it's a big file.
xanatos
Posts: 14
Joined: Tue Feb 07, 2023 6:05 pm

Re: Importing and Editing STL, "Shape is not a shell".

Post by xanatos »

-alex- wrote: Tue Feb 07, 2023 10:57 pm If you have a step file, work with it, just let down the stl.
The step file also needs to be a solid. These items will be imported into an existing project and used as cutouts to create snug, form-fitting "pockets" for the components they represent. I have tried doing Boolean operations on the step file with the other items and they just don't play together at all :) I keep readingthat FreeCAD should import step files "as solids" but apparently not the same type of solid as when you use default shapes in the part workbench (like blocks and spheres and tubes) to create things and use Booleans on them like Union or Cut....
xanatos
Posts: 14
Joined: Tue Feb 07, 2023 6:05 pm

Re: Importing and Editing STL, "Shape is not a shell".

Post by xanatos »

Well, I cheated and found a way to at least get *most* of the file converted to a solid. I opened it up so I could see the listing of individual "compounds", and tried individually to convert each to a solid.

I got two telling errors: One said it was ignored because it was already a solid, the other was the familiar "shape is not a shell".

I did a union on all the ones that were "already a solid", and then moved that union off to the side, revealing that what was left behind was all of the surface-mount resistors & caps (mostly) that were not "shells" or solids. Fortunately the board and the larger components were all solids to begin with, so I just created a 1mm thick block to cover the areas occupied by all the small components and fused that to the union I had just made.

This worked to allow me to create and print the part-pocket I needed, but I know there has to be a much more expedient way to do this rather than by brute force and manual pick & choose... Still hoping someone can load the stl and/or step I posted and let me know what the modified procedure would be... Thanks for any guidance.
Post Reply