Stretch a vessel to its beam only beside a reported length

A vessel drawn at its type's typical length keeps the model's proportions:
a reported beam alone would squeeze a 300 m container ship to that width.
This commit is contained in:
Sameh Khamis committed 2026-11-13 07:42:27 -08:00
1 parent 432a29ba59
commit 92d34bc4cc
2 files changed
+13 -3

No files matched your search

+7 -3
View File
@@ -343,18 +343,22 @@ export function aircraftModelSpec(set, { typeCode, type, category } = {}) {
* @returns {object} {@link fleetModelSpec}
*/
export function vesselModelSpec(set, { type, length, beam, name } = {}) {
// A beam counts only beside a reported length: a vessel drawn at its type's
// typical length keeps the model's proportions.
const reported = hullLength(length ?? undefined);
const hullWidth = reported === undefined ? undefined : (beam ?? undefined);
const resolved = resolveVessel(
set.types,
aisShipTypeCode(type),
length ?? undefined,
beam ?? undefined,
reported,
hullWidth,
name ?? undefined,
);
return specOf(
set,
resolved,
(r) => ({ model: set.types.default_vessel, length: r.length }),
{ beam: beam ?? undefined },
{ beam: hullWidth },
);
}