From bc42307b8d892894e88269c6de5a77f916213ddb Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Mon, 2 Mar 2020 14:55:28 -0500 Subject: [PATCH] Add a few cars --- media/attribution.js | 17 + media/vehicles/cars/car_honda-civic-front.svg | 308 +++++++++ media/vehicles/cars/car_honda-civic-side.svg | 438 +++++++++++++ media/vehicles/cars/car_honda-civic-top.svg | 313 +++++++++ .../cars/car_toyota-prius-c-front.svg | 235 +++++++ .../vehicles/cars/car_toyota-prius-c-side.svg | 522 +++++++++++++++ .../vehicles/cars/car_toyota-prius-c-top.svg | 404 ++++++++++++ .../vehicles/cars/car_vw-new-beetle-front.svg | 276 ++++++++ .../vehicles/cars/car_vw-new-beetle-side.svg | 594 ++++++++++++++++++ media/vehicles/cars/car_vw-new-beetle-top.svg | 459 ++++++++++++++ presets/vehicles.js | 70 +++ 11 files changed, 3636 insertions(+) create mode 100644 media/vehicles/cars/car_honda-civic-front.svg create mode 100644 media/vehicles/cars/car_honda-civic-side.svg create mode 100644 media/vehicles/cars/car_honda-civic-top.svg create mode 100644 media/vehicles/cars/car_toyota-prius-c-front.svg create mode 100644 media/vehicles/cars/car_toyota-prius-c-side.svg create mode 100644 media/vehicles/cars/car_toyota-prius-c-top.svg create mode 100644 media/vehicles/cars/car_vw-new-beetle-front.svg create mode 100644 media/vehicles/cars/car_vw-new-beetle-side.svg create mode 100644 media/vehicles/cars/car_vw-new-beetle-top.svg diff --git a/media/attribution.js b/media/attribution.js index 19f329ef..aae0e8f2 100644 --- a/media/attribution.js +++ b/media/attribution.js @@ -2858,6 +2858,23 @@ const attributionData = { "h-padleckas" ] }, + { + prefix: "./media/vehicles/cars/", + files: [ + { name: "car_toyota-prius-c-front.svg", source: "https://www.dimensions.guide/element/toyota-prius-c" }, + { name: "car_toyota-prius-c-side.svg", source: "https://www.dimensions.guide/element/toyota-prius-c" }, + { name: "car_toyota-prius-c-top.svg", source: "https://www.dimensions.guide/element/toyota-prius-c" }, + { name: "car_vw-new-beetle-front.svg", source: "https://www.dimensions.guide/element/volkswagen-new-beetle" }, + { name: "car_vw-new-beetle-side.svg", source: "https://www.dimensions.guide/element/volkswagen-new-beetle" }, + { name: "car_vw-new-beetle-top.svg", source: "https://www.dimensions.guide/element/volkswagen-new-beetle" }, + { name: "car_honda-civic-front.svg", source: "https://www.dimensions.guide/element/honda-civic" }, + { name: "car_honda-civic-side.svg", source: "https://www.dimensions.guide/element/honda-civic" }, + { name: "car_honda-civic-top.svg", source: "https://www.dimensions.guide/element/honda-civic" }, + ], + authors: [ + "dimensions-guide" + ] + }, { prefix: "./media/vehicles/planes/", files: [ diff --git a/media/vehicles/cars/car_honda-civic-front.svg b/media/vehicles/cars/car_honda-civic-front.svg new file mode 100644 index 00000000..4b73cc85 --- /dev/null +++ b/media/vehicles/cars/car_honda-civic-front.svg @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/vehicles/cars/car_honda-civic-side.svg b/media/vehicles/cars/car_honda-civic-side.svg new file mode 100644 index 00000000..74d3cb2a --- /dev/null +++ b/media/vehicles/cars/car_honda-civic-side.svg @@ -0,0 +1,438 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/vehicles/cars/car_honda-civic-top.svg b/media/vehicles/cars/car_honda-civic-top.svg new file mode 100644 index 00000000..ab69de49 --- /dev/null +++ b/media/vehicles/cars/car_honda-civic-top.svg @@ -0,0 +1,313 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/vehicles/cars/car_toyota-prius-c-front.svg b/media/vehicles/cars/car_toyota-prius-c-front.svg new file mode 100644 index 00000000..822e9ad8 --- /dev/null +++ b/media/vehicles/cars/car_toyota-prius-c-front.svg @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/vehicles/cars/car_toyota-prius-c-side.svg b/media/vehicles/cars/car_toyota-prius-c-side.svg new file mode 100644 index 00000000..5377d2dd --- /dev/null +++ b/media/vehicles/cars/car_toyota-prius-c-side.svg @@ -0,0 +1,522 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/vehicles/cars/car_toyota-prius-c-top.svg b/media/vehicles/cars/car_toyota-prius-c-top.svg new file mode 100644 index 00000000..26c4a2c0 --- /dev/null +++ b/media/vehicles/cars/car_toyota-prius-c-top.svg @@ -0,0 +1,404 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/vehicles/cars/car_vw-new-beetle-front.svg b/media/vehicles/cars/car_vw-new-beetle-front.svg new file mode 100644 index 00000000..75b4060a --- /dev/null +++ b/media/vehicles/cars/car_vw-new-beetle-front.svg @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/vehicles/cars/car_vw-new-beetle-side.svg b/media/vehicles/cars/car_vw-new-beetle-side.svg new file mode 100644 index 00000000..8785ecea --- /dev/null +++ b/media/vehicles/cars/car_vw-new-beetle-side.svg @@ -0,0 +1,594 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/vehicles/cars/car_vw-new-beetle-top.svg b/media/vehicles/cars/car_vw-new-beetle-top.svg new file mode 100644 index 00000000..efc89d23 --- /dev/null +++ b/media/vehicles/cars/car_vw-new-beetle-top.svg @@ -0,0 +1,459 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/presets/vehicles.js b/presets/vehicles.js index 147b190f..9d90ac2b 100644 --- a/presets/vehicles.js +++ b/presets/vehicles.js @@ -128,6 +128,71 @@ function makeAircraft() { return entity; } +function makeCars() { + const options = [ + ["Toyota Prius C", 3.99, 1.45, 1134, 1, 1.07, 1], + ["VW New Beetle", 4.13, 1.57, 1230, 1, 1, 1], + ["Honda Civic", 4.55, 1.42, 1303, 1, 1, 1], + ] + sides = {} + const sorted = options.sort((a,b) => a[1]-b[1]) + + sorted.forEach(car => { + sides[car[0] + " (Front)"] = { + name: car[0] + " (Front)", + rename: true, + height: math.unit(car[2], "meters"), + mass: math.unit(car[3], "kg"), + image: { source: "./media/vehicles/cars/car_" + car[0].replace(/ /g, "-").toLowerCase() + "-front.svg", extra: car[4] } + }; + + sides[car[0] + " (Side)"] = { + name: car[0] + " (Side)", + rename: true, + height: math.unit(car[2], "meters"), + mass: math.unit(car[3], "kg"), + image: { source: "./media/vehicles/cars/car_" + car[0].replace(/ /g, "-").toLowerCase() + "-side.svg", extra: car[5] } + }; + + sides[car[0] + " (Top)"] = { + name: car[0] + " (Top)", + rename: true, + height: math.unit(car[1], "meters"), + mass: math.unit(car[3], "kg"), + image: { source: "./media/vehicles/cars/car_" + car[0].replace(/ /g, "-").toLowerCase() + "-top.svg", extra: car[6] } + }; + }); + + const entity = makeMultiVehicle("Cars", sides); + + entity.sizes.push({ + name: "1:72", + height: math.unit(sorted[0][2]/72, "meters") + }); + entity.sizes.push({ + name: "1:24", + height: math.unit(sorted[0][2]/24, "meters") + }); + entity.sizes.push({ + name: "1:16", + height: math.unit(sorted[0][2]/16, "meters") + }); + entity.sizes.push({ + name: "1:8", + height: math.unit(sorted[0][2]/8, "meters") + }); + entity.sizes.push({ + name: "1:4", + height: math.unit(sorted[0][2]/4, "meters") + }); + entity.sizes.push({ + name: "1", + height: math.unit(sorted[0][2], "meters") + }); + + return entity; +} + function makeVehicles() { const results = []; @@ -276,6 +341,11 @@ function makeVehicles() { name: "Aircraft", constructor: () => makeAircraft() }); + + results.push({ + name: "Cars", + constructor: () => makeCars() + }); return results; }