5
$\begingroup$

I know practically nothing about meshes, so I was wondering whether it's possible in Mathematica to convert a 2D mesh, embedded in 3 dimensions, to a 3D mesh? The 2D mesh was generated by a CAD program in STL format.

$\endgroup$
2
  • $\begingroup$ How you get the full mesh, also depends a bit on what you want to do with it later? $\endgroup$
    – user21
    Feb 12 at 6:10
  • $\begingroup$ I'm using it to compute mass properties (moments of inertia, center of gravity, mass). $\endgroup$
    – Cassini
    Feb 13 at 0:22

1 Answer 1

6
$\begingroup$

If the 2D mesh is watertight, you can create a BoundaryMeshRegion from it and then call DiscretizeRegion on it. The result fills the region enclosed by the surface mesh with a tet-mesh.

Something like this should work:

R = DiscretizeRegion[Import["file.stl", "BoundaryMeshRegion"]]
$\endgroup$
2
  • $\begingroup$ @HenrikSchumacker Thank you--that totally worked. I had tried the "DiscretizeRegion" function, but I didn't import the region as a BoundaryMeshRegion and it didn't work. $\endgroup$
    – Cassini
    Feb 11 at 21:10
  • 1
    $\begingroup$ You're welcome! $\endgroup$ Feb 11 at 21:52

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.