MeshConverter.exe

The Mesh Converter can be used to convert Textured OSGB Meshes produced with SURE to the following formats: 3d_tilesslpk, obj, dae, lod_dae, lod_obj, local_obj

See also the GUI Mesh Converter Tool.

Untextured Meshes

Meshes without texture are not supported at the moment.

Georeferencing

For the formats 3d_tiles and slpk, the model's coordinate system in Well Known Text format (WKT) is required. The WKT file containing this information has to be provided as an argument.

Vertical coordinate systems

Compound coordinate systems containing a separate vertical coordinate system are supported through their WKID or by defining a compound coordinate system in the WKT. Alternatively, it is possible to remove the vertical component from your coordinate system and use the 

--coordinate-system-vertical-shift

flag to specify the offset between the ellipsoidal height and your vertical coordinate system. This is an optional flag. Its default value is set to 0. See also Coordinate System

3D Tiles Version

3D Tiles written by SURE 2.2.1.X and later can be used with Cesium 1.37 and later.

Over-imposing 3D Tiles heights on target ellipsoid

By default, 3D Tiles Meshes are converted from the project coordinate system to the ellipsoid of the 3D Tiles viewer (WGS 84). Alternatively, they can be over-imposed onto the 3D Tiles ellipsoid without numerically changing the height values. To do so, use the flag

--3d-tiles-over-impose-heights-on-target-ellipsoid

Export of SLPK in project coordinate system

By default, the SLPK format is exported in the standard global system of the ArcGIS world, which is using WGS84 for the horizontal and EGM96 for the vertical coordinate system. Besides, it is possible to export the SLPK in the specified project coordinate system by passing the option --slpk-export-in-project-coordinate-system. This option requires these arguments:

  • Horizontal and vertical WKID of the project coordinate system (see Esri documentation)

  • Height model which is either gravity_related_height or ellipsoidal

  • Height unit, e.g. meter

Note that for the horizontal WKID 4326, the vertical WKID must be either 5773 or 115700. Further possible values regarding the height model are listed in the i3s 1.7 specs under the heightModelInfo section.

Conversion to non-LOD formats

When converting to non-LOD formats like OBJ and DAE, it is necessary to specify the Project Area and Tiling settings through the --area flag.

Conversion to Local OBJ

The Mesh Converter enables exporting .obj meshes shifted to local coordinates, more suitable for viewing/processing in 3rd party software.

This new option is activated by choosing mesh format local_obj.

The shift to local coordinates can be manually specified with --local-obj-offset or left to its default value, resulting in a coordinate system with its origin at the project area centroid. The specified offset will be added to the original global coordinates.

CLI options and arguments

Option / arguments

Brief description

-h [--help]

Print help screen

-v [ --version ]

Print version and license details

--log arg

Path to log file.

--mesh arg

Path to the input main file of a textured .osgb LOD Mesh, usually 'Mesh.osgb' or 'DSM_Mesh.osgb'.

--mesh-formats <mesh format(s)>

Space separated list of texture file formats of the texture. Options are:
osgb, 3d_tiles, slpk, obj, local_obj

--mesh-texture-formats <texture format(s)>

Space separated list of Texture file formats. Options are: s3tc, jpg, png, dds, jpg_dds.

--coordinate-system arg

Path to file with input coordinate system in well-known-text (WKT) format.

--coordinate-system-vertical-shift <value>

Additional vertical shift that will be added to the coordinate system (optional, default 0)

--3d-tiles-over-impose-heights-on-target-ellipsoid

Over-impose heights on 3D Tiles target ellipsoid.

--output arg

Output directory.

  --3d-tiles-draco-compression

Enable draco Mesh compression for 3D Tiles

--3d-tiles-export-in-project-coordinate-system arg

Export 3D Tiles results in project coordinate system

--slpk-export-in-project-coordinate-system <horizontal_wkid> <vertical_wkid> <height_model> <height_unit>

Export SLPK results in project coordinate system. For horizontal WKID 4326, the vertical WKID must be either 5773 or 115700. Possible values for height model and height unit are listed in the i3s 1.7 spec in the heightModelInfo section.

  --area arg

Path to controlArea.txt file. Only required for non-LOD formats obj, local_obj and dae.

--local-obj-offset X Y Z

Override the default coordinate system origin (project area centroid) for local_obj by specifying an offset X Y Z to be added to every mesh vertex during export.

--edit-polygons arg

Mesh Editing: Path to shape file in which each area to edit is described by a polygon. The mesh corresponding to each connected area will be exported as a separate edit unit.

--mesh-force-export-single-file

Force exporting non-lod formats as single mesh file. This functionality should only be enabled for small meshes (e.g. up to 16000x16000 GSDs). These formats do not allow for a level of detail structure needed for performant rendering of large meshes. The memory usage of this functionality increases with the mesh size. If you would like to export large non-LOD meshes, please export them in a tiled fashion.

--clipping-polygons arg

Path to shapefile containing polygon(s) used to clip the Mesh during export. Only geometry intersecting the area of the polygon(s) will be exported.

--color-adjustment-lookup-table arg

Path to optional Color Lookup Table (LUT) file in .CUBE format to adjust the colors of the mesh texture. Can be applied to mesh output formats: osgb, 3d_tiles, slpk, obj, local_obj, dae.

Well-known-text format (WKT)

The following section shows an exemplary WKT coordinate system definition, as found in Inpho's project files. Copy and paste this block into a new text file and specify the file's path as an argument to the "--coordinate-system" option.

Example WKT file content

COMPD_CS["ETRS89 / UTM zone 32N + EGM2008 height",
    PROJCS["ETRS89 / UTM zone 32N",
        GEOGCS["ETRS89",
            DATUM["European_Terrestrial_Reference_System_1989",
                SPHEROID["GRS 1980",6378137,298.257222101,
                    AUTHORITY["EPSG","7019"]],
                AUTHORITY["EPSG","6258"]],
            PRIMEM["Greenwich",0,
                AUTHORITY["EPSG","8901"]],
            UNIT["degree",0.0174532925199433,
                AUTHORITY["EPSG","9122"]],
            AUTHORITY["EPSG","4258"]],
        PROJECTION["Transverse_Mercator"],
        PARAMETER["latitude_of_origin",0],
        PARAMETER["central_meridian",9],
        PARAMETER["scale_factor",0.9996],
        PARAMETER["false_easting",500000],
        PARAMETER["false_northing",0],
        UNIT["metre",1,
            AUTHORITY["EPSG","9001"]],
        AXIS["Easting",EAST],
        AXIS["Northing",NORTH],
        AUTHORITY["EPSG","25832"]],
    VERT_CS["EGM2008 height",
        VERT_DATUM["EGM2008 geoid",2005,
            AUTHORITY["EPSG","1027"]],
        UNIT["metre",1,
            AUTHORITY["EPSG","9001"]],
        AXIS["Gravity-related height",UP],
        AUTHORITY["EPSG","3855"]]]


Example CLI call

Simultaneous conversion of the OSGB Mesh to SLPK and 3D Tiles (with over-imposed heights on the target ellipsoid):

MeshConverter.exe --mesh Results/Mesh/osgb/Mesh.osgb
--mesh-formats slpk 3d_tiles
--mesh-texture-formats jpg_dds jpg
--coordinate-system Internal/coordinate_system.wkt
--3d-tiles-over-impose-heights-on-target-ellipsoid
--output Results/Mesh

This command line stream reads the pairs: slpk ↔︎ jpg_dds, 3d_tiles ↔ jpg.

See the full list of supported combinations in output formats.