Metadata-Version: 2.4
Name: ras-commander-fast-mesh
Version: 0.1.0
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Programming Language :: Rust
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Topic :: Scientific/Engineering :: Hydrology
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.md
License-File: licenses/DEPENDENCIES.md
License-File: licenses/dependencies/accurate-0.3.1/LICENSE-APACHE
License-File: licenses/dependencies/accurate-0.3.1/LICENSE-MIT
License-File: licenses/dependencies/adler2-2.0.1/LICENSE-0BSD
License-File: licenses/dependencies/adler2-2.0.1/LICENSE-APACHE
License-File: licenses/dependencies/adler2-2.0.1/LICENSE-MIT
License-File: licenses/dependencies/allocator-api2-0.2.21/LICENSE-APACHE
License-File: licenses/dependencies/allocator-api2-0.2.21/LICENSE-MIT
License-File: licenses/dependencies/approx-0.5.1/LICENSE
License-File: licenses/dependencies/bitflags-2.13.2/LICENSE-APACHE
License-File: licenses/dependencies/bitflags-2.13.2/LICENSE-MIT
License-File: licenses/dependencies/block-buffer-0.10.4/LICENSE-APACHE
License-File: licenses/dependencies/block-buffer-0.10.4/LICENSE-MIT
License-File: licenses/dependencies/cfg-if-1.0.5/LICENSE-APACHE
License-File: licenses/dependencies/cfg-if-1.0.5/LICENSE-MIT
License-File: licenses/dependencies/cpufeatures-0.2.17/LICENSE-APACHE
License-File: licenses/dependencies/cpufeatures-0.2.17/LICENSE-MIT
License-File: licenses/dependencies/crc32fast-1.5.5/LICENSE-APACHE
License-File: licenses/dependencies/crc32fast-1.5.5/LICENSE-MIT
License-File: licenses/dependencies/crossbeam-deque-0.8.8/LICENSE-APACHE
License-File: licenses/dependencies/crossbeam-deque-0.8.8/LICENSE-MIT
License-File: licenses/dependencies/crossbeam-epoch-0.9.21/LICENSE-APACHE
License-File: licenses/dependencies/crossbeam-epoch-0.9.21/LICENSE-MIT
License-File: licenses/dependencies/crossbeam-utils-0.8.23/LICENSE-APACHE
License-File: licenses/dependencies/crossbeam-utils-0.8.23/LICENSE-MIT
License-File: licenses/dependencies/crypto-common-0.1.7/LICENSE-APACHE
License-File: licenses/dependencies/crypto-common-0.1.7/LICENSE-MIT
License-File: licenses/dependencies/digest-0.10.7/LICENSE-APACHE
License-File: licenses/dependencies/digest-0.10.7/LICENSE-MIT
License-File: licenses/dependencies/either-1.19.0/LICENSE-APACHE
License-File: licenses/dependencies/either-1.19.0/LICENSE-MIT
License-File: licenses/dependencies/equivalent-1.0.3/LICENSE-APACHE
License-File: licenses/dependencies/equivalent-1.0.3/LICENSE-MIT
License-File: licenses/dependencies/errno-0.3.15/LICENSE-APACHE
License-File: licenses/dependencies/errno-0.3.15/LICENSE-MIT
License-File: licenses/dependencies/flate2-1.1.11/LICENSE-APACHE
License-File: licenses/dependencies/flate2-1.1.11/LICENSE-MIT
License-File: licenses/dependencies/foldhash-0.2.0/LICENSE
License-File: licenses/dependencies/generic-array-0.14.7/LICENSE
License-File: licenses/dependencies/geo-types-0.7.20/LICENSE-APACHE
License-File: licenses/dependencies/geo-types-0.7.20/LICENSE-MIT
License-File: licenses/dependencies/geographiclib-rs-0.2.7/LICENSE
License-File: licenses/dependencies/hashbrown-0.16.1/LICENSE-APACHE
License-File: licenses/dependencies/hashbrown-0.16.1/LICENSE-MIT
License-File: licenses/dependencies/hdf5-core-0.12.1/LICENSE-APACHE
License-File: licenses/dependencies/hdf5-core-0.12.1/LICENSE-MIT
License-File: licenses/dependencies/hdf5-metno-src-0.10.4/ext__hdf5__LICENSE
License-File: licenses/dependencies/hdf5-metno-sys-0.12.5/LICENSE-APACHE
License-File: licenses/dependencies/hdf5-metno-sys-0.12.5/LICENSE-MIT
License-File: licenses/dependencies/hdf5-reader-0.12.1/LICENSE-APACHE
License-File: licenses/dependencies/hdf5-reader-0.12.1/LICENSE-MIT
License-File: licenses/dependencies/ieee754-0.2.6/LICENSE-APACHE
License-File: licenses/dependencies/ieee754-0.2.6/LICENSE-MIT
License-File: licenses/dependencies/itoa-1.0.19/LICENSE-APACHE
License-File: licenses/dependencies/itoa-1.0.19/LICENSE-MIT
License-File: licenses/dependencies/libc-0.2.191/LICENSE-APACHE
License-File: licenses/dependencies/libc-0.2.191/LICENSE-MIT
License-File: licenses/dependencies/libm-0.2.16/LICENSE.txt
License-File: licenses/dependencies/libz-sys-1.1.33/LICENSE-APACHE
License-File: licenses/dependencies/libz-sys-1.1.33/LICENSE-MIT
License-File: licenses/dependencies/libz-sys-1.1.33/src__zlib__LICENSE
License-File: licenses/dependencies/linux-raw-sys-0.12.1/COPYRIGHT
License-File: licenses/dependencies/linux-raw-sys-0.12.1/LICENSE-APACHE
License-File: licenses/dependencies/linux-raw-sys-0.12.1/LICENSE-Apache-2.0_WITH_LLVM-exception
License-File: licenses/dependencies/linux-raw-sys-0.12.1/LICENSE-MIT
License-File: licenses/dependencies/lock_api-0.4.14/LICENSE-APACHE
License-File: licenses/dependencies/lock_api-0.4.14/LICENSE-MIT
License-File: licenses/dependencies/lru-0.16.4/LICENSE
License-File: licenses/dependencies/lz4_flex-0.11.7/LICENSE
License-File: licenses/dependencies/matrixmultiply-0.3.11/LICENSE-APACHE
License-File: licenses/dependencies/matrixmultiply-0.3.11/LICENSE-MIT
License-File: licenses/dependencies/memchr-2.8.3/COPYING
License-File: licenses/dependencies/memchr-2.8.3/LICENSE-MIT
License-File: licenses/dependencies/memmap2-0.9.12/LICENSE-APACHE
License-File: licenses/dependencies/memmap2-0.9.12/LICENSE-MIT
License-File: licenses/dependencies/miniz_oxide-0.9.1/LICENSE
License-File: licenses/dependencies/miniz_oxide-0.9.1/LICENSE-APACHE.md
License-File: licenses/dependencies/miniz_oxide-0.9.1/LICENSE-MIT.md
License-File: licenses/dependencies/miniz_oxide-0.9.1/LICENSE-ZLIB.md
License-File: licenses/dependencies/ndarray-0.17.2/LICENSE-APACHE
License-File: licenses/dependencies/ndarray-0.17.2/LICENSE-MIT
License-File: licenses/dependencies/num-complex-0.4.6/LICENSE-APACHE
License-File: licenses/dependencies/num-complex-0.4.6/LICENSE-MIT
License-File: licenses/dependencies/num-integer-0.1.47/LICENSE-APACHE
License-File: licenses/dependencies/num-integer-0.1.47/LICENSE-MIT
License-File: licenses/dependencies/num-traits-0.2.19/LICENSE-APACHE
License-File: licenses/dependencies/num-traits-0.2.19/LICENSE-MIT
License-File: licenses/dependencies/parking_lot-0.12.5/LICENSE-APACHE
License-File: licenses/dependencies/parking_lot-0.12.5/LICENSE-MIT
License-File: licenses/dependencies/parking_lot_core-0.9.12/LICENSE-APACHE
License-File: licenses/dependencies/parking_lot_core-0.9.12/LICENSE-MIT
License-File: licenses/dependencies/proj-core-0.13.1/LICENSE-APACHE
License-File: licenses/dependencies/proj-core-0.13.1/LICENSE-MIT
License-File: licenses/dependencies/proj-core-0.13.1/LICENSE-PROJ-9.6.2
License-File: licenses/dependencies/proj-epsg-format-0.13.1/LICENSE-APACHE
License-File: licenses/dependencies/proj-epsg-format-0.13.1/LICENSE-MIT
License-File: licenses/dependencies/proj-epsg-format-0.13.1/LICENSE-PROJ-9.6.2
License-File: licenses/dependencies/proj-wkt-0.13.1/LICENSE-APACHE
License-File: licenses/dependencies/proj-wkt-0.13.1/LICENSE-MIT
License-File: licenses/dependencies/proj-wkt-0.13.1/LICENSE-PROJ-9.6.2
License-File: licenses/dependencies/ras-commander-fast-hdf-0.5.1/LICENSE
License-File: licenses/dependencies/rawpointer-0.2.1/LICENSE-APACHE
License-File: licenses/dependencies/rawpointer-0.2.1/LICENSE-MIT
License-File: licenses/dependencies/rayon-1.12.0/LICENSE-APACHE
License-File: licenses/dependencies/rayon-1.12.0/LICENSE-MIT
License-File: licenses/dependencies/rayon-core-1.13.0/LICENSE-APACHE
License-File: licenses/dependencies/rayon-core-1.13.0/LICENSE-MIT
License-File: licenses/dependencies/robust-1.2.0/LICENSE-APACHE
License-File: licenses/dependencies/robust-1.2.0/LICENSE-MIT
License-File: licenses/dependencies/rustix-1.1.6/COPYRIGHT
License-File: licenses/dependencies/rustix-1.1.6/LICENSE-APACHE
License-File: licenses/dependencies/rustix-1.1.6/LICENSE-Apache-2.0_WITH_LLVM-exception
License-File: licenses/dependencies/rustix-1.1.6/LICENSE-MIT
License-File: licenses/dependencies/scopeguard-1.2.0/LICENSE-APACHE
License-File: licenses/dependencies/scopeguard-1.2.0/LICENSE-MIT
License-File: licenses/dependencies/serde-1.0.229/LICENSE-APACHE
License-File: licenses/dependencies/serde-1.0.229/LICENSE-MIT
License-File: licenses/dependencies/serde_core-1.0.229/LICENSE-APACHE
License-File: licenses/dependencies/serde_core-1.0.229/LICENSE-MIT
License-File: licenses/dependencies/serde_json-1.0.154/LICENSE-APACHE
License-File: licenses/dependencies/serde_json-1.0.154/LICENSE-MIT
License-File: licenses/dependencies/sha2-0.10.9/LICENSE-APACHE
License-File: licenses/dependencies/sha2-0.10.9/LICENSE-MIT
License-File: licenses/dependencies/simd-adler32-0.3.10/LICENSE.md
License-File: licenses/dependencies/smallvec-1.16.6/LICENSE-APACHE
License-File: licenses/dependencies/smallvec-1.16.6/LICENSE-MIT
License-File: licenses/dependencies/spade-2.15.1/LICENSE-APACHE
License-File: licenses/dependencies/spade-2.15.1/LICENSE-MIT
License-File: licenses/dependencies/thiserror-2.0.21/LICENSE-APACHE
License-File: licenses/dependencies/thiserror-2.0.21/LICENSE-MIT
License-File: licenses/dependencies/twox-hash-2.1.5/LICENSE.txt
License-File: licenses/dependencies/typenum-1.20.1/LICENSE
License-File: licenses/dependencies/typenum-1.20.1/LICENSE-APACHE
License-File: licenses/dependencies/typenum-1.20.1/LICENSE-MIT
License-File: licenses/dependencies/windows-link-0.2.1/license-apache-2.0
License-File: licenses/dependencies/windows-link-0.2.1/license-mit
License-File: licenses/dependencies/windows-sys-0.61.2/license-apache-2.0
License-File: licenses/dependencies/windows-sys-0.61.2/license-mit
License-File: licenses/dependencies/zlib-rs-0.6.8/LICENSE
License-File: licenses/dependencies/zmij-1.0.23/LICENSE-MIT
License-File: licenses/upstream/hdf5-rust/LICENSE-APACHE
License-File: licenses/upstream/hdf5-rust/LICENSE-MIT
License-File: licenses/upstream/hdf5-rust/SOURCE.md
License-File: licenses/upstream/netcdf-rust/LICENSE-APACHE
License-File: licenses/upstream/netcdf-rust/LICENSE-MIT
License-File: licenses/upstream/netcdf-rust/SOURCE.md
License-File: licenses/upstream/proj-rust/LICENSE-APACHE
License-File: licenses/upstream/proj-rust/LICENSE-MIT
License-File: licenses/upstream/proj-rust/LICENSE-PROJ-9.6.2
License-File: licenses/upstream/proj-rust/SOURCE.md
Summary: Standalone Rust mesh generation engine for HEC-RAS 7.x 2D flow areas (research stage)
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/gpt-cmdr/ras-commander-fast-mesh/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/gpt-cmdr/ras-commander-fast-mesh/issues
Project-URL: Repository, https://github.com/gpt-cmdr/ras-commander-fast-mesh

