Installation
Use automesh
from one of the following interfaces:
- command line interface,
- Rust interface, or
- Python interface.
All interfaces are independent from each other:
- The Rust interfaces can be used without the Python interface.
- The Python interface can be used without the Rust interfaces.
For macOS and Linux, use a terminal. For Windows, use a Command Prompt (CMD) or PowerShell.
Step 1: Install Prerequisites
- The command line interface and Rust interface depend on Rust and Cargo.
- Cargo is the Rust package manager.
- Cargo is included with the Rust installation.
- The Python interface depends on Python and pip.
- pip is the Python package installer.
- pip is included with the standard installation of Python starting from Python 3.4.
Rust Prerequisites
It is recommended to install Rust using Rustup, which is an installer and version management tool.
Python Prerequisites
macOS
- Install Homebrew (if you don't have it already). Open the Terminal and run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install Python. After Homebrew is installed, run:
brew install python
- Verify Python and pip are installed:
python3 --version
pip3 --version
Linux
- Update Package List. Open a terminal and run:
sudo apt update
- Install Python and pip. For Ubuntu or Debian-based systems, run:
sudo apt install python3 python3-pip
- Verify Python and pip are installed:
python3 --version
pip3 --version
Windows
- Download Python. Go to the official Python website and download the latest version of Python for Windows.
- Run the Installer. During installation, make sure to check the box that says "Add Python to PATH."
- Verify Python and pip are installed:
python --version
pip --version
All Environments
On all environments, a virtual environment is recommended, but not required. Create a virtual environment:
python3 -m venv .venv # venv, or
uv venv .venv # using uv
uv
is a fast Python package manager, written in Rust. It is an alternative to pip
.
Activate the virtual environment:
source .venv/bin/activate # for bash shell
source .venv/bin/activate.csh # for c shell
source .venv/bin/activate.fish # for fish shell
.\.venv\Scripts\activate # for powershell
Step 2: Install automesh
Install the desired interface.
Command Line Interface
cargo install automesh
Rust Interface
cargo add automesh
Python Interface
pip install automesh # using pip, or
uv pip install automesh # using uv
Step 3: Verify Installation
Rust Interfaces
Run the command line help:
automesh
which should display the following:
@@@@@@@@@@@@@@@@
@@@@ @@@@@@@@@@
@@@@ @@@@@@@@@@@
@@@@ @@@@@@@@@@@@ automesh: Automatic mesh generation
@@ @@ @@ v0.3.5 build c5cd5b4 linux x86_64
@@ @@ @@ Chad B. Hovey <chovey@sandia.gov>
@@@@@@@@@@@@ @@@ Michael R. Buche <mrbuche@sandia.gov>
@@@@@@@@@@@ @@@@
@@@@@@@@@@ @@@@@ @
@@@@@@@@@@@@@@@@
Usage: automesh [COMMAND]
Commands:
convert Converts between mesh or segmentation file types
defeature Defeatures and creates a new segmentation
diff Show the difference between two segmentations
extract Extracts a specified range of voxels from a segmentation
mesh Creates a finite element mesh from a segmentation
metrics Quality metrics for an existing finite element mesh
remesh Applies isotropic remeshing to an existing mesh
segment Creates a segmentation or voxelized mesh from an existing mesh
smooth Applies smoothing to an existing mesh
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
Python Interface
python
# In Python, import the module
>>> import automesh
# List all attributes and methods of the module
>>> dir(automesh)
# Get help on the module
>>> help(automesh)