NavalToolbox
High-performance naval architecture library written in Rust with Python bindings.
Architecture
NavalToolbox is built as a Rust library (navaltoolbox) with optional Python bindings via PyO3/Maturin. This architecture provides:
- ⚡ High performance: Rust's zero-cost abstractions and memory safety
- 🐍 Python convenience: Easy-to-use Python API for rapid prototyping
- 🔒 Type safety: Compile-time guarantees in Rust
- 🚀 Production ready: Deploy as Rust library or Python package
Features
- Hull geometry: Load STL/VTK files, transform, scale, export
- Multi-hull support: Catamarans, trimarans, arbitrary configurations
- Hydrostatics: Volume, center of buoyancy, waterplane properties
- Stability: GZ curve calculation with trim optimization and downflooding detection
- Tanks: Fill level management, free surface effects
- Silhouettes: Wind heeling calculations (DXF/VTK support)
Installation
Python Package
Rust Library
Add to your Cargo.toml:
[]
= "0.1"
Quick Start
Python
# Load a hull
=
# Create a vessel
=
# Calculate hydrostatics
=
=
# Calculate GZ curve
=
=
=
Rust
use ;
// Load a hull
let hull = from_stl?;
println!;
// Create a vessel
let vessel = new;
// Calculate hydrostatics
let calc = new;
let state = calc.calculate_at_draft?;
println!;
// Calculate GZ curve
let stab = new;
let heels = vec!;
let curve = stab.calculate_gz_curve;
for point in &curve.points
Development
Building from Source
# Build Rust library
# Build Python package
License
AGPL-3.0-or-later