# ras-commander-fast-mesh

Standalone Rust mesh generation for HEC-RAS 7.x projects. Experimental, research-stage software: not for
regulatory or design use without independent review of every result.

Two planned modes share one topology model and one 7.x export backend:
- `legacy_701`: recreate the documented cell-centric HEC-RAS 7.0.1 meshing behavior.
- `face_centric`: recreate the documented RAS2025 conceptual/face-centric meshing behavior, targeting **7.x output only**.

Neither mode requires HEC-RAS, Python, GDAL, or RAS Commander to generate meshes. RAS2025 is an algorithm reference, not an output target. Exact mesh equivalence is a research objective, not an established capability. `legacy_701` v3 follows HEC-RAS 7.0.1's mesh construction and its triangulation order, enforcing breaklines and structure lines, and RAS Mapper 7.0.1's seed generation. From HEC-RAS's stored seeds it reproduces all 29 reference areas, 5 new HEC-RAS 7.0.1 test areas and two eBFE-derived areas (191,810 and 1,511,766 cells) exactly cell for cell. On every RAS Mapper 7.0.1-generated test area its seeds match RAS Mapper's in order. A 1.5M-cell area meshes in about 30 s. `legacy_701` v4 also numbers the mesh as HEC-RAS 7.0.1 does: faces, facepoints, ghosts, face directions and facepoint fans. It emulates the x87 arithmetic `Ras.exe` uses for areas of up to 5500 cells. On 35 reference areas every HDF connectivity and coordinate table is byte-identical to HEC-RAS's. Through HEC-RAS 7.0.1, locked `mesh` output on Muncie and BaldEagle g10 gives preprocessed geometry and plan results byte-identical to HEC-RAS's own mesh. See [legacy-mesher](docs/legacy-mesher.md) for the evidence and the open gaps. `mesh --repair` (opt-in) ports RAS Commander's seed and perimeter repairs; on the 1.5M-cell eBFE area and RAS Commander's repaired test areas it makes RAS Commander's decisions (see [mesh-repair](docs/mesh-repair.md)). A HEC-RAS 7.x geometry HDF writer (feature `hdf5`) exports 2D meshes; HEC-RAS 7.0.1 keeps an exported mesh when the area is locked (see [hdf-writer](docs/hdf-writer.md)).

