semvec/pypi-packages huggingface dataset:
meshpro 0.0.20
Mesh tools for professionals
Requires Python: >=3.7

<p align="center">
  <a href="https://github.com/meshpro/support"><img alt="meshpro" src="https://raw.githubusercontent.com/meshpro/support/gh-pages/_static/meshpro-logo.svg" width="60%"></a>
  <p align="center">Mesh tools for professionals.</p>
</p>

MeshPro is a Python library and command-line tool for mesh I/O and mesh manipulation.

It supports all mesh formats supported by
[meshio](https://github.com/nschloe/meshio).

<!--
plus a few more:

- [Abaqus](http://abaqus.software.polimi.it/v6.14/index.html) (`.inp`)
- ANSYS msh (`.msh`)
- [PERMAS](https://www.intes.de) (`.post`, `.post.gz`, `.dato`, `.dato.gz`)
- [Tecplot .dat](http://paulbourke.net/dataformats/tp/)
-->

Install MeshPro with

```
pip install meshpro
```

and <a href="mailto:nico.schloemer@gmail.com?subject=MeshPro license request">
retrieve a license key</a>.

The full API documentation is [here](https://meshpro.github.io/support/).

You can then use the command-line tool

<!--pytest-codeblocks:skip-->

```sh
meshpro convert    input.msh output.vtk   # convert between two formats

meshpro info       input.xdmf             # show some info about the mesh

meshpro compress   input.vtu              # compress the mesh file
meshpro decompress input.vtu              # decompress the mesh file

meshpro binary     input.msh              # convert to binary format
meshpro ascii      input.msh              # convert to ASCII format
```

or use MeshPro in Python with

```python
import meshpro
```

## MeshPro features

MeshPro meshes work exactly like [meshio](https://github.com/nschloe/meshio)
meshes, and they have a few extras:

```python
import meshpro


# create mesh
mesh = meshpro.Mesh(
    [[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]],
    [("triangle", [[0, 1, 2], [0, 2, 3]])],
)

# or read it in
# mesh = meshpro.read("mesh.vtk")

# remove duplicate points and take care of the indexing
mesh.deduplicate_points(tol=1.0e-10)

# remove all points which aren't referenced in any cell
mesh.remove_orphaned_points()

# remove a number of points or cells
# mesh.remove_points(mask)
# mesh.remove_cells(mask)

# add boundary cells
mesh.add_boundary_cells()

# add outer normals as cell data
mesh.add_outer_normals()
```

Other mesh manipulation tools are these:

<!--pytest-codeblocks:skip-->

```python
import meshpro

# extract boudnary mesh
boundary_mesh = boundary_meshmeshpro.extract_boundary_mesh(mesh)

# merge some meshes
mesh = meshpro.merge_meshes([mesh1, mesh2, mesh3])

submesh = meshpro.extract_submesh(mesh, point_mask, cell_mask)

submeshes = meshpro.split_cell_sets(mesh, store_orig_node_ids_as="gid")
```

### License

MeshPro is a commercial product. You need to <a
href="mailto:nico.schloemer@gmail.com?subject=MeshPro license request">acquire
a license</a> to use it. Trial licenses are available.