Windows version of FEATool expects <CR><LF> in .msh import

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Windows version of FEATool expects <CR><LF> in .msh import

randress
This post was updated on .
See thread Grid import failed                                                [Edit: Mar 23, 2020 ~23:45Z]

When importing .msh (created on Windows by Gmsh) using the FEATool mesh import option on Windows (Grid->Import Grid->Gmsh Format),  the import fails with message: "Grid import failed."

After stripping out the carriage return from the .msh file, FEATool imported it with no problem.  Is there an FEATool option that directs it to treat .msh input files as DOS-like(\r\n)? Has this been changed in 1.12?

Would this same problem occur with reading other files such as the .geo from Gmsh? I seem to recall having a problem with that too.... I just figured that due to my inexperience I had created a bad file with Gmsh...

Oh, I just remembered, I think I also had problems reading an .stl (Geometry->Import Geometry-> STL Format) and maybe even with a.geo format ... should I go re-test these (.stl and .geo) before reporting them as issues or is this probably all the same issue as the .msh \r\n problem?

Kind regards,
Randal
Reply | Threaded
Open this post in threaded view
|

Re: Windows version of FEATool expects <CR><LF> in .msh import

Precise Simulation
Administrator
Thank you for reporting the issue. I mostly develop and test on Windows systems and have not encountered these issues but will look in to it. It could be due to system version/setup etc. and in retrospect I should probably strip out all Windows file endings before reading for consistency sake. To manually convert files I typically use the dos2unix command line utility.
Reply | Threaded
Open this post in threaded view
|

Re: Windows version of FEATool expects <CR><LF> in .msh import

randress
This post was updated on .
See thread Grid import failed                                                [Edit: Mar 23, 2020 ~23:45Z]

Just to clarify: Following the directions from https://www.featool.com/tutorial/2017/11/06/gmsh-cad-step-file-import-and-mesh-generation-tutorial, I ran Gmsh on a Windows system, I merged a STEP file from https://www.featool.com/download/spanner.step, generated the mesh and exported it to the file "spanner.msh", a text file that had lines terminated with \r\n (CRLF). Then on the same Windows PC I ran FEATool (standalone, v 1.11, 19.07.210) and attempted to import the "spanner.msh" which failed.  I then downloaded the "spanner.msh" file from  https://www.featool.com/download/spanner.msh which imported just fine.  I then found that the file file from featool.com had only \n (LF) at line end.  Once I stripped the CRLF down to LF only on the Gmsh file, it worked too.

BTW I found how to add dos2unix to the Windows context menu (right click) "Send to" sub-menu here: https://superuser.com/questions/549475/eol-converter-as-a-shell-extension .

I have yet to verify that the same problem exists when creating a .geo file from Gmsh and importing it to the FEATool geometry stage OR when attempting to import an "stl" file into FEATool.

-Randal