CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Gmsh] Gmsh STL import error

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 2, 2016, 15:57
Default Gmsh STL import error
  #1
Senior Member
 
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 24
me3840 is on a distinguished road
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?
me3840 is offline   Reply With Quote

Old   October 6, 2016, 14:11
Default
  #2
Senior Member
 
tareqkh's Avatar
 
CFD
Join Date: Nov 2010
Location: United States
Posts: 243
Rep Power: 16
tareqkh is on a distinguished road
Quote:
Originally Posted by me3840 View Post
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,
tareqkh is offline   Reply With Quote

Old   October 6, 2016, 15:33
Default
  #3
Senior Member
 
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 24
me3840 is on a distinguished road
Yes, the units are consistent. The file is too big but attached is a piece of it which shows the same problem.
Attached Files
File Type: gz wing_TE.stl.gz (3.2 KB, 4 views)
me3840 is offline   Reply With Quote

Old   October 6, 2016, 16:18
Default
  #4
Senior Member
 
tareqkh's Avatar
 
CFD
Join Date: Nov 2010
Location: United States
Posts: 243
Rep Power: 16
tareqkh is on a distinguished road
I don't understand what you just send me? Why don't you dent the geometry?

Best,
tareqkh is offline   Reply With Quote

Old   October 6, 2016, 21:38
Default
  #5
Senior Member
 
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 24
me3840 is on a distinguished road
That file is a compressed STL file. To decompress it you just need to run the command:
gunzip wing_TE.stl.gz
me3840 is offline   Reply With Quote

Old   October 6, 2016, 21:43
Default
  #6
Senior Member
 
tareqkh's Avatar
 
CFD
Join Date: Nov 2010
Location: United States
Posts: 243
Rep Power: 16
tareqkh is on a distinguished road
Quote:
Originally Posted by me3840 View Post
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,
tareqkh is offline   Reply With Quote

Old   October 7, 2016, 07:54
Default
  #7
Senior Member
 
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 24
me3840 is on a distinguished road
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.
me3840 is offline   Reply With Quote

Old   October 8, 2016, 18:44
Default
  #8
Senior Member
 
tareqkh's Avatar
 
CFD
Join Date: Nov 2010
Location: United States
Posts: 243
Rep Power: 16
tareqkh is on a distinguished road
Quote:
Originally Posted by me3840 View Post
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,
tareqkh is offline   Reply With Quote

Old   October 9, 2016, 08:34
Default
  #9
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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.
alexeym is offline   Reply With Quote

Old   October 9, 2016, 20:52
Default
  #10
Senior Member
 
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 24
me3840 is on a distinguished road
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.
me3840 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile calcMassFlowC aurore OpenFOAM Programming & Development 13 March 23, 2018 07:43
Undeclared Identifier Errof UDF SteveGoat Fluent UDF and Scheme Programming 7 October 15, 2014 07:11
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 09:17
checking the system setup and Qt version vivek070176 OpenFOAM Installation 22 June 1, 2010 12:34
How to get the max value of the whole field waynezw0618 OpenFOAM Running, Solving & CFD 4 June 17, 2008 05:07


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