feat: AR-Shipdesign initial commit

This commit is contained in:
2026-07-03 12:23:25 -04:00
parent 588735ea64
commit 9a08526361
16 changed files with 4431 additions and 394 deletions
+19 -4
View File
@@ -23,6 +23,19 @@ from arshipdesign.core.hull import Hull
from arshipdesign.core.offsets import OffsetsTable
def _standard_sheer_z(
x_sta: np.ndarray, lpp: float, depth: float,
fwd_rise_frac: float = 0.03, aft_rise_frac: float = 0.015,
) -> np.ndarray:
"""Línea de cubierta parabólica: mínimo en cuaderna maestra, sube hacia proa/popa."""
xi = x_sta / lpp # 0=AP, 1=FP, 0.5=midship
return np.where(
xi >= 0.5,
depth * (1.0 + fwd_rise_frac * ((xi - 0.5) / 0.5) ** 2),
depth * (1.0 + aft_rise_frac * ((0.5 - xi) / 0.5) ** 2),
)
# ---------------------------------------------------------------------------
# API pública
# ---------------------------------------------------------------------------
@@ -56,9 +69,10 @@ def make_planing_hull(
flare : float
Fracción de ensanchamiento por encima del chine (0 = sin ensanche).
"""
x_sta = np.linspace(0.0, lpp, n_stations)
z_wl = np.linspace(0.0, draft, n_waterlines)
xi = (x_sta / lpp - 0.5) * 2.0 # normalizado ∈ [1, 1], 0=midship
x_sta = np.linspace(0.0, lpp, n_stations)
sheer_z = _standard_sheer_z(x_sta, lpp, depth, fwd_rise_frac=0.03, aft_rise_frac=0.015)
z_wl = np.linspace(0.0, float(sheer_z.max()), n_waterlines)
xi = (x_sta / lpp - 0.5) * 2.0 # normalizado ∈ [1, 1], 0=midship
# ── Plan form: ancho en línea de agua por estación ─────────────────
# El planeador tiene popa muy ancha y proa más estrecha
@@ -105,7 +119,8 @@ def make_planing_hull(
lpp=lpp, beam=beam, draft=draft,
)
return Hull(
name=name, lpp=lpp, beam=beam, depth=depth, draft=draft, offsets=offsets
name=name, lpp=lpp, beam=beam, depth=depth, draft=draft,
offsets=offsets, sheer_z=sheer_z,
)