See [research](docs/research.md), [architecture](docs/architecture.md), [roadmap](docs/roadmap.md), and the [HDF schema inventory](docs/hdf-schema-inventory.md).

Every known gap (residuals, unmodelled and unqualified behaviour, limits, infrastructure and RAS Commander dependencies) is registered in [known gaps](docs/known-gaps.md), one GitHub issue per gap (label `known-gap`).

On the integrated `legacy-701-integration` branch (v5, line crossings, exact seed generation and repair), every HEC-RAS 7.0.1 corpus area except one is byte-identical from its stored seeds. From geometry text, `mesh --seeds generated --repair` reproduces RAS Commander's `GeomMesh.generate` seeds and repairs, and HEC-RAS 7.0.1's mesh byte for byte, on every corpus area whose seeds came from it, including the 1.5M-cell eBFE area. Corpus qualification against HEC-RAS 7.0.1 (HEC 7.0 examples and eBFE models, 11 to 1,511,766 cells) and timing: [corpus-results](docs/corpus-results.md) and [benchmarks](docs/benchmarks.md).

Current capability: a shared topology model and an in-memory derivation of 7.x connectivity tables. It also provides an independent mesh validator and conformance checks against HEC-RAS-written reference meshes.

```text
cargo test --locked
python -I tools/export_reference_fixture.py <geometry.g##.hdf> <fixture_dir>   # read-only; needs h5py
cargo run --release -- conform  <fixture_dir>/<file>.json
cargo run --release -- validate <fixture_dir>/<file>.json
cargo run --release -- legacy-compare <fixture_dir>/<file>.json                # schema v2-v4 fixtures
cargo run --release -- legacy-compare <fixture.json> --seeds generated         # mesh from RAS Mapper 7.0.1 seed rules
cargo run --release -- legacy-compare <fixture.json> --seeds centers           # mesh from HEC's cell centres (its TIN input)
cargo run --release -- legacy-compare <fixture.json> --enforce-region-boundaries   # RAS Mapper's own line set
cargo run --release -- legacy-compare <fixture.json> --hec-host ras-mapper  # RAS Mapper's (64-bit) arithmetic; default ras-exe
cargo run --release -- settings <geometry.g##>                                  # parsed 2D mesh settings
FAST_MESH_REFERENCE_DIR=<fixture_dir> cargo test --locked                      # corpus conformance
cargo run --release --features hdf5 -- export <g##.hdf|fixture.json> --area <name> --out <file.hdf> [--into <g##.hdf>] [--locked]
```

