sesmesh 1.3.2
Rust library + CLI · v1.3.2

Solvent Excluded Surfaces.

sesmesh turns PDB, mmCIF, XYZ and PQR structures into closed, oriented triangle meshes of the molecular (Connolly) surface: every vertex on the exact surface, analytic normals, and the same bytes on one thread or sixteen.

Shell
$ cargo install sesmesh-cli
$ sesmesh 1crn.cif -q high -o 1crn.obj   # SES at 0.25 Å
Live 1CRN crambin drag · scroll · double-click
Loading …
mesh written by sesmesh · display copy
545 040atoms: the 1K4R virus capsid assembly, meshed at 1 Å in about 10 s on a 10-core laptop and about 6 s on an AMD Zen 5 16-core system
−0.20%mean area error at 0.25 Å on 53 proteins (volume −0.02 %)
0open or non-manifold edges: every mesh is validated before it is returned
1 = 16threads: byte-identical output for any thread count, tested
§01 · What you get

A mesh you can
compute on.

01 / EXACT

On the surface

The exact SES distance field is sampled on a grid, Marching Cubes finds the crossings, and every vertex is then solved onto the analytic surface (|F| ≤ 10⁻⁴·h). Normals come from the closest point, not from triangles.

02 / WATERTIGHT

Closed. Oriented.

Edge-manifold meshes with outward normals, split into components with area, signed volume and genus. Internal cavities are found, kept, removed or isolated on request.

03 / FAST

Sparse + SIMD

Only bricks near the surface are sampled. The field kernel dispatches at run time to AVX-512, AVX2, SSE4.2 or NEON; rayon spreads bricks over every core. Optional back ends sample on AMD GPUs through HIP and on NVIDIA GPUs through CUDA.

04 / REPRODUCIBLE

Same bytes

Output does not depend on the number of threads or on scheduling, nor on CPU or GPU in exact mode. Re-run a figure in a year and diff the OBJ files.

05 / LEVEL OF DETAIL

You set the budget

Grid spacing, presets, target vertex density, smoothing with exact re-projection, decimation that keeps vertices on the surface, and a memory limit that can coarsen the grid for you.

06 / OUTPUT

Your format

OBJ with groups and vertex colours, binary PLY, MSMS .vert/.face, all optionally gzipped; per-atom areas and per-vertex data as CSV, statistics as JSON.

§02 · Two ways in

Shell or Rust.

The CLI

One command from a file — or a whole directory of files — to a mesh. Pick the surface, the resolution and the extras.

Shell
# GroEL–GroES, fine grid, cavities removed,
# coloured by chain, decimated to a quarter
$ sesmesh 1aon.cif.gz -q high \
    --cavities remove --vertex-colors chain \
    --decimate 0.25 -o groel.ply
CLI guide →

The library

The same engine as a crate: spheres in, a validated mesh and its statistics out. Reuse one engine across trajectory frames.

Rust
use sesmesh::{compute_surface, Sphere, SurfaceParams};

let atoms = [
    Sphere::new([0.0, 0.0, 0.0], 1.7),
    Sphere::new([3.0, 0.0, 0.0], 1.7),
];
let params = SurfaceParams::ses(1.4).with_spacing(0.25);
let out = compute_surface(&atoms, &params)?;
println!("{} triangles, {:.1} Ų",
         out.stats.triangles, out.stats.area);
Library guide →
§03 · How it works

From atoms
to triangles.

F(x) = rp − d(x, P)

The SES is the zero level set of one exact function: the probe radius minus the distance to P, the set of positions the probe centre can reach. sesmesh builds P from the SAS arrangement (spheres, intersection circles, triple points), evaluates F only where the surface can be, and contours it.

  1. ReadPDB, mmCIF, XYZ, PQR, gzip; models, alt-locs, assemblies; radii (Bondi, Alvarez, ProtOr).
  2. ArrangeNeighbour lists, exposed circles and arcs, SAS triple points.
  3. SampleSparse bricks near the surface; SIMD kernel for exact field values.
  4. ContourMarching Cubes, then Newton steps onto F = 0 in f64.
  5. RefineComponents, cavities, optional smoothing and decimation.
  6. WriteOBJ, PLY, MSMS; CSV, JSON; validated before return.