Cannot load simple STL file

5 views (last 30 days)
Urs Vokinger
Urs Vokinger on 9 Dec 2020
Commented: Urs Vokinger on 9 Dec 2020
Hi,
the STL file (uploaded as txt file) in the attachment, consisting of two juxtaposed cuboids of different size and having in total only 22 surfaces, fails at importGeometry. The geometry is very simple, and there are no tolerance problems to be seen (only coordinates with 120, 100 80 40 and 0 values)!
How to fix it?
Best regards
Urs
Cuboids;
Small Program:
model = createpde('structural','static-solid');
importGeometry(model,'...\cuboids.stl');
generateMesh(model);
figure(1)
pdegplot(model,'FaceLabels','on');
Error message:
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.EquationModel/importGeometry (line 60)
gm = pde.DiscreteGeometry(geofilename);
Error in Cuboid (line 14)
importGeometry(model,'....\cuboids.stl');

Accepted Answer

Cris LaPierre
Cris LaPierre on 9 Dec 2020
The issue is the shared wall between your two cuboids. The inner volume must be completely open. This comes up all the time in 3D printing, as STL files are typically the accepted file format for this application. You can google around to find an STL repair service.
If you are creating the geometry yourself, see if you can't remove that shared face yourself.
I ran your stl through a service I've used in the past and found that, once repaired, your code works fine (attached, extension changed to txt)
  1 Comment
Urs Vokinger
Urs Vokinger on 9 Dec 2020
Great Cris! Thank you very much! It works!

Sign in to comment.

More Answers (0)

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!