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

Link to STL: https://drive.google.com/file/d/1KEAaYLg_sMR67InfDEs12HpnzTGjysQf/view?usp=sharing

  • $\begingroup$ 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. $\endgroup$ Apr 4, 2019 at 16:38

1 Answer 1


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

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


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

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

Which the also has a volume:



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.

  • $\begingroup$ 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 $\endgroup$
    – kyler58
    Apr 4, 2019 at 14:17
  • 2
    $\begingroup$ @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. $\endgroup$
    – Greg Hurst
    Apr 4, 2019 at 16:32
  • $\begingroup$ @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. $\endgroup$
    – user21
    Apr 5, 2019 at 4:43
  • $\begingroup$ How can I fix the mesh defects? And I've added the STL. Thanks $\endgroup$
    – kyler58
    Apr 10, 2019 at 15:56
  • $\begingroup$ @kyler58, see update. $\endgroup$
    – user21
    Apr 11, 2019 at 4:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.