# mesh-editor v3.2.3 **Mercurial revision 5786:5c8b45563631 | 2026-08-04** --- ## Description `mesh-editor` is a tool designed to perform operations on an input grid (mesh). It allows you to modify, transform, and save mesh files in the `.nei` format. --- ## Usage ```bash mesh-editor [OPTIONS] -m input ``` --- ## Options | Option | Description | | -------------- | --------------------------------------------------------------------------------------------- | | `-h`, `--help` | Display this help and exit. | | `-m ` | **Required.** Input mesh file (`.nei` format). | | `-o ` | Output filename. Default: `mesh-editor.nei`. | | `--proj` | Activate projection on a spherical grid. Uses a basic method (see [PROJ](#proj) for details). | | `--flip` | Flip the north-south axis. | | `--symetric` | Add the symmetric mesh relative to the equator to the final mesh. | --- ### Deprecated Options > ⚠️ **Warning:** These options are deprecated and may not be supported in future versions. | Option | Description | | ------------ | --------------------------------------------------------- | | `-p ` | Polygon file to limit the working area for safety checks. | | `-b ` | Boundary file (`.bel` format). | | `-c` | Check for channel edges. | | `-d ` | Minimum resolution: merge all smaller connections. | | `-e ` | (No description available in the original documentation.) | | `-z` | Pre-set zone to limit the working area. | | `--debug` | Activate debug verbose mode. | --- (proj)= ## PROJ When the `--proj` option is enabled, the mesh is projected onto spherical coordinates using the following method: - **Longitude:** `lon = x * 110. / 100.` - **Latitude:** `lat = y + acos(100. / 110.) * 180. / PI` --- ## Examples ### **Basic Mesh Editing** Load an input mesh file and save it with the default output name: ```bash mesh-editor -m input.nei ``` ### **Save to a Custom Output File** Load an input mesh and save it to a custom output file: ```bash mesh-editor -m input.nei -o output.nei ``` ### **Project Mesh on Spherical Coordinates** Project the mesh onto spherical coordinates: ```bash mesh-editor -m input.nei --proj -o projected_mesh.nei ``` ### **Flip North-South Axis** Flip the north-south axis of the mesh: ```bash mesh-editor -m input.nei --flip -o flipped_mesh.nei ``` ### **Add Symmetric Mesh Relative to the Equator** Add the symmetric mesh relative to the equator: ```bash mesh-editor -m input.nei --symetric -o symmetric_mesh.nei ``` ### **Combine Projection and Flip** Project the mesh and flip the north-south axis: ```bash mesh-editor -m input.nei --proj --flip -o projected_flipped_mesh.nei ``` ### **Combine All Transformations** Project the mesh, flip the north-south axis, and add the symmetric mesh: ```bash mesh-editor -m input.nei --proj --flip --symetric -o final_mesh.nei ``` --- ## Environment Variables `mesh-editor` does not explicitly use environment variables. However, it may inherit standard system environment variables for file handling and debugging. --- ## Notes 1. **Input File:** - The input mesh file **must** be in `.nei` format. - The `-m` option is **mandatory**. If not provided, the tool will exit with an error. 2. **Output File:** - If no output filename is specified (`-o`), the default `mesh-editor.nei` will be used. 3. **Transformations:** - The `--proj`, `--flip`, and `--symetric` options can be combined to apply multiple transformations in sequence. - The order of transformations matters. For example, flipping the mesh before projecting it may yield different results than projecting first and then flipping. 4. **Deprecated Options:** - Avoid using deprecated options, as they may be removed in future versions. --- ## See Also - [`mesh-doctor`](https://www.comodo-ocean.fr/) for more advanced mesh operations