From 0cc412e922d7475bcb740fa01636b4255c5bac77 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sat, 14 Mar 2020 19:00:24 -0400 Subject: [PATCH] Add various strands --- media/attribution.js | 1 + media/objects/strand.svg | 13 +++++ presets/objects.js | 104 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 media/objects/strand.svg diff --git a/media/attribution.js b/media/attribution.js index 7f3b8852..8c48288f 100644 --- a/media/attribution.js +++ b/media/attribution.js @@ -6181,6 +6181,7 @@ const attributionData = { { name: "credit-card.svg", source: null }, { name: "credit-card-vertical.svg", source: null }, { name: "flagpole.svg", source: null }, + { name: "strand.svg", source: null }, ], authors: [ "chemicalcrux" diff --git a/media/objects/strand.svg b/media/objects/strand.svg new file mode 100644 index 00000000..22fc2247 --- /dev/null +++ b/media/objects/strand.svg @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/presets/objects.js b/presets/objects.js index ed2646eb..ea3e7c0a 100644 --- a/presets/objects.js +++ b/presets/objects.js @@ -471,7 +471,109 @@ function makeObjects() { ], "Chess Pieces", "chess_" - )) + )); + + results.push({ + name: "Strand", + constructor: () => { + views = {}; + + viewInfo = { + opticalFibre: { + name: "Optical Fibre", + thickness: math.unit(0.375, "mm") + }, + hair: { + name: "Hair", + thickness: math.unit(0.07, "mm") + }, + spiderSilk: { + name: "Spider Silk", + thickness: math.unit(0.003, "mm") + }, + suspensionCables: { + name: "Suspension Bridge Cables", + thickness: math.unit(3, "feet") + }, + capillary: { + name: "Capillary", + thickness: math.unit(7.5, "micrometers") + }, + vein: { + name: "Vein", + thickness: math.unit(10, "mm") + }, + thread: { + name: "Thread", + thickness: math.unit(0.4, "mm") + }, + powerCord: { + name: "Power Cord", + thickness: math.unit(0.25, "inches") + }, + pianoWireBass: { + name: "Piano Wire (Bass)", + thickness: math.unit(8.5, "mm") + }, + pianoWireTreble: { + name: "Piano Wire (Treble)", + thickness: math.unit(0.85, "mm") + }, + guitarString: { + name: "Guitar String", + thickness: math.unit(0.03, "inches") + }, + powerLineThin: { + name: "Power Line (Thin)", + thickness: math.unit(0.325, "inches") + }, + powerLineThick: { + name: "Power Line (Thick)", + thickness: math.unit(0.720, "inches") + }, + carbonNanotube: { + name: "Carbon Nanotube", + thickness: math.unit(4, "nm") + } + + } + + Object.entries(viewInfo).forEach(([key, value]) => { + views[key] = { + attributes: { + height: { + name: "Height", + power: 1, + type: "length", + base: math.multiply(value.thickness, 253.4385 / 5) + }, + thickness: { + name: "Thickness", + power: 1, + type: "length", + base: value.thickness + }, + }, + image: { + source: "./media/objects/strand.svg" + }, + name: value.name, + rename: true + } + + if (value.mass) { + views[key].attributes.mass = { + name: "Mass", + power: 3, + type: "mass", + base: value.mass + }; + } + }); + + return makeEntity({ name: "Strand" }, views); + } + }) results.sort((b1, b2) => {