Skip to main content

限界 (Genkai) — pure-Rust structural cross-section analysis & EN 1992 RC/PSC design engine, with a Python API. Every section checked against its limit state (限界状態 · genkai jōtai).

Project description

限界 Genkai — structural cross-sections, pushed to the limit

限界 · Genkai

Structural cross-sections, pushed to the limit.

License: Apache-2.0 Status: pre-alpha Python 3.9+ Rust 1.83+


Genkai (限界, "the limit") is a pure-Rust engine for structural cross-section analysis, exposed through a Python API and a desktop GUI.

It computes the geometric, elastic, plastic, and warping/torsion properties of arbitrary cross-sections (massive or thin-walled, with holes, single- or multi-material), and has grown into a reinforced and prestressed concrete (RC/PSC) section design and verification engine to the Eurocodes (EN 1992).

Why the name. In structural engineering, 限界状態 (genkai jōtai) is the limit state — the ultimate and serviceability limits that the whole of Eurocode design is built around. Every section this engine touches is checked against its limit. And もう限界 (mou genkai, "I'm at my limit") is, roughly, how it felt to name the thing. The name stuck for both reasons.

Status: pre-alpha. Phases 1–5 are shipped (geometry/elastic/plastic/warping replacing sectionproperties, multi-material, thin-wall shear/torsion, and an EN 1992 RC/PSC design engine); Phases 6 (EN 1992 conformance hardening) and 7 (design feature-parity) are outstanding. See CHANGELOG.md for completed work.

Why

  • Performance — a native, parallel Rust core (single sparse factorization reused across right-hand sides, GIL-free assembly) instead of interpreted Python.
  • Independence — a fully owned, permissively licensed computation stack with no third-party analysis engine.
  • Scope — multi-material sections and RC/PSC design to the Eurocodes, an area not covered by existing open tools.

Architecture

  • crates/genkai-core — pure Rust computation core: geometry, meshing, finite-element warping, and section properties. No Python, no GUI.
  • crates/genkai-py — PyO3 bindings exposing the genkai._genkai extension module.
  • crates/genkai-gui — Tauri v2 desktop backend over the core (serde DTOs). The frontend lives in gui/ (React + Vite + TypeScript).
  • python/genkai — the Python package surface.
  • docs/theory — the theory manual (mdBook): derivations and validation references.
  • docs/api — the Python API guide (mdBook): how to drive the engine, with runnable examples.

At a glance

import genkai

g = genkai.Geometry(outers=[[(0, 0), (100, 0), (100, 60), (0, 60)]])
sec = genkai.Section(g, material=genkai.Material("steel", 200e3, 0.3, 355, 7.85e-9))

geo = sec.geometric()                 # frozen results: .area, .ixx_c, .perimeter, …
solved = sec.analyze(mesh_size=5.0)   # mesh + warping solve, once
warp = solved.warping()               # .j, .cw, .x_se, …
stress = solved.stress(mxx=1e6, mzz=5e4)

Technology stack

Permissive licenses only, enforced in CI by deny.toml:

Concern Crate
Polygon boolean ops geo / i_overlay
Quality meshing spade (constrained Delaunay + Ruppert refinement)
Sparse direct solver faer
Python bindings / packaging pyo3, rust-numpy, maturin
Desktop GUI tauri

Build (developer)

Requires Rust (stable, MSRV 1.83). Building the GUI backend (crates/genkai-gui) additionally needs the frontend bundle, which Tauri embeds at compile time — build it first:

cd gui && npm ci && npm run build   # produces gui/dist (required by `cargo build --workspace`)
cd ..

Then the Rust workspace:

cargo build --workspace      # build the Rust core, bindings, and GUI backend
cargo test  --workspace      # run the Rust test suite
cargo deny  check            # license and advisory gate

The Python extension is built and installed into the active virtual environment with maturin — the recommended developer loop:

maturin develop              # build + install `genkai` (editable) into the active venv
pytest python/tests          # run the Python test suite

To rebuild the extension manually without maturin, build the crate and copy the artifact next to the package using the name for your platform:

cargo build -p genkai-py
# Linux:    cp target/debug/lib_genkai.so   python/genkai/_genkai.so
# macOS:    cp target/debug/lib_genkai.dylib python/genkai/_genkai.so
# Windows:  copy target\debug\_genkai.dll    python\genkai\_genkai.pyd

License

Genkai is licensed under the Apache License 2.0. You are free to use, modify, and distribute it, including for commercial purposes, provided you retain the copyright and NOTICE attribution as required by the License.

Citation

If you use Genkai in academic, professional, or commercial work, please cite it. GitHub renders a "Cite this repository" button from CITATION.cff; attribution in any derived product, publication, or report is requested.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

genkai-0.1.0.tar.gz (429.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

genkai-0.1.0-cp39-abi3-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.9+Windows x86-64

File details

Details for the file genkai-0.1.0.tar.gz.

File metadata

  • Download URL: genkai-0.1.0.tar.gz
  • Upload date:
  • Size: 429.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for genkai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a641451de54082561b459aba390ad2552ad67874118602bbfa64f889cee9d5bc
MD5 5bb91e01baf9be691465dcc4189acbd6
BLAKE2b-256 514f86f1832843ec3835ecf665684186f4a0bd943ef1c4ac7d3b786a106e0231

See more details on using hashes here.

File details

Details for the file genkai-0.1.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: genkai-0.1.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for genkai-0.1.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6c5a11cb52bfe4903ab9adca5995c1a93a2d6e74aa171489835592026098bc43
MD5 31bf63a5f889f4af4a26e1e25454298f
BLAKE2b-256 ad4868051e16bae67cc9394bc8d5eaee73432fa787324bbf4a02b2fe7cdc70dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page