navaltoolbox 0.1.0__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. navaltoolbox-0.2.0/PKG-INFO +309 -0
  2. navaltoolbox-0.2.0/README.md +282 -0
  3. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/pyproject.toml +5 -0
  4. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/Cargo.lock +2 -1
  5. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/Cargo.toml +3 -1
  6. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/README.md +27 -4
  7. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/src/hull.rs +40 -0
  8. navaltoolbox-0.2.0/rust/src/hydrostatics/calculator.rs +786 -0
  9. navaltoolbox-0.2.0/rust/src/hydrostatics/dataclasses.rs +154 -0
  10. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/src/hydrostatics/mod.rs +2 -0
  11. navaltoolbox-0.2.0/rust/src/hydrostatics/waterplane.rs +493 -0
  12. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/src/lib.rs +11 -1
  13. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/src/mesh/loader.rs +36 -5
  14. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/src/python.rs +390 -17
  15. navaltoolbox-0.2.0/rust/src/stability/calculator.rs +526 -0
  16. navaltoolbox-0.2.0/rust/src/stability/complete.rs +113 -0
  17. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/src/stability/mod.rs +3 -1
  18. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/src/tanks/tank.rs +91 -44
  19. navaltoolbox-0.2.0/rust/tests/dtmb_validation.rs +90 -0
  20. navaltoolbox-0.2.0/rust/tests/extended_hydrostatics.rs +129 -0
  21. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/tests/integration_tests.rs +127 -10
  22. navaltoolbox-0.1.0/PKG-INFO +0 -20
  23. navaltoolbox-0.1.0/rust/src/hydrostatics/calculator.rs +0 -221
  24. navaltoolbox-0.1.0/rust/src/hydrostatics/dataclasses.rs +0 -78
  25. navaltoolbox-0.1.0/rust/src/stability/calculator.rs +0 -293
  26. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/navaltoolbox/__init__.py +0 -0
  27. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/navaltoolbox/navaltoolbox.pyi +0 -0
  28. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/navaltoolbox/py.typed +0 -0
  29. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/src/downflooding.rs +0 -0
  30. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/src/mesh/clipper.rs +0 -0
  31. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/src/mesh/mod.rs +0 -0
  32. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/src/mesh/transform.rs +0 -0
  33. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/src/silhouette/core.rs +0 -0
  34. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/src/silhouette/loader.rs +0 -0
  35. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/src/silhouette/mod.rs +0 -0
  36. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/src/stability/dataclasses.rs +0 -0
  37. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/src/tanks/dataclasses.rs +0 -0
  38. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/src/tanks/mod.rs +0 -0
  39. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/src/vessel.rs +0 -0
  40. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/tests/data/box_10x10.stl +0 -0
  41. {navaltoolbox-0.1.0 → navaltoolbox-0.2.0}/rust/tests/data/dtmb5415.stl +0 -0
