Getting an error message when trying to import .stl file

25 次查看(过去 30 天)
Dear users,
I'm a Ph.D. student in Brazil/Canada researching in the domain of flow separation and I would like to ask you a question about the following error I get when I try to import a geometry with .stl extension. Hope so you can help me.
Error using pde.DiscreteGeometry
Failed to create geometry, the input does not form a closed volume. This may be due to missing faces or gaps in the input.
Error in pde.PDEModel/importGeometry (line 160) gm = pde.DiscreteGeometry(geofilename);
Thank you very much.
Matheus de Queiroz

采纳的回答

Damian Sheehy
Damian Sheehy 2017-1-27
The geometry may well have tiny gaps along an edge where two adjacent curved surfaces intersect. It may not be obvious when looking at the geometry in the parent CAD system unless it provides tools for querying and healing geometry defects. We occasionally see this problem when CAD geometry is imported from one system into another and the STL is then generated from the latter. Different CAD systems use different tolerances in their surface intersection algorithms. When the geometry is exchanged faces may not be stitched together properly, giving rise to gaps. The PDE toolbox will error if these gaps are detected on import.
If you email the STL file to me together with and any info on translation history then we can investigate; though at this point we cannot heal geometry with defects like this. email: firstname dot lastname at mathworks dot com

更多回答(2 个)

Brian Chen
Brian Chen 2017-1-27
I get this issue as well. Any progress?
  2 个评论
michio
michio 2017-1-27
Just to clarify, does the error messages not apply to your model defined in STL file that you are trying to import?
"Failed to create geometry, the input does not form a closed volume. This may be due to missing faces or gaps in the input.

请先登录,再进行评论。


mkassa
mkassa 2020-10-13
Switching from m to mm worked for me :
[F,V] = stlread('old_file_name.stl');
stlwrite('new_file_name.stl',F,V*1000)
model = createpde();
importGeometry(model,'new_file name.stl');

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by