# Converting .STL from Shell to Solid for stress analysis of wing

I'm new to Mathematica as this is the first class I've had to used it in my undergrad time as an aerospace engineer. Anyway, I have run into a problem that I can't figure out. I have created .STL's of a wing I have created in Solidworks. I can get them into Mathematica simply with the Import function but the model has 0 volume, as I understand .STL's are just shells. I need to convert this shell into a solid. I'm essentially looking for the opposite of ShellRegion. Additionally, I want to take a high number of cross section cuts and calculate the moment of inertia about the axis perpendicular to the load and parallel to the plane I'm looking at. And area as well. I don't really understand meshes, so that could be an issue. Any help would be appreciated. ScreenShot

• Is there a way to share the STL file with us? Otherwise it can hardly be said how to repair it. Anyways, M = RepairMesh[Import["ExampleData/spikey.stl"]] and TriangulateMesh[ BoundaryMeshRegion[MeshCoordinates[M], MeshCells[M, 2, "Multicells" -> True]]] might help. – Henrik Schumacher Apr 4 '19 at 16:38

It's always good to show what you have done so far because otherwise people here need to guess....

So I am guessing that you did something along the lines of:

m1 = Import["ExampleData/spikey.stl"];


Note that the region dimensions is 2.

m1 // RegionDimension
2


This means what you imported represents the surface of the object. Just the surface. And that does not have a volume:

Volume[m1]
0


If you import it as a BoundaryMeshRegion that represents the region encapsulated by the surface:

m2 = Import["ExampleData/spikey.stl", "BoundaryMeshRegion"];
m2 // RegionDimension
3


Which the also has a volume:

Volume[m2]
4.538717580016553


Update

For your mesh FindMeshDefects[mr] finds overlapping faces which RepairMesh can not fix. You'd need to fix those in the software that generated the STL.

• Thank you for your response. I have tried that before with no success. I attached a screenshot. I'm guessing something is wonky on my model. Any ideas? Thanks again – kyler58 Apr 4 '19 at 14:17
• @kyler58 You might have defects it your mesh. It's hard to know without having the mesh available. You can run FindMeshDefects` on your surface mesh to find out. – Chip Hurst Apr 4 '19 at 16:32
• @kyler58, as I mentioned in my post, with the STL file we can not do much more then guessing. Share the file and to get a proper answer. – user21 Apr 5 '19 at 4:43
• How can I fix the mesh defects? And I've added the STL. Thanks – kyler58 Apr 10 '19 at 15:56
• @kyler58, see update. – user21 Apr 11 '19 at 4:09