Python packaging: `pyproject.toml` builds a maturin `bindings = "bin"` wheel that installs the
`ras-commander-fast-mesh` executable with the `hdf5` feature. RAS Commander would drive it as a
subprocess (`--version`, `capabilities`, `--json-errors`, `mesh`). Nothing is published. See
[integration](docs/integration.md).

```text
python -I tools/netpow/build_netpow32.py           # Windows: the pinned netpow32.exe, built reproducibly
python -I scripts/stage_wheel_data.py              # wheel .data: that helper on Windows, empty elsewhere
python -m maturin build --release --out dist        # maturin 1.16.0; needs CMake and a C compiler
python -m pip install --no-index --no-deps --find-links dist ras-commander-fast-mesh
python -I tools/smoke_engine_wheel.py
```

Keep fixtures outside the repository.

## Known limitations

- **Short, strongly curved RAS2025 channel regions can fail to mesh** (FC-05,
  [#45](https://github.com/gpt-cmdr/ras-commander-fast-mesh/issues/45)). In a stress run, 3 of
  120 random single-region channels, 1.5 to 2.3 widths long with a meander amplitude of 1.3 to
  1.5 widths, failed on both quad paths with a folded or non-convex cell. Whether RAS2025
  meshes them is not known.
- **On Linux and other non-Windows hosts, `mesh --out-dir` publishing is not race-free** (EXP-05,
  [#62](https://github.com/gpt-cmdr/ras-commander-fast-mesh/issues/62)). The project copy is
  published with one directory rename. POSIX `rename` replaces an empty directory that another
  process creates at the destination after the preflight check. Windows refuses it.

Every other gap (parity residuals, limits, infrastructure) is in [known gaps](docs/known-gaps.md).

## License

MIT; see [LICENSE](LICENSE). Bundled third-party components are listed in
[THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).

RAS Commander and this engine are independent open-source projects. They are not affiliated
with, endorsed by or supported by the U.S. Army Corps of Engineers Hydrologic Engineering
Center (HEC).

