CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [Gmsh] Gmsh STL import error (https://www.cfd-online.com/Forums/openfoam-meshing/178230-gmsh-stl-import-error.html)

me3840 October 2, 2016 15:57

Gmsh STL import error
 
Hello all,

I'm trying to get Gmsh to read my STL file in so I can remesh it.

However, when I import it, Gmsh reports:

Info : Mesh is in binary format
Info : Swapping bytes from binary file
Error : No facets found in STL file for solid 0
Error : Error loading 'geom.stl'

However my STL file is not in binary format, it's in ASCII. I have tried running dos2unix and changed the 'solid' on the first line to 'xolid' as this thread suggests:
http://onelab.info/pipermail/gmsh/2009/004995.html

But it didn't change anything. Does anyone know what I should do?

tareqkh October 6, 2016 14:11

Quote:

Originally Posted by me3840 (Post 620050)
Hello all,

I'm trying to get Gmsh to read my STL file in so I can remesh it.

However, when I import it, Gmsh reports:

Info : Mesh is in binary format
Info : Swapping bytes from binary file
Error : No facets found in STL file for solid 0
Error : Error loading 'geom.stl'

However my STL file is not in binary format, it's in ASCII. I have tried running dos2unix and changed the 'solid' on the first line to 'xolid' as this thread suggests:
http://onelab.info/pipermail/gmsh/2009/004995.html

But it didn't change anything. Does anyone know what I should do?

Hello,

Did you use consistent units when you create the stl file? Why don't you post what are you trying to mesh, so that we can help you.

Best,

me3840 October 6, 2016 15:33

1 Attachment(s)
Yes, the units are consistent. The file is too big but attached is a piece of it which shows the same problem.

tareqkh October 6, 2016 16:18

I don't understand what you just send me? Why don't you dent the geometry?

Best,

me3840 October 6, 2016 21:38

That file is a compressed STL file. To decompress it you just need to run the command:
gunzip wing_TE.stl.gz

tareqkh October 6, 2016 21:43

Quote:

Originally Posted by me3840 (Post 620604)
That file is a compressed STL file. To decompress it you just need to run the command:
gunzip wing_TE.stl.gz

I have opened using Salome and saw only a line. If you want people to help you, you need to provide good details.

Best,

me3840 October 7, 2016 07:54

Yes, it's just the trailing edge of the wing, it should not be very big. However if you import it to Gmsh, it gives the same error as the full geometry. It's small and easy, that's why I put it there instead of the whole plane.

What details are you looking for? I'm really not sure what else I can provide; I import my geometry and it gives that error. I import this smaller piece of it and it gives the same error.

Did you try importing that part I posted to Gmsh? Do you get the same error? The fact that it imports correctly to Salome indicates there's nothing wrong with the file.

tareqkh October 8, 2016 18:44

Quote:

Originally Posted by me3840 (Post 620677)
Yes, it's just the trailing edge of the wing, it should not be very big. However if you import it to Gmsh, it gives the same error as the full geometry. It's small and easy, that's why I put it there instead of the whole plane.

What details are you looking for? I'm really not sure what else I can provide; I import my geometry and it gives that error. I import this smaller piece of it and it gives the same error.

Did you try importing that part I posted to Gmsh? Do you get the same error? The fact that it imports correctly to Salome indicates there's nothing wrong with the file.

Why don't you draw the trailing edge in gmsh since you are going to mesh in gmsh already? I have done different problems in gmsh -2D, 3D etc. I can help you getting your problem solved.

Best,

alexeym October 9, 2016 08:34

Hi,

Your STL-file starts with space. Removing it seems to fix the problem.

Here is the Gmsh code, which decides that STL is binary (https://onelab.info/svn/gmsh/trunk/G...elIO_STL.cpp):

Code:

bool binary = strncmp(buffer, "solid", 5) && strncmp(buffer, "SOLID", 5);
So your space in the beginning of the file breaks everything.

me3840 October 9, 2016 20:52

Thanks alaexym. That seemed to work well. Not sure why there's a space in all of the lines, but it's easy enough to remove.


All times are GMT -4. The time now is 03:31.