@@ -0,0 +1,309 @@
1
+ Metadata-Version: 2.4
2
+ Name: navaltoolbox
3
+ Version: 0.2.0
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Intended Audience :: Science/Research
6
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.9
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Programming Language :: Rust
14
+ Classifier: Topic :: Scientific/Engineering
15
+ Summary: High-performance naval architecture library for hydrostatics, stability, and tank calculations
16
+ Keywords: naval-architecture,hydrostatics,stability,marine-engineering,ship-design
17
+ Home-Page: https://github.com/NavalToolbox/navaltoolbox-lib
18
+ Author: Antoine ANCEAU
19
+ License: AGPL-3.0-or-later
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
22
+ Project-URL: Documentation, https://navaltoolbox.github.io/navaltoolbox-lib
23
+ Project-URL: Homepage, https://www.navaltoolbox.com
24
+ Project-URL: Issues, https://github.com/NavalToolbox/navaltoolbox-lib/issues
25
+ Project-URL: Repository, https://github.com/NavalToolbox/navaltoolbox-lib
26
+
27
+ # NavalToolbox
28
+
29
+ High-performance naval architecture library for Python, powered by Rust.
30
+
31
+ [![PyPI version](https://badge.fury.io/py/navaltoolbox.svg)](https://pypi.org/project/navaltoolbox/)
32
+ [![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
33
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
34
+
35
+ ## Overview
36
+
37
+ NavalToolbox provides fast and accurate naval architecture calculations through a Python API, with a high-performance Rust backend that handles the heavy computational work.
38
+
39
+ ## Features
40
+
41
+ - ⚓ **Hull Geometry**: Load and manipulate ship hulls from STL/VTK files
42
+ - 🚢 **Multi-hull Support**: Catamarans, trimarans, and arbitrary configurations
43
+ - 📊 **Hydrostatics**: Volume, COB, Waterplane ($A_{wp}$, LCF, $BM_t$, $BM_l$), Free Surface Correction ($GM_{dry}/GM_{wet}$)
44
+ - ⚖️ **Stability Analysis**: GZ curve calculation with automatic trim optimization
45
+ - 🌊 **Downflooding Detection**: Automatic detection of submerged openings
46
+ - 🛢️ **Tank Management**: Fill levels, free surface effects, sounding tables
47
+ - 💨 **Wind Heeling**: Silhouette-based wind calculations (DXF/VTK support)
48
+ - ⚡ **High Performance**: Rust backend with Python convenience
49
+
50
+ ## Installation
51
+
52
+ ```bash
53
+ pip install navaltoolbox
54
+ ```
55
+
56
+ **Requirements:**
57
+ - Python 3.9 or higher
58
+ - No additional dependencies required (all native code included in wheels)
59
+
60
+ ## Quick Start
61
+
62
+ ### Loading a Hull
63
+
64
+ ```python
65
+ from navaltoolbox import Hull
66
+
67
+ # Load hull from STL file
68
+ hull = Hull("ship.stl")
69
+
70
+ # Get hull dimensions
71
+ bounds = hull.get_bounds()
72
+ loa = bounds[1] - bounds[0] # Length overall
73
+ boa = bounds[3] - bounds[2] # Beam overall
74
+
75
+ print(f"LOA: {loa:.2f}m, BOA: {boa:.2f}m")
76
+ print(f"Triangles: {hull.num_triangles()}")
77
+ ```
78
+
79
+ ### Hydrostatics Calculation
80
+
81
+ ```python
82
+ from navaltoolbox import Hull, Vessel, HydrostaticsCalculator
83
+
84
+ # Create vessel
85
+ hull = Hull("ship.stl")
86
+ vessel = Vessel(hull)
87
+
88
+ # Calculate hydrostatics at a given draft
89
+ calc = HydrostaticsCalculator(vessel, water_density=1025.0)
90
+
91
+ # Option 1: At draft with VCG (computes stability)
92
+ state = calc.calculate_at_draft(draft=5.0, vcg=7.0)
93
+
94
+ print(f"Volume: {state.volume:.1f} m³")
95
+ print(f"Displacement: {state.displacement:.0f} kg")
96
+ print(f"COB: ({state.cob[0]:.2f}, {state.cob[1]:.2f}, {state.cob[2]:.2f})")
97
+ print(f"Waterplane Area: {state.waterplane_area:.1f} m²")
98
+ print(f"LCF: {state.lcf:.2f} m")
99
+ print(f"GMT (wet): {state.gmt:.3f} m")
100
+ print(f"GMT (dry): {state.gmt_dry:.3f} m")
101
+
102
+ # Option 2: Find draft for displacement
103
+ state_disp = calc.calculate_at_displacement(512500.0)
104
+ print(f"Draft for {state_disp.displacement:.0f}kg: {state_disp.draft:.3f} m")
105
+ ```
106
+
107
+ ### Stability Analysis (GZ Curve)
108
+
109
+ ```python
110
+ from navaltoolbox import Hull, Vessel, StabilityCalculator
111
+
112
+ # Create vessel and calculator
113
+ hull = Hull("ship.stl")
114
+ vessel = Vessel(hull)
115
+ calc = StabilityCalculator(vessel, water_density=1025.0)
116
+
117
+ # Calculate GZ curve
118
+ displacement_mass = 8635000.0 # kg
119
+ cog = (71.67, 0.0, 7.555) # LCG, TCG, VCG in meters
120
+ heels = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90]
121
+
122
+ curve = calc.calculate_gz_curve(displacement_mass, cog, heels)
123
+
124
+ # Display results
125
+ print("Heel (°) | GZ (m)")
126
+ print("-" * 25)
127
+ for heel, gz in zip(curve.heels(), curve.values()):
128
+ print(f"{heel:7.1f} | {gz:7.3f}")
129
+
130
+ # Get max GZ
131
+ gz_values = curve.values()
132
+ max_gz = max(gz_values)
133
+ max_idx = gz_values.index(max_gz)
134
+ max_heel = heels[max_idx]
135
+ print(f"\nMax GZ: {max_gz:.3f}m at {max_heel}°")
136
+ ```
137
+
138
+ ### Tank Management
139
+
140
+ ```python
141
+ from navaltoolbox import Tank, Vessel, Hull
142
+
143
+ # Create a vessel
144
+ hull = Hull("ship.stl")
145
+ vessel = Vessel(hull)
146
+
147
+ # Add a box-shaped tank
148
+ tank = Tank.from_box(
149
+ name="Fuel Tank 1",
150
+ x_min=40.0, x_max=50.0,
151
+ y_min=-5.0, y_max=5.0,
152
+ z_min=0.0, z_max=3.0,
153
+ fluid_density=850.0 # diesel fuel
154
+ )
155
+
156
+ vessel.add_tank(tank)
157
+
158
+ # Set fill level
159
+ tank.fill_percent = 75.0
160
+
161
+ # Get tank properties
162
+ print(f"Tank: {tank.name}")
163
+ print(f"Total volume: {tank.total_volume:.1f} m³")
164
+ print(f"Fill volume: {tank.fill_volume:.1f} m³")
165
+ print(f"Fluid mass: {tank.fluid_mass:.0f} kg")
166
+ print(f"Center of gravity: {tank.center_of_gravity}")
167
+ print(f"Free surface moment (transverse): {tank.free_surface_moment_t:.2f} m⁴")
168
+ ```
169
+
170
+ ### Multi-hull Vessels
171
+
172
+ ```python
173
+ from navaltoolbox import Hull, Vessel
174
+
175
+ # Load individual hulls
176
+ port_hull = Hull("port_hull.stl")
177
+ starboard_hull = Hull("starboard_hull.stl")
178
+
179
+ # Create catamaran
180
+ catamaran = Vessel(port_hull)
181
+ catamaran.add_hull(starboard_hull, offset=(0.0, 8.0, 0.0)) # 8m beam between hulls
182
+
183
+ # Calculate hydrostatics
184
+ calc = HydrostaticsCalculator(catamaran, water_density=1025.0)
185
+ state = calc.calculate_at_draft(1.5)
186
+
187
+ print(f"Catamaran displacement: {state.displacement:.0f} kg")
188
+ print(f"Waterplane area: {state.waterplane_area:.1f} m²")
189
+ ```
190
+
191
+ ### Downflooding Detection
192
+
193
+ ```python
194
+ from navaltoolbox import Hull, Vessel, DownfloodingOpening, StabilityCalculator
195
+
196
+ # Create vessel
197
+ hull = Hull("ship.stl")
198
+ vessel = Vessel(hull)
199
+
200
+ # Add downflooding opening (e.g., air pipe, ventilator)
201
+ opening = DownfloodingOpening.from_point(
202
+ name="Vent pipe",
203
+ x=75.0, y=9.8, z=12.5,
204
+ opening_type="vent"
205
+ )
206
+ vessel.add_downflooding_opening(opening)
207
+
208
+ # Calculate GZ curve with downflooding detection
209
+ calc = StabilityCalculator(vessel, water_density=1025.0)
210
+ heels = list(range(0, 95, 5))
211
+ curve = calc.calculate_gz_curve(8635000.0, (71.67, 0.0, 7.555), heels)
212
+
213
+ # Check for downflooding
214
+ for point in curve.points():
215
+ if point.is_flooding:
216
+ print(f"⚠️ Downflooding at {point.heel}° - {', '.join(point.flooded_openings)}")
217
+ ```
218
+
219
+ ## Documentation
220
+
221
+ For more detailed documentation, examples, and API reference, visit:
222
+ - **GitHub Repository**: [NavalToolbox/navaltoolbox-lib](https://github.com/NavalToolbox/navaltoolbox-lib)
223
+ - **Issue Tracker**: [GitHub Issues](https://github.com/NavalToolbox/navaltoolbox-lib/issues)
224
+
225
+ ## Performance
226
+
227
+ NavalToolbox is built with performance in mind:
228
+
229
+ - Written in **Rust** for maximum speed and memory safety
230
+ - Efficient mesh operations using `parry3d`
231
+ - Parallel processing where applicable
232
+ - Zero-copy data transfer between Python and Rust
233
+
234
+ Example benchmark (DTMB 5415 hull, 3436 triangles):
235
+ - Load STL: ~10ms
236
+ - Hydrostatics calculation: ~50ms
237
+ - GZ curve (13 points): ~650ms
238
+
239
+ ## Use Cases
240
+
241
+ NavalToolbox is suitable for:
242
+
243
+ - 🎓 **Naval architecture education**: Teaching hydrostatics and stability
244
+ - 🔬 **Research**: Rapid prototyping of new methods and algorithms
245
+ - 🏭 **Engineering**: Production stability calculations and analysis
246
+ - 🤖 **Optimization**: Integration with optimization frameworks
247
+ - 📊 **Batch processing**: Analyzing multiple design variants
248
+
249
+ ## Requirements and Compatibility
250
+
251
+ - **Python**: 3.9, 3.10, 3.11, 3.12, 3.13
252
+ - **Operating Systems**:
253
+ - macOS (Intel and Apple Silicon)
254
+ - Linux (x86_64, aarch64)
255
+ - Windows (x86_64)
256
+ - **File Formats**:
257
+ - Hull geometry: STL (binary and ASCII), VTK
258
+ - Silhouettes: DXF, VTK
259
+
260
+ ## Contributing
261
+
262
+ Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests on GitHub.
263
+
264
+ ## License
265
+
266
+ This project is licensed under the **GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later)**.
267
+
268
+ This means:
269
+ - ✅ Free to use, modify, and distribute
270
+ - ✅ Can be used in commercial projects
271
+ - ⚠️ Source code must be made available under AGPL
272
+ - ⚠️ Network use is considered distribution (AGPL provision)
273
+
274
+ See the [LICENSE](https://github.com/NavalToolbox/navaltoolbox-lib/blob/main/LICENSE) file for details.
275
+
276
+ ## Disclaimer
277
+
278
+ NavalToolbox has been developed with care to ensure that all models and methods are correct, and that calculations reflect the most accurate results achievable with the implemented algorithms. However, **results must not be considered as a guarantee of performance**. The author cannot be held responsible for any inaccuracies in the calculations or for any consequences arising from the use of this software. Users are advised to independently verify critical calculations and to use this software as a tool to support, not replace, professional engineering judgment.
279
+
280
+ ## Citation
281
+
282
+ If you use NavalToolbox in your research, please cite:
283
+
284
+ ```bibtex
285
+ @software{navaltoolbox2026,
286
+ author = {Anceau, Antoine},
287
+ title = {NavalToolbox: High-performance naval architecture library},
288
+ year = {2026},
289
+ url = {https://github.com/NavalToolbox/navaltoolbox-lib}
290
+ }
291
+ ```
292
+
293
+ ## Author
294
+
295
+ **Antoine ANCEAU**
296
+ - GitHub: [@antoineanceau](https://github.com/antoineanceau)
297
+ - Website: [antoine.anceau.fr](https://antoine.anceau.fr)
298
+
299
+ ## Support
300
+
301
+ - 📖 **Documentation**: [GitHub Pages](https://navaltoolbox.github.io/navaltoolbox-lib)
302
+ - 🐛 **Bug Reports**: [Open an issue](https://github.com/NavalToolbox/navaltoolbox-lib/issues)
303
+ - 💬 **Discussions**: [GitHub Discussions](https://github.com/NavalToolbox/navaltoolbox-lib/discussions)
304
+ - 📧 **Email**: For private inquiries
305
+
306
+ ---
307
+
308
+ **Note**: This package uses a Rust backend for high performance. Pre-built wheels are provided for common platforms. If a wheel is not available for your platform, the package will attempt to build from source (requires Rust toolchain).
309
+
@@ -0,0 +1,282 @@
1
+ # NavalToolbox
2
+
3
+ High-performance naval architecture library for Python, powered by Rust.
4
+
5
+ [![PyPI version](https://badge.fury.io/py/navaltoolbox.svg)](https://pypi.org/project/navaltoolbox/)
6
+ [![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
7
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
8
+
9
+ ## Overview
10
+
11
+ NavalToolbox provides fast and accurate naval architecture calculations through a Python API, with a high-performance Rust backend that handles the heavy computational work.
12
+
13
+ ## Features
14
+
15
+ - ⚓ **Hull Geometry**: Load and manipulate ship hulls from STL/VTK files
16
+ - 🚢 **Multi-hull Support**: Catamarans, trimarans, and arbitrary configurations
17
+ - 📊 **Hydrostatics**: Volume, COB, Waterplane ($A_{wp}$, LCF, $BM_t$, $BM_l$), Free Surface Correction ($GM_{dry}/GM_{wet}$)
18
+ - ⚖️ **Stability Analysis**: GZ curve calculation with automatic trim optimization
19
+ - 🌊 **Downflooding Detection**: Automatic detection of submerged openings
20
+ - 🛢️ **Tank Management**: Fill levels, free surface effects, sounding tables
21
+ - 💨 **Wind Heeling**: Silhouette-based wind calculations (DXF/VTK support)
22
+ - ⚡ **High Performance**: Rust backend with Python convenience
23
+
24
+ ## Installation
25
+
26
+ ```bash
27
+ pip install navaltoolbox
28
+ ```
29
+
30
+ **Requirements:**
31
+ - Python 3.9 or higher
32
+ - No additional dependencies required (all native code included in wheels)
33
+
34
+ ## Quick Start
35
+
36
+ ### Loading a Hull
37
+
38
+ ```python
39
+ from navaltoolbox import Hull
40
+
41
+ # Load hull from STL file
42
+ hull = Hull("ship.stl")
43
+
44
+ # Get hull dimensions
45
+ bounds = hull.get_bounds()
46
+ loa = bounds[1] - bounds[0] # Length overall
47
+ boa = bounds[3] - bounds[2] # Beam overall
48
+
49
+ print(f"LOA: {loa:.2f}m, BOA: {boa:.2f}m")
50
+ print(f"Triangles: {hull.num_triangles()}")
51
+ ```
52
+
53
+ ### Hydrostatics Calculation
54
+
55
+ ```python
56
+ from navaltoolbox import Hull, Vessel, HydrostaticsCalculator
57
+
58
+ # Create vessel
59
+ hull = Hull("ship.stl")
60
+ vessel = Vessel(hull)
61
+
62
+ # Calculate hydrostatics at a given draft
63
+ calc = HydrostaticsCalculator(vessel, water_density=1025.0)
64
+
65
+ # Option 1: At draft with VCG (computes stability)
66
+ state = calc.calculate_at_draft(draft=5.0, vcg=7.0)
67
+
68
+ print(f"Volume: {state.volume:.1f} m³")
69
+ print(f"Displacement: {state.displacement:.0f} kg")
70
+ print(f"COB: ({state.cob[0]:.2f}, {state.cob[1]:.2f}, {state.cob[2]:.2f})")
71
+ print(f"Waterplane Area: {state.waterplane_area:.1f} m²")
72
+ print(f"LCF: {state.lcf:.2f} m")
73
+ print(f"GMT (wet): {state.gmt:.3f} m")
74
+ print(f"GMT (dry): {state.gmt_dry:.3f} m")
75
+
76
+ # Option 2: Find draft for displacement
77
+ state_disp = calc.calculate_at_displacement(512500.0)
78
+ print(f"Draft for {state_disp.displacement:.0f}kg: {state_disp.draft:.3f} m")
79
+ ```
80
+
81
+ ### Stability Analysis (GZ Curve)
82
+
83
+ ```python
84
+ from navaltoolbox import Hull, Vessel, StabilityCalculator
85
+
86
+ # Create vessel and calculator
87
+ hull = Hull("ship.stl")
88
+ vessel = Vessel(hull)
89
+ calc = StabilityCalculator(vessel, water_density=1025.0)
90
+
91
+ # Calculate GZ curve
92
+ displacement_mass = 8635000.0 # kg
93
+ cog = (71.67, 0.0, 7.555) # LCG, TCG, VCG in meters
94
+ heels = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90]
95
+
96
+ curve = calc.calculate_gz_curve(displacement_mass, cog, heels)
97
+
98
+ # Display results
99
+ print("Heel (°) | GZ (m)")
100
+ print("-" * 25)
101
+ for heel, gz in zip(curve.heels(), curve.values()):
102
+ print(f"{heel:7.1f} | {gz:7.3f}")
103
+
104
+ # Get max GZ
105
+ gz_values = curve.values()
106
+ max_gz = max(gz_values)
107
+ max_idx = gz_values.index(max_gz)
108
+ max_heel = heels[max_idx]
109
+ print(f"\nMax GZ: {max_gz:.3f}m at {max_heel}°")
110
+ ```
111
+
112
+ ### Tank Management
113
+
114
+ ```python
115
+ from navaltoolbox import Tank, Vessel, Hull
116
+
117
+ # Create a vessel
118
+ hull = Hull("ship.stl")
119
+ vessel = Vessel(hull)
120
+
121
+ # Add a box-shaped tank
122
+ tank = Tank.from_box(
123
+ name="Fuel Tank 1",
124
+ x_min=40.0, x_max=50.0,
125
+ y_min=-5.0, y_max=5.0,
126
+ z_min=0.0, z_max=3.0,
127
+ fluid_density=850.0 # diesel fuel
128
+ )
129
+
130
+ vessel.add_tank(tank)
131
+
132
+ # Set fill level
133
+ tank.fill_percent = 75.0
134
+
135
+ # Get tank properties
136
+ print(f"Tank: {tank.name}")
137
+ print(f"Total volume: {tank.total_volume:.1f} m³")
138
+ print(f"Fill volume: {tank.fill_volume:.1f} m³")
139
+ print(f"Fluid mass: {tank.fluid_mass:.0f} kg")
140
+ print(f"Center of gravity: {tank.center_of_gravity}")
141
+ print(f"Free surface moment (transverse): {tank.free_surface_moment_t:.2f} m⁴")
142
+ ```
143
+
144
+ ### Multi-hull Vessels
145
+
146
+ ```python
147
+ from navaltoolbox import Hull, Vessel
148
+
149
+ # Load individual hulls
150
+ port_hull = Hull("port_hull.stl")
151
+ starboard_hull = Hull("starboard_hull.stl")
152
+
153
+ # Create catamaran
154
+ catamaran = Vessel(port_hull)
155
+ catamaran.add_hull(starboard_hull, offset=(0.0, 8.0, 0.0)) # 8m beam between hulls
156
+
157
+ # Calculate hydrostatics
158
+ calc = HydrostaticsCalculator(catamaran, water_density=1025.0)
159
+ state = calc.calculate_at_draft(1.5)
160
+
161
+ print(f"Catamaran displacement: {state.displacement:.0f} kg")
162
+ print(f"Waterplane area: {state.waterplane_area:.1f} m²")
163
+ ```
164
+
165
+ ### Downflooding Detection
166
+
167
+ ```python
168
+ from navaltoolbox import Hull, Vessel, DownfloodingOpening, StabilityCalculator
169
+
170
+ # Create vessel
171
+ hull = Hull("ship.stl")
172
+ vessel = Vessel(hull)
173
+
174
+ # Add downflooding opening (e.g., air pipe, ventilator)
175
+ opening = DownfloodingOpening.from_point(
176
+ name="Vent pipe",
177
+ x=75.0, y=9.8, z=12.5,
178
+ opening_type="vent"
179
+ )
180
+ vessel.add_downflooding_opening(opening)
181
+
182
+ # Calculate GZ curve with downflooding detection
183
+ calc = StabilityCalculator(vessel, water_density=1025.0)
184
+ heels = list(range(0, 95, 5))
185
+ curve = calc.calculate_gz_curve(8635000.0, (71.67, 0.0, 7.555), heels)
186
+
187
+ # Check for downflooding
188
+ for point in curve.points():
189
+ if point.is_flooding:
190
+ print(f"⚠️ Downflooding at {point.heel}° - {', '.join(point.flooded_openings)}")
191
+ ```
192
+
193
+ ## Documentation
194
+
195
+ For more detailed documentation, examples, and API reference, visit:
196
+ - **GitHub Repository**: [NavalToolbox/navaltoolbox-lib](https://github.com/NavalToolbox/navaltoolbox-lib)
197
+ - **Issue Tracker**: [GitHub Issues](https://github.com/NavalToolbox/navaltoolbox-lib/issues)
198
+
199
+ ## Performance
200
+
201
+ NavalToolbox is built with performance in mind:
202
+
203
+ - Written in **Rust** for maximum speed and memory safety
204
+ - Efficient mesh operations using `parry3d`
205
+ - Parallel processing where applicable
206
+ - Zero-copy data transfer between Python and Rust
207
+
208
+ Example benchmark (DTMB 5415 hull, 3436 triangles):
209
+ - Load STL: ~10ms
210
+ - Hydrostatics calculation: ~50ms
211
+ - GZ curve (13 points): ~650ms
212
+
213
+ ## Use Cases
214
+
215
+ NavalToolbox is suitable for:
216
+
217
+ - 🎓 **Naval architecture education**: Teaching hydrostatics and stability
218
+ - 🔬 **Research**: Rapid prototyping of new methods and algorithms
219
+ - 🏭 **Engineering**: Production stability calculations and analysis
220
+ - 🤖 **Optimization**: Integration with optimization frameworks
221
+ - 📊 **Batch processing**: Analyzing multiple design variants
222
+
223
+ ## Requirements and Compatibility
224
+
225
+ - **Python**: 3.9, 3.10, 3.11, 3.12, 3.13
226
+ - **Operating Systems**:
227
+ - macOS (Intel and Apple Silicon)
228
+ - Linux (x86_64, aarch64)
229
+ - Windows (x86_64)
230
+ - **File Formats**:
231
+ - Hull geometry: STL (binary and ASCII), VTK
232
+ - Silhouettes: DXF, VTK
233
+
234
+ ## Contributing
235
+
236
+ Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests on GitHub.
237
+
238
+ ## License
239
+
240
+ This project is licensed under the **GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later)**.
241
+
242
+ This means:
243
+ - ✅ Free to use, modify, and distribute
244
+ - ✅ Can be used in commercial projects
245
+ - ⚠️ Source code must be made available under AGPL
246
+ - ⚠️ Network use is considered distribution (AGPL provision)
247
+
248
+ See the [LICENSE](https://github.com/NavalToolbox/navaltoolbox-lib/blob/main/LICENSE) file for details.
249
+
250
+ ## Disclaimer
251
+
252
+ NavalToolbox has been developed with care to ensure that all models and methods are correct, and that calculations reflect the most accurate results achievable with the implemented algorithms. However, **results must not be considered as a guarantee of performance**. The author cannot be held responsible for any inaccuracies in the calculations or for any consequences arising from the use of this software. Users are advised to independently verify critical calculations and to use this software as a tool to support, not replace, professional engineering judgment.
253
+
254
+ ## Citation
255
+
256
+ If you use NavalToolbox in your research, please cite:
257
+
258
+ ```bibtex
259
+ @software{navaltoolbox2026,
260
+ author = {Anceau, Antoine},
261
+ title = {NavalToolbox: High-performance naval architecture library},
262
+ year = {2026},
263
+ url = {https://github.com/NavalToolbox/navaltoolbox-lib}
264
+ }
265
+ ```
266
+
267
+ ## Author
268
+
269
+ **Antoine ANCEAU**
270
+ - GitHub: [@antoineanceau](https://github.com/antoineanceau)
271
+ - Website: [antoine.anceau.fr](https://antoine.anceau.fr)
272
+
273
+ ## Support
274
+
275
+ - 📖 **Documentation**: [GitHub Pages](https://navaltoolbox.github.io/navaltoolbox-lib)
276
+ - 🐛 **Bug Reports**: [Open an issue](https://github.com/NavalToolbox/navaltoolbox-lib/issues)
277
+ - 💬 **Discussions**: [GitHub Discussions](https://github.com/NavalToolbox/navaltoolbox-lib/discussions)
278
+ - 📧 **Email**: For private inquiries
279
+
280
+ ---
281
+
282
+ **Note**: This package uses a Rust backend for high performance. Pre-built wheels are provided for common platforms. If a wheel is not available for your platform, the package will attempt to build from source (requires Rust toolchain).
@@ -5,11 +5,13 @@ build-backend = "maturin"
5
5
  [project]
6
6
  name = "navaltoolbox"
7
7
  description = "High-performance naval architecture library for hydrostatics, stability, and tank calculations"
8
+ readme = "README.md"
8
9
  license = {text = "AGPL-3.0-or-later"}
9
10
  requires-python = ">=3.9"
10
11
  authors = [
11
12
  {name = "Antoine ANCEAU"}
12
13
  ]
14
+ keywords = ["naval-architecture", "hydrostatics", "stability", "marine-engineering", "ship-design"]
13
15
  classifiers = [
14
16
  "Development Status :: 3 - Alpha",
15
17
  "Intended Audience :: Science/Research",
@@ -26,7 +28,10 @@ classifiers = [
26
28
  dynamic = ["version"]
27
29
 
28
30
  [project.urls]
31
+ Homepage = "https://www.navaltoolbox.com"
29
32
  Repository = "https://github.com/NavalToolbox/navaltoolbox-lib"
33
+ Documentation = "https://navaltoolbox.github.io/navaltoolbox-lib"
34
+ Issues = "https://github.com/NavalToolbox/navaltoolbox-lib/issues"
30
35
 
31
36
  [tool.maturin]
32
37
  features = ["python"]
@@ -554,7 +554,7 @@ dependencies = [
554
554
 
555
555
  [[package]]
556
556
  name = "navaltoolbox"
557
- version = "0.1.0"
557
+ version = "0.2.0"
558
558
  dependencies = [
559
559
  "approx",
560
560
  "dxf",
@@ -564,6 +564,7 @@ dependencies = [
564
564
  "ordered-float",
565
565
  "parry3d-f64",
566
566
  "pyo3",
567
+ "rayon",
567
568
  "stl_io",
568
569
  "thiserror 2.0.18",
569
570
  "vtkio",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "navaltoolbox"
3
- version = "0.1.0"
3
+ version = "0.2.0"
4
4
  edition = "2021"
5
5
  description = "High-performance naval architecture library for hydrostatics, stability, and tank calculations"
6
6
  authors = ["Antoine ANCEAU"]
@@ -37,6 +37,8 @@ dxf = "0.5"
37
37
  vtkio = "0.6"
38
38
  # Logging
39
39
  log = "0.4"
40
+ # Parallel processing
41
+ rayon = "1.10"
40
42
 
41
43
  # Python bindings (optional)
42
44
  [dependencies.pyo3]