[Gmsh] surface 3D plot with Gmsh

Geordie McBain gdmcbain at freeshell.org
Tue Mar 12 23:15:41 CET 2013


2013/3/13 Poole, Floyd <fmpoole at oceaneering.com>:
> I have a 3D model (.step) which is basically a steel cylinder that I would
> like to overlay data as a surface plot. Is this possible with Gmsh? I have
> read the docs and watched a few online tutorials which were created on a
> MAC.
>
> The data file is a .csv spreadsheet with different elevations which I would
> like to add as a surface rendering on the cylinder, which would represent
> damage to the cylinder surface.
>
> I have attached the step file and csv file, any ideas or help would be
> appreciated.

Hello.  It looks as though the csv file contains only values without
any coordinate information.  I imagine it must be necessary to
identify the location of each value before rendering it, in Gmsh or
otherwise; hopefully you still have that information upstream
somewhere.
  From the Gmsh side, the easiest way to do this, once you've got that
location information, would be to write it out in the native format

   http://geuz.org/gmsh/doc/texinfo/gmsh.html#MSH-ASCII-file-format

which means associating a surface mesh with the nodes.  Given that the
csv file contains a rectangular array of numbers, I'm assuming it's
associated with a rectangular grid, so it should be straightforward
enough to associate a mesh of 4-node quadrangular elements (Gmsh
elm-type 3) with the grid of nodes.  The mesh of finite elements
enables Gmsh to interpolate between the nodal values and so colour the
surface, draw level-sets, etc.
   Gmsh can read in other formats, but I think you're still going to
need that co-ordinate information.