Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Mesh

mesh creates a finite element mesh from a segmentation.

mesh hex produces an all-hexahedral (voxel) mesh. Its input is either a segmentation, meshed directly into hexahedra, or a tessellation, converted into hexahedra by octree dualization. An optional smooth subcommand can be chained directly onto mesh hex. A further remesh subcommand can also be chained after smoothautomesh mesh hex smooth remesh --help succeeds, so the command line accepts it — but running it always fails. remesh requires triangular connectivity, and a hex mesh has none, so the run-time error is always connectivity contains a non-triangular block.

mesh tri produces an all-triangular isosurface mesh of the material boundaries from a segmentation. An optional smooth subcommand can be chained directly onto it, and a further remesh subcommand can be chained after that — mesh tri smooth remesh works fully, since a triangular mesh satisfies remesh's connectivity requirement.

automesh mesh --help
Creates a finite element mesh from a segmentation

Usage: automesh mesh [OPTIONS] <COMMAND>

Commands:
  hex     Creates an all-hexahedral mesh from a segmentation or tessellation
  hexdom  Creates a hex-dominant mesh from a tessellation, polyhedral at the boundary
  poly    Creates a polyhedral mesh from a tessellation
  tri     Creates all-triangular isosurface(s) from a segmentation
  help    Print this message or the help of the given subcommand(s)

Options:
      --log <FILE>  Mirror terminal output to a log file
  -q, --quiet       Pass to quiet the terminal output
  -h, --help        Print help

Mesh Hex

automesh mesh hex --help
Creates an all-hexahedral mesh from a segmentation or tessellation

Usage: automesh mesh hex [OPTIONS] --input <FILE> --output <FILE> [COMMAND]

Commands:
  smooth  Applies smoothing to the mesh before output
  help    Print this message or the help of the given subcommand(s)

Options:
  -i, --input <FILE>      Segmentation (npy | spn) or tessellation (stl) input file
  -o, --output <FILE>     Mesh output file (exo | inp | mesh | stl | vtu)
  -d, --defeature <NUM>   Defeature clusters with less than NUM voxels
  -x, --nelx <NEL>        Number of voxels in the x-direction (spn)
  -y, --nely <NEL>        Number of voxels in the y-direction (spn)
  -z, --nelz <NEL>        Number of voxels in the z-direction (spn)
  -r, --remove <ID>...    Voxel IDs to remove from the mesh (npy | spn)
      --xscale <SCALE>    Scaling (> 0.0) in the x-direction, applied before translation [default: 1]
      --log <FILE>        Mirror terminal output to a log file
      --yscale <SCALE>    Scaling (> 0.0) in the y-direction, applied before translation [default: 1]
  -q, --quiet             Pass to quiet the terminal output
      --zscale <SCALE>    Scaling (> 0.0) in the z-direction, applied before translation [default: 1]
      --xtranslate <VAL>  Translation in the x-direction [default: 0]
      --ytranslate <VAL>  Translation in the y-direction [default: 0]
      --ztranslate <VAL>  Translation in the z-direction [default: 0]
  -s, --scale <SCALE>     Octree refinement scale for dualizing a tessellation (stl) input [default: 5]
  -t, --tolerance <TOL>   Chord-error tolerance for curvature-driven refinement [default: disabled]
      --strong            Uses strong balancing instead of the default weak balancing
      --snap              Snaps the buffer layer onto the surface instead of a soft fit
  -l, --levels <NUM>      Level difference allowed between neighboring octree cells (poly) [default: 1]
      --metrics <FILE>    Quality metrics output file (csv | npy)
  -h, --help              Print help

Mesh Tri

automesh mesh tri --help
Creates all-triangular isosurface(s) from a segmentation

Usage: automesh mesh tri [OPTIONS] --input <FILE> --output <FILE> [COMMAND]

Commands:
  smooth  Applies smoothing to the mesh before output
  help    Print this message or the help of the given subcommand(s)

