From 05ee38c667fb74fa0f3b102a5d3b9b953fd4dd69 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Tue, 24 Mar 2020 13:52:47 -0400 Subject: [PATCH] Add some traincars --- media/attribution.js | 16 +++ .../train_28600-gallon-tank-car-front.svg | 32 +++++ .../train_28600-gallon-tank-car-side.svg | 87 +++++++++++++ .../train_3250-cubic-ft-hopper-front.svg | 19 +++ .../train_3250-cubic-ft-hopper-side.svg | 119 ++++++++++++++++++ .../trains/train_60'-boxcar-front.svg | 25 ++++ .../vehicles/trains/train_60'-boxcar-side.svg | 45 +++++++ .../trains/train_64'-flatcar-front.svg | 38 ++++++ .../trains/train_64'-flatcar-side.svg | 59 +++++++++ presets/vehicles.js | 88 +++++++++++++ 10 files changed, 528 insertions(+) create mode 100644 media/vehicles/trains/train_28600-gallon-tank-car-front.svg create mode 100644 media/vehicles/trains/train_28600-gallon-tank-car-side.svg create mode 100644 media/vehicles/trains/train_3250-cubic-ft-hopper-front.svg create mode 100644 media/vehicles/trains/train_3250-cubic-ft-hopper-side.svg create mode 100644 media/vehicles/trains/train_60'-boxcar-front.svg create mode 100644 media/vehicles/trains/train_60'-boxcar-side.svg create mode 100644 media/vehicles/trains/train_64'-flatcar-front.svg create mode 100644 media/vehicles/trains/train_64'-flatcar-side.svg diff --git a/media/attribution.js b/media/attribution.js index e636172b..4de2da6d 100644 --- a/media/attribution.js +++ b/media/attribution.js @@ -8169,6 +8169,22 @@ const attributionData = { "chemicalcrux" ] }, + { + prefix: "./media/vehicles/trains/", + files: [ + { name: "train_60'-boxcar-side.svg", source: "https://www.gbrx.com/manufacturing/north-america-rail/boxcars/60-plate-f-boxcar/" }, + { name: "train_60'-boxcar-front.svg", source: "https://www.gbrx.com/manufacturing/north-america-rail/boxcars/60-plate-f-boxcar/" }, + { name: "train_64'-flatcar-side.svg", source: "https://www.gbrx.com/manufacturing/north-america-rail/flatcars/64-heavy-duty-flatcar/" }, + { name: "train_64'-flatcar-front.svg", source: "https://www.gbrx.com/manufacturing/north-america-rail/flatcars/64-heavy-duty-flatcar/" }, + { name: "train_3250-cubic-ft-hopper-side.svg", source: "https://www.gbrx.com/manufacturing/north-america-rail/covered-hopper-railcars/3250-covered-hopper-railcar/" }, + { name: "train_3250-cubic-ft-hopper-front.svg", source: "https://www.gbrx.com/manufacturing/north-america-rail/covered-hopper-railcars/3250-covered-hopper-railcar/" }, + { name: "train_28600-gallon-tank-car-side.svg", source: "https://www.gbrx.com/manufacturing/north-america-rail/tank-cars/286k-crude-oil-tank-car/" }, + { name: "train_28600-gallon-tank-car-front.svg", source: "https://www.gbrx.com/manufacturing/north-america-rail/tank-cars/286k-crude-oil-tank-car/" }, + ], + authors: [ + "chemicalcrux" + ] + }, ], people: { "ahastar": { diff --git a/media/vehicles/trains/train_28600-gallon-tank-car-front.svg b/media/vehicles/trains/train_28600-gallon-tank-car-front.svg new file mode 100644 index 00000000..a698bcaf --- /dev/null +++ b/media/vehicles/trains/train_28600-gallon-tank-car-front.svg @@ -0,0 +1,32 @@ + + + + + + + + + diff --git a/media/vehicles/trains/train_28600-gallon-tank-car-side.svg b/media/vehicles/trains/train_28600-gallon-tank-car-side.svg new file mode 100644 index 00000000..be2f3592 --- /dev/null +++ b/media/vehicles/trains/train_28600-gallon-tank-car-side.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + diff --git a/media/vehicles/trains/train_3250-cubic-ft-hopper-front.svg b/media/vehicles/trains/train_3250-cubic-ft-hopper-front.svg new file mode 100644 index 00000000..af3491f0 --- /dev/null +++ b/media/vehicles/trains/train_3250-cubic-ft-hopper-front.svg @@ -0,0 +1,19 @@ + + + + + + diff --git a/media/vehicles/trains/train_3250-cubic-ft-hopper-side.svg b/media/vehicles/trains/train_3250-cubic-ft-hopper-side.svg new file mode 100644 index 00000000..42cc9d98 --- /dev/null +++ b/media/vehicles/trains/train_3250-cubic-ft-hopper-side.svg @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/vehicles/trains/train_60'-boxcar-front.svg b/media/vehicles/trains/train_60'-boxcar-front.svg new file mode 100644 index 00000000..4ff1ef6e --- /dev/null +++ b/media/vehicles/trains/train_60'-boxcar-front.svg @@ -0,0 +1,25 @@ + + + + + + diff --git a/media/vehicles/trains/train_60'-boxcar-side.svg b/media/vehicles/trains/train_60'-boxcar-side.svg new file mode 100644 index 00000000..56fb69ad --- /dev/null +++ b/media/vehicles/trains/train_60'-boxcar-side.svg @@ -0,0 +1,45 @@ + + + + + + + + + diff --git a/media/vehicles/trains/train_64'-flatcar-front.svg b/media/vehicles/trains/train_64'-flatcar-front.svg new file mode 100644 index 00000000..14a9add9 --- /dev/null +++ b/media/vehicles/trains/train_64'-flatcar-front.svg @@ -0,0 +1,38 @@ + + + + + + diff --git a/media/vehicles/trains/train_64'-flatcar-side.svg b/media/vehicles/trains/train_64'-flatcar-side.svg new file mode 100644 index 00000000..ed7f7db1 --- /dev/null +++ b/media/vehicles/trains/train_64'-flatcar-side.svg @@ -0,0 +1,59 @@ + + + + + + diff --git a/presets/vehicles.js b/presets/vehicles.js index 37c1c863..c99b1136 100644 --- a/presets/vehicles.js +++ b/presets/vehicles.js @@ -260,6 +260,54 @@ function makeBuses() { return entity; } +function makeVehicleGroup(info, name, prefix) { + sides = {} + + let defaultHeight; + + info.forEach(vehicle => { + Object.entries(vehicle.sides).forEach(([sideName, data]) => { + if (!defaultHeight) { + defaultHeight = data.height; + } + sides[vehicle.name + " (" + sideName + ")"] = { + name: vehicle.name + " (" + sideName + ")", + rename: true, + height: data.height, + mass: vehicle.mass, + image: { source: "./media/vehicles/" + name.replace(/ /g, "-").toLowerCase() + "/" + prefix + "_" + vehicle.name.replace(/ /g, "-").toLowerCase() + "-" + sideName.replace(/ /g, "-").toLowerCase() + ".svg", extra: (data.extra ? data.extra : 1) } + }; + }); + }); + + console.log(sides) + + const entity = makeMultiVehicle(name, sides); + + entity.sizes.push({ + name: "1:72", + height: math.unit(math.divide(defaultHeight,72)) + }); + entity.sizes.push({ + name: "1:24", + height: math.unit(math.divide(defaultHeight,24)) + }); + entity.sizes.push({ + name: "1:16", + height: math.unit(math.divide(defaultHeight,16)) + }); + entity.sizes.push({ + name: "1:8", + height: math.unit(math.divide(defaultHeight,8)) + }); + entity.sizes.push({ + name: "1:4", + height: math.unit(math.divide(defaultHeight,4)) + }); + + return entity; +} + function makeVehicles() { const results = []; @@ -367,6 +415,46 @@ function makeVehicles() { name: "Buses", constructor: () => makeBuses() }); + + results.push({ + name: "Trains", + constructor: () => makeVehicleGroup([ + { + name: "60' Boxcar", + mass: math.unit(80900, "lbs"), + sides: { + "Side": { height: math.unit(17, "feet") }, + "Front": { height: math.unit(17, "feet") } + } + }, + { + name: "64' Flatcar", + mass: math.unit(66000, "lbs"), + sides: { + "Side": { height: math.unit(5.03, "feet") }, + "Front": { height: math.unit(5.03, "feet") }, + } + }, + { + name: "3250 Cubic Ft Hopper", + mass: math.unit(52000, "lbs"), + sides: { + "Side": { height: math.unit(15 + 3/12, "feet") }, + "Front": { height: math.unit(15 + 3/12, "feet") }, + } + }, + { + name: "28600 Gallon Tank Car", + mass: math.unit(93000, "lbs"), + sides: { + "Side": { height: math.unit(15 + 5.7/12, "feet") }, + "Front": { height: math.unit(15 + 5.7/12, "feet") }, + } + } + ], + "Trains", + "train") + }); return results; }