MB-System Unix Manual Page

mbgrd2obj

Section: MB-System 5.0 (1)
Updated: 22 September 2020
Index
 

NAME

mbgrd2obj - GMT plug-in module to convert grid to OBJ format 3D model file.

 

VERSION

Version 5.0

 

SYNOPSIS

mbgrd2obj <gridfile> -G<objfile> [-R<west>/<east>/<south>/<north>[+r]] [-V[<level>]]

 

DESCRIPTION

mbgrd2obj is a plug-in module to generate a Geographically located GeoTiff image from a GMT grid file using GMT (Generic Mapping Tools). Like mbgrdtiff, mbcontour, and mbswath, mbgrd2obj is fully compatible with the GMT package version 6.

The OBJ format is used for 3D model files that can be imported into visualization software or used by 3D printers. This open format was developed by Wavefront Technologies for it's visualization animation software, and has since been widely adopted in the 3D graphics and printing industries. This is a text based format that defines the geometry of objects and surfaces, and can also define color and texture. The OBJ files generated by mbgrd2obj represent the topographic surface derived from the input grid file as a set of triangles without color or texture information (though those capabilities may be added later). The -R option caan be used to specify the bounds of the OBJ output; these bounds must be a subset of the area covered by the input grid. Areas of the grid represented as having no data are not included in the OBJ output. By default, the output OBJ file is named by replacing the ".grd" suffix of the input grid file with ".obj", or adding the ".obj" suffix to the input filename if the input does not have a ".grd" suffix. The -G option can be used to specify a different output OBJ file name.

In order for GMT to successfully execute mbgrd2obj, the location of the shared library libmbgmt containing this module must be known to GMT. This can be accomplished by either setting the GMT_CUSTOM_LIBS parameter in the file gmt.conf that is part of the GMT installation, by setting this parameter in the file gmt.conf in the user's home directory, or by using the GMT module gmtset to modify this parameter in the current working directory. If, for instance, the libmbgmt shared library has been installed in the file /usr/lib/libmbgmt.dylib, then the GMT_CUSTOM_LIBS parameter in a gmt.conf file can be set to:
        GMT_CUSTOM_LIBS = /usr/lib/libmbgmt.dylib

On a linux system use the mbsystem shared library, e.g.:
        GMT_CUSTOM_LIBS = /usr/local/lib/mbsystem.so

 

MB-SYSTEM AUTHORSHIP

David W. Caress

  Monterey Bay Aquarium Research Institute
Dale N. Chayes

  Center for Coastal and Ocean Mapping

  University of New Hampshire
Christian do Santos Ferreira

  MARUM - Center for Marine Environmental Sciences

  University of Bremen

 

OPTIONS

-G <objfile>
Output topography OBJ format file. Default is to add ".obj" suffix to the input grid file name (replacing ".grd" suffix if possible). -R Specify the min/max coordinates of your data region in user units.
Use dd:mm[:ss] for regions given in arc degrees, minutes [and seconds].
Use -R<xmin/xmax/ymin/ymax>+<unit> for regions given in projected coordinates. with <unit> selected from e|f|k|M|n|u.
Use [yyy[-mm[-dd]]]T[hh[:mm[:ss[.xxx]]]] format for time axes. Append +r if -R specifies the coordinates of the lower left and upper right corners of a rectangular area.
Use -R<gridfile> to use its limits (and increments if applicable).
Use -Rg and -Rd as shorthands for -R0/360/-90/90 and -R-180/180/-90/90. Derive region from closed polygons from the Digital Chart of the World (DCW): Append a comma-separated list of ISO 3166 codes for countries to set region, i.e., <code1>,<code2>,... etc., using the 2-character ISO country codes (see pscoast -E+l for list). To select a state of a country (if available), append .state, e.g, US.TX for Texas. To select a whole continent, give =AF|AN|AS|EU|OC|NA|SA as <code>.
Use +r to modify the region from polygon(s): Append <inc>, <xinc>/<yinc>, or <winc>/<einc>/<sinc>/<ninc> to round region to these multiples; use +R to extend region by those increments instead [0].
Or use -R<code><x0>/<y0>/<n_columns>/<n_rows> for origin and grid dimensions, where <code> is a 2-char combo from [T|M|B][L|C|R] (top/middle/bottom/left/center/right) and grid spacing must be specified via -I<dx>[/<dy>] (also see -r). -V Change the verbosity level (currently v). Choose among 6 levels; each level adds more messages:
     q - Quiet, not even fatal error messages.
     n - Normal verbosity: only error messages.
     c - Also produce compatibility warnings [Default when no -V is used].
     v - Verbose progress messages [Default when -V is used].
     l - Long verbose progress messages.
     d - Debugging messages.

 

EXAMPLES

Suppose we have obtained a GRD file called ZTopo.grd that contains seafloor topography. In order to obtain an OBJ file named ZTopo.obj, we use:

  gmt mbgrd2obj ZTopo.grd -Vl
The output to the shell is:
  mbgrd2obj [INFORMATION]: Processing input grid
  mbgrd2obj [INFORMATION]: Reading grid from file ZTopo.grd
  mbgrd2obj [INFORMATION]: Set boundary condition for all edges: natural
  mbgrd2obj [INFORMATION]: Set boundary condition for left   edge: natural
  mbgrd2obj [INFORMATION]: Set boundary condition for right  edge: natural
  mbgrd2obj [INFORMATION]: Set boundary condition for bottom edge: natural
  mbgrd2obj [INFORMATION]: Set boundary condition for top    edge: natural
  mbgrd2obj [INFORMATION]: 285087 vertices output
  mbgrd2obj [INFORMATION]: 562024 triangles output

 

SEE ALSO

mbsystem(1), mbgrid(1), mbm_grdtiff(1), gmt(1)

 

BUGS

Let us know.


 

Index

NAME
VERSION
SYNOPSIS
DESCRIPTION
MB-SYSTEM AUTHORSHIP
OPTIONS
EXAMPLES
SEE ALSO
BUGS


Last Updated: 22 September 2020


<< Manual page for the MB-System package | MB-System website >>