Options:
  -i, --input <FILE>      Segmentation (npy | spn) or tessellation (stl) input file
  -o, --output <FILE>     Mesh output file (exo | inp | mesh | stl | vtu)
  -d, --defeature <NUM>   Defeature clusters with less than NUM voxels
  -x, --nelx <NEL>        Number of voxels in the x-direction (spn)
  -y, --nely <NEL>        Number of voxels in the y-direction (spn)
  -z, --nelz <NEL>        Number of voxels in the z-direction (spn)
  -r, --remove <ID>...    Voxel IDs to remove from the mesh (npy | spn)
      --xscale <SCALE>    Scaling (> 0.0) in the x-direction, applied before translation [default: 1]
      --log <FILE>        Mirror terminal output to a log file
      --yscale <SCALE>    Scaling (> 0.0) in the y-direction, applied before translation [default: 1]
  -q, --quiet             Pass to quiet the terminal output
      --zscale <SCALE>    Scaling (> 0.0) in the z-direction, applied before translation [default: 1]
      --xtranslate <VAL>  Translation in the x-direction [default: 0]
      --ytranslate <VAL>  Translation in the y-direction [default: 0]
      --ztranslate <VAL>  Translation in the z-direction [default: 0]
  -s, --scale <SCALE>     Octree refinement scale for dualizing a tessellation (stl) input [default: 5]
  -t, --tolerance <TOL>   Chord-error tolerance for curvature-driven refinement [default: disabled]
      --strong            Uses strong balancing instead of the default weak balancing
      --snap              Snaps the buffer layer onto the surface instead of a soft fit
  -l, --levels <NUM>      Level difference allowed between neighboring octree cells (poly) [default: 1]
      --metrics <FILE>    Quality metrics output file (csv | npy)
  -h, --help              Print help

Mesh Hex Smooth

automesh mesh hex smooth --help
Applies smoothing to the mesh before output

Usage: automesh mesh hex --input <FILE> --output <FILE> smooth [OPTIONS] [COMMAND]

Commands:
  remesh  Applies remeshing to the mesh before output [default mode: uniform]
  help    Print this message or the help of the given subcommand(s)

Options:
  -n, --iterations <NUM>  Number of smoothing iterations [default: 20]
  -m, --method <NAME>     Smoothing method (Laplace | Taubin) [default: Taubin]
  -k, --pass-band <FREQ>  Pass-band frequency (for Taubin only) [default: 0.1]
  -s, --scale <SCALE>     Scaling parameter for all smoothing methods [default: 0.6307]
  -b, --hierarchical      Enables hierarchical smoothing
      --log <FILE>        Mirror terminal output to a log file
  -q, --quiet             Pass to quiet the terminal output
  -h, --help              Print help

mesh hex smooth accepts a further remesh subcommand at the command line (automesh mesh hex smooth remesh --help succeeds), but running it always fails — remesh requires triangular connectivity, and a hex mesh has none. Remeshing after smoothing is only meaningful for mesh tri, below.

Mesh Tri Smooth

automesh mesh tri smooth --help
Applies smoothing to the mesh before output

Usage: automesh mesh tri --input <FILE> --output <FILE> smooth [OPTIONS] [COMMAND]

Commands:
  remesh  Applies remeshing to the mesh before output [default mode: uniform]
  help    Print this message or the help of the given subcommand(s)

Options:
  -n, --iterations <NUM>  Number of smoothing iterations [default: 20]
  -m, --method <NAME>     Smoothing method (Laplace | Taubin) [default: Taubin]
  -k, --pass-band <FREQ>  Pass-band frequency (for Taubin only) [default: 0.1]
  -s, --scale <SCALE>     Scaling parameter for all smoothing methods [default: 0.6307]
  -b, --hierarchical      Enables hierarchical smoothing
      --log <FILE>        Mirror terminal output to a log file
  -q, --quiet             Pass to quiet the terminal output
  -h, --help              Print help

Mesh Tri Smooth Remesh

automesh mesh tri smooth remesh --help
Applies remeshing to the mesh before output [default mode: uniform]

Usage: automesh mesh tri smooth remesh [OPTIONS] [COMMAND]

Commands:
  uniform   Uniform target edge length over the whole mesh
  adaptive  Curvature-adaptive target edge length
  help      Print this message or the help of the given subcommand(s)

Options:
      --log <FILE>  Mirror terminal output to a log file
  -q, --quiet       Pass to quiet the terminal output
  -h, --help        Print help

Examples

  • Torus — a genus-1 solid meshed and smoothed in a single chained mesh hex smooth command, comparing raw vs. smoothed element quality, and reproducing the mesh hex smooth remesh failure documented above.
  • Remeshed unit spheremesh hex dualizing a triangular surface into a solid all-hexahedral volume, and how the --scale octree depth affects element quality.
  • Unit sphere and the Stanford bunnymesh tri smooth remesh worked in full, as part of the Remesh examples.