(just a credit card for now, though). This also introduces some fixes to the process-model script, allowing for it to compensate for the extra height introduced by the line art. blender-model.py is adjusted to allow for this, and makeModel() now checks for the bottom/extra values produced by the process.master
| @@ -19870,8 +19870,6 @@ const attributionData = { | |||
| { name: "circle.svg", source: null }, | |||
| { name: "pencil.svg", source: null }, | |||
| { name: "pebble.svg", source: null }, | |||
| { name: "credit-card.svg", source: null }, | |||
| { name: "credit-card-vertical.svg", source: null }, | |||
| { name: "flagpole.svg", source: null }, | |||
| { name: "strand.svg", source: null }, | |||
| { name: "sine-wave.svg", source: null }, | |||
| @@ -20356,6 +20354,16 @@ const attributionData = { | |||
| "https://www.homedepot.com/p/L-I-F-Industries-36-in-x-80-in-Gray-Flush-Exit-Left-Hand-Fire-Proof-Steel-Prehung-Commercial-Door-with-Welded-Frame-UWX3680L/202510508" | |||
| ] | |||
| }, | |||
| { | |||
| prefix: "./media/objects/Cards/", | |||
| all: null, | |||
| authors: [ | |||
| "chemicalcrux" | |||
| ], | |||
| citations: [ | |||
| "https://en.wikipedia.org/wiki/ISO/IEC_7810" | |||
| ] | |||
| }, | |||
| { | |||
| prefix: "./media/real-buildings/", | |||
| all: "https://wiki.openstreetmap.org/wiki/Blender", | |||
| @@ -0,0 +1,51 @@ | |||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | |||
| <svg | |||
| xmlns:dc="http://purl.org/dc/elements/1.1/" | |||
| xmlns:cc="http://creativecommons.org/ns#" | |||
| xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |||
| xmlns:svg="http://www.w3.org/2000/svg" | |||
| xmlns="http://www.w3.org/2000/svg" | |||
| id="svg16" | |||
| preserveAspectRatio="xMidYMid meet" | |||
| viewBox="0 0 1676 1060" | |||
| height="1060pt" | |||
| width="1676pt" | |||
| version="1.0"> | |||
| <defs | |||
| id="defs20" /> | |||
| <metadata | |||
| id="metadata2"> | |||
| Created by potrace 1.16, written by Peter Selinger 2001-2019 | |||
| <rdf:RDF> | |||
| <cc:Work | |||
| rdf:about=""> | |||
| <dc:format>image/svg+xml</dc:format> | |||
| <dc:type | |||
| rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | |||
| </cc:Work> | |||
| </rdf:RDF> | |||
| </metadata> | |||
| <g | |||
| style="fill:#000000;stroke:none" | |||
| id="g6" | |||
| transform="matrix(0.1,0,0,-0.1,-162,1530)"> | |||
| <path | |||
| id="path4" | |||
| d="m 2100,15277 c -231,-69 -402,-245 -461,-475 -18,-72 -19,-119 -19,-1074 v -998 l 25,-12 25,-11 V 9061 5415 l -22,-10 c -19,-8 -24,-19 -26,-64 -4,-70 21,-180 58,-259 84,-178 239,-308 430,-361 l 75,-21 h 7815 7815 l 75,21 c 234,65 411,244 471,477 19,74 19,159 19,4644 v 4568 l -25,12 c -23,11 -25,16 -25,87 0,69 2,77 23,86 18,8 23,19 25,64 4,70 -21,180 -58,259 -84,178 -239,308 -430,361 l -75,21 -7820,-1 H 2175 Z" /> | |||
| </g> | |||
| <g | |||
| style="fill:#1a1a1a;stroke:none" | |||
| id="g12" | |||
| transform="matrix(0.1,0,0,-0.1,-162,1530)"> | |||
| <path | |||
| id="path8" | |||
| d="m 2115,15176 c -172,-55 -296,-173 -362,-344 -24,-61 -27,-83 -31,-234 l -4,-168 h 8306 8306 v 79 c 0,71 -2,80 -20,86 -22,7 -26,21 -34,112 -19,213 -182,405 -400,472 l -68,21 H 9996 l -7811,-1 z" /> | |||
| <path | |||
| id="path10" | |||
| d="m 1670,9061 c 0,-3639 0,-3650 20,-3656 22,-7 26,-21 34,-112 19,-213 182,-405 400,-472 l 68,-21 h 7808 7808 l 68,21 c 175,53 302,172 372,347 l 27,67 3,3738 2,3737 H 9975 1670 Z" /> | |||
| </g> | |||
| <g | |||
| style="fill:#333333;stroke:none" | |||
| id="g14" | |||
| transform="matrix(0.1,0,0,-0.1,-162,1530)" /> | |||
| </svg> | |||
| @@ -0,0 +1,199 @@ | |||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | |||
| <svg | |||
| xmlns:dc="http://purl.org/dc/elements/1.1/" | |||
| xmlns:cc="http://creativecommons.org/ns#" | |||
| xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |||
| xmlns:svg="http://www.w3.org/2000/svg" | |||
| xmlns="http://www.w3.org/2000/svg" | |||
| id="svg114" | |||
| preserveAspectRatio="xMidYMid meet" | |||
| viewBox="0 0 1676.15 40.225002" | |||
| height="40.225002pt" | |||
| width="1676.15pt" | |||
| version="1.0"> | |||
| <defs | |||
| id="defs118" /> | |||
| <metadata | |||
| id="metadata2"> | |||
| Created by potrace 1.16, written by Peter Selinger 2001-2019 | |||
| <rdf:RDF> | |||
| <cc:Work | |||
| rdf:about=""> | |||
| <dc:format>image/svg+xml</dc:format> | |||
| <dc:type | |||
| rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | |||
| </cc:Work> | |||
| </rdf:RDF> | |||
| </metadata> | |||
| <g | |||
| style="fill:#000000;stroke:none" | |||
| id="g6" | |||
| transform="matrix(0.1,0,0,-0.1,-161.925,1020.075)"> | |||
| <path | |||
| id="path4" | |||
| d="m 3582,10188 c -7,-7 -12,-36 -12,-65 v -53 h -963 c -736,0 -966,-3 -975,-12 -17,-17 -17,-229 0,-246 18,-18 16718,-18 16736,0 17,17 17,229 0,246 -9,9 -233,12 -945,12 h -933 v 53 c 0,29 -5,58 -12,65 -9,9 -94,12 -319,12 -307,0 -308,0 -323,-22 -9,-12 -16,-42 -16,-65 0,-41 -1,-43 -30,-43 -29,0 -30,1 -30,49 0,84 12,81 -339,81 -225,0 -310,-3 -319,-12 -7,-7 -12,-36 -12,-65 v -53 h -35 -35 v 53 c 0,29 -5,58 -12,65 -17,17 -1369,17 -1386,0 -7,-7 -12,-36 -12,-65 v -53 h -40 -40 v 49 c 0,89 126,81 -1270,81 -1398,0 -1269,8 -1271,-83 l -2,-52 -6,51 c -11,91 27,84 -497,84 -525,0 -494,5 -494,-81 v -49 h -100 -100 v 53 c 0,29 -5,58 -12,65 -9,9 -94,12 -319,12 -351,0 -339,3 -339,-81 0,-48 -1,-49 -30,-49 -29,0 -30,1 -30,48 0,90 109,82 -1145,82 -795,0 -1112,-3 -1122,-11 -8,-7 -13,-33 -13,-65 v -54 h -40 -40 v 43 c 0,23 -7,52 -15,65 l -16,22 H 5132 c -1184,0 -1541,-3 -1550,-12 z" /> | |||
| </g> | |||
| <g | |||
| style="fill:#1a1a1a;stroke:none" | |||
| id="g60" | |||
| transform="matrix(0.1,0,0,-0.1,-161.925,1020.075)"> | |||
| <path | |||
| id="path8" | |||
| d="m 3700,10085 c 0,-8 9,-15 20,-15 11,0 20,7 20,15 0,8 -9,15 -20,15 -11,0 -20,-7 -20,-15 z" /> | |||
| <path | |||
| id="path10" | |||
| d="m 3840,10085 c 0,-13 37,-15 275,-15 238,0 275,2 275,15 0,13 -37,15 -275,15 -238,0 -275,-2 -275,-15 z" /> | |||
| <path | |||
| id="path12" | |||
| d="m 4490,10085 c 0,-8 9,-15 20,-15 11,0 20,7 20,15 0,8 -9,15 -20,15 -11,0 -20,-7 -20,-15 z" /> | |||
| <path | |||
| id="path14" | |||
| d="m 4631,10084 c 0,-11 3,-14 6,-6 3,7 2,16 -1,19 -3,4 -6,-2 -5,-13 z" /> | |||
| <path | |||
| id="path16" | |||
| d="m 4740,10085 c 0,-13 37,-15 270,-15 233,0 270,2 270,15 0,13 -37,15 -270,15 -233,0 -270,-2 -270,-15 z" /> | |||
| <path | |||
| id="path18" | |||
| d="m 5380,10085 c 0,-12 20,-15 120,-15 100,0 120,3 120,15 0,13 -20,15 -120,15 -100,0 -120,-2 -120,-15 z" /> | |||
| <path | |||
| id="path20" | |||
| d="m 5790,10085 c 0,-13 52,-15 405,-15 353,0 405,2 405,15 0,13 -52,15 -405,15 -353,0 -405,-2 -405,-15 z" /> | |||
| <path | |||
| id="path22" | |||
| d="m 6880,10085 c 0,-8 9,-15 20,-15 11,0 20,7 20,15 0,8 -9,15 -20,15 -11,0 -20,-7 -20,-15 z" /> | |||
| <path | |||
| id="path24" | |||
| d="m 7020,10085 c 0,-13 36,-15 265,-15 229,0 265,2 265,15 0,13 -36,15 -265,15 -229,0 -265,-2 -265,-15 z" /> | |||
| <path | |||
| id="path26" | |||
| d="m 7720,10085 c 0,-13 61,-15 490,-15 429,0 490,2 490,15 0,13 -61,15 -490,15 -429,0 -490,-2 -490,-15 z" /> | |||
| <path | |||
| id="path28" | |||
| d="m 8800,10085 c 0,-12 16,-15 80,-15 64,0 80,3 80,15 0,12 -16,15 -80,15 -64,0 -80,-3 -80,-15 z" /> | |||
| <path | |||
| id="path30" | |||
| d="m 9220,10085 c 0,-13 33,-15 235,-15 202,0 235,2 235,15 0,13 -33,15 -235,15 -202,0 -235,-2 -235,-15 z" /> | |||
| <path | |||
| id="path32" | |||
| d="m 10090,10085 c 0,-13 51,-15 395,-15 344,0 395,2 395,15 0,13 -51,15 -395,15 -344,0 -395,-2 -395,-15 z" /> | |||
| <path | |||
| id="path34" | |||
| d="m 11090,10085 c 0,-8 9,-15 20,-15 11,0 20,7 20,15 0,8 -9,15 -20,15 -11,0 -20,-7 -20,-15 z" /> | |||
| <path | |||
| id="path36" | |||
| d="m 11230,10085 c 0,-10 11,-15 35,-15 24,0 35,5 35,15 0,10 -11,15 -35,15 -24,0 -35,-5 -35,-15 z" /> | |||
| <path | |||
| id="path38" | |||
| d="m 11410,10085 c 0,-13 32,-15 230,-15 198,0 230,2 230,15 0,13 -32,15 -230,15 -198,0 -230,-2 -230,-15 z" /> | |||
| <path | |||
| id="path40" | |||
| d="m 11970,10085 c 0,-10 10,-15 30,-15 20,0 30,5 30,15 0,10 -10,15 -30,15 -20,0 -30,-5 -30,-15 z" /> | |||
| <path | |||
| id="path42" | |||
| d="m 12130,10085 c 0,-8 9,-15 20,-15 11,0 20,7 20,15 0,8 -9,15 -20,15 -11,0 -20,-7 -20,-15 z" /> | |||
| <path | |||
| id="path44" | |||
| d="m 12270,10085 c 0,-8 9,-15 20,-15 11,0 20,7 20,15 0,8 -9,15 -20,15 -11,0 -20,-7 -20,-15 z" /> | |||
| <path | |||
| id="path46" | |||
| d="m 12450,10085 c 0,-13 61,-15 490,-15 429,0 490,2 490,15 0,13 -61,15 -490,15 -429,0 -490,-2 -490,-15 z" /> | |||
| <path | |||
| id="path48" | |||
| d="m 13710,10085 c 0,-8 7,-15 15,-15 8,0 15,7 15,15 0,8 -7,15 -15,15 -8,0 -15,-7 -15,-15 z" /> | |||
| <path | |||
| id="path50" | |||
| d="m 13840,10085 c 0,-13 45,-15 345,-15 300,0 345,2 345,15 0,13 -45,15 -345,15 -300,0 -345,-2 -345,-15 z" /> | |||
| <path | |||
| id="path52" | |||
| d="m 14630,10085 c 0,-13 23,-15 145,-15 122,0 145,2 145,15 0,13 -23,15 -145,15 -122,0 -145,-2 -145,-15 z" /> | |||
| <path | |||
| id="path54" | |||
| d="m 15190,10085 c 0,-13 33,-15 235,-15 202,0 235,2 235,15 0,13 -33,15 -235,15 -202,0 -235,-2 -235,-15 z" /> | |||
| <path | |||
| id="path56" | |||
| d="m 15920,10085 c 0,-13 33,-15 235,-15 202,0 235,2 235,15 0,13 -33,15 -235,15 -202,0 -235,-2 -235,-15 z" /> | |||
| <path | |||
| id="path58" | |||
| d="m 1720,9940 v -30 h 8280 8280 v 30 30 H 10000 1720 Z" /> | |||
| </g> | |||
| <g | |||
| style="fill:#333333;stroke:none" | |||
| id="g112" | |||
| transform="matrix(0.1,0,0,-0.1,-161.925,1020.075)"> | |||
| <path | |||
| id="path62" | |||
| d="m 3700,10085 c 0,-8 9,-15 20,-15 11,0 20,7 20,15 0,8 -9,15 -20,15 -11,0 -20,-7 -20,-15 z" /> | |||
| <path | |||
| id="path64" | |||
| d="m 3840,10085 c 0,-13 37,-15 275,-15 238,0 275,2 275,15 0,13 -37,15 -275,15 -238,0 -275,-2 -275,-15 z" /> | |||
| <path | |||
| id="path66" | |||
| d="m 4490,10085 c 0,-8 9,-15 20,-15 11,0 20,7 20,15 0,8 -9,15 -20,15 -11,0 -20,-7 -20,-15 z" /> | |||
| <path | |||
| id="path68" | |||
| d="m 4631,10084 c 0,-11 3,-14 6,-6 3,7 2,16 -1,19 -3,4 -6,-2 -5,-13 z" /> | |||
| <path | |||
| id="path70" | |||
| d="m 4740,10085 c 0,-13 37,-15 270,-15 233,0 270,2 270,15 0,13 -37,15 -270,15 -233,0 -270,-2 -270,-15 z" /> | |||
| <path | |||
| id="path72" | |||
| d="m 5380,10085 c 0,-12 20,-15 120,-15 100,0 120,3 120,15 0,13 -20,15 -120,15 -100,0 -120,-2 -120,-15 z" /> | |||
| <path | |||
| id="path74" | |||
| d="m 5790,10085 c 0,-13 52,-15 405,-15 353,0 405,2 405,15 0,13 -52,15 -405,15 -353,0 -405,-2 -405,-15 z" /> | |||
| <path | |||
| id="path76" | |||
| d="m 6880,10085 c 0,-8 9,-15 20,-15 11,0 20,7 20,15 0,8 -9,15 -20,15 -11,0 -20,-7 -20,-15 z" /> | |||
| <path | |||
| id="path78" | |||
| d="m 7020,10085 c 0,-13 36,-15 265,-15 229,0 265,2 265,15 0,13 -36,15 -265,15 -229,0 -265,-2 -265,-15 z" /> | |||
| <path | |||
| id="path80" | |||
| d="m 7720,10085 c 0,-13 61,-15 490,-15 429,0 490,2 490,15 0,13 -61,15 -490,15 -429,0 -490,-2 -490,-15 z" /> | |||
| <path | |||
| id="path82" | |||
| d="m 8800,10085 c 0,-12 16,-15 80,-15 64,0 80,3 80,15 0,12 -16,15 -80,15 -64,0 -80,-3 -80,-15 z" /> | |||
| <path | |||
| id="path84" | |||
| d="m 9220,10085 c 0,-13 33,-15 235,-15 202,0 235,2 235,15 0,13 -33,15 -235,15 -202,0 -235,-2 -235,-15 z" /> | |||
| <path | |||
| id="path86" | |||
| d="m 10090,10085 c 0,-13 51,-15 395,-15 344,0 395,2 395,15 0,13 -51,15 -395,15 -344,0 -395,-2 -395,-15 z" /> | |||
| <path | |||
| id="path88" | |||
| d="m 11090,10085 c 0,-8 9,-15 20,-15 11,0 20,7 20,15 0,8 -9,15 -20,15 -11,0 -20,-7 -20,-15 z" /> | |||
| <path | |||
| id="path90" | |||
| d="m 11230,10085 c 0,-10 11,-15 35,-15 24,0 35,5 35,15 0,10 -11,15 -35,15 -24,0 -35,-5 -35,-15 z" /> | |||
| <path | |||
| id="path92" | |||
| d="m 11410,10085 c 0,-13 32,-15 230,-15 198,0 230,2 230,15 0,13 -32,15 -230,15 -198,0 -230,-2 -230,-15 z" /> | |||
| <path | |||
| id="path94" | |||
| d="m 11970,10085 c 0,-10 10,-15 30,-15 20,0 30,5 30,15 0,10 -10,15 -30,15 -20,0 -30,-5 -30,-15 z" /> | |||
| <path | |||
| id="path96" | |||
| d="m 12130,10085 c 0,-8 9,-15 20,-15 11,0 20,7 20,15 0,8 -9,15 -20,15 -11,0 -20,-7 -20,-15 z" /> | |||
| <path | |||
| id="path98" | |||
| d="m 12270,10085 c 0,-8 9,-15 20,-15 11,0 20,7 20,15 0,8 -9,15 -20,15 -11,0 -20,-7 -20,-15 z" /> | |||
| <path | |||
| id="path100" | |||
| d="m 12450,10085 c 0,-13 61,-15 490,-15 429,0 490,2 490,15 0,13 -61,15 -490,15 -429,0 -490,-2 -490,-15 z" /> | |||
| <path | |||
| id="path102" | |||
| d="m 13710,10085 c 0,-8 7,-15 15,-15 8,0 15,7 15,15 0,8 -7,15 -15,15 -8,0 -15,-7 -15,-15 z" /> | |||
| <path | |||
| id="path104" | |||
| d="m 13840,10085 c 0,-13 45,-15 345,-15 300,0 345,2 345,15 0,13 -45,15 -345,15 -300,0 -345,-2 -345,-15 z" /> | |||
| <path | |||
| id="path106" | |||
| d="m 14630,10085 c 0,-13 23,-15 145,-15 122,0 145,2 145,15 0,13 -23,15 -145,15 -122,0 -145,-2 -145,-15 z" /> | |||
| <path | |||
| id="path108" | |||
| d="m 15190,10085 c 0,-13 33,-15 235,-15 202,0 235,2 235,15 0,13 -33,15 -235,15 -202,0 -235,-2 -235,-15 z" /> | |||
| <path | |||
| id="path110" | |||
| d="m 15920,10085 c 0,-13 33,-15 235,-15 202,0 235,2 235,15 0,13 -33,15 -235,15 -202,0 -235,-2 -235,-15 z" /> | |||
| </g> | |||
| </svg> | |||
| @@ -203,6 +203,12 @@ function makeModel(data) { | |||
| source: "./media/" + data.kind + "/" + data.name + "/" + form.name + "-" + view.name + ".svg" | |||
| } | |||
| } | |||
| if (view.bottom) | |||
| views[viewId].image.bottom = view.bottom | |||
| if (view.extra) | |||
| views[viewId].image.extra = view.extra | |||
| }) | |||
| }); | |||
| @@ -415,25 +421,6 @@ function makeObjects() { | |||
| ) | |||
| }); | |||
| results.push({ | |||
| name: "Credit Card", | |||
| constructor: () => makeObject( | |||
| "Credit Card", | |||
| { | |||
| creditCard: { | |||
| height: math.unit(53.98, "mm"), | |||
| image: { source: "./media/objects/credit-card.svg" }, | |||
| name: "Credit card", | |||
| }, | |||
| creditCardVertical: { | |||
| height: math.unit(85.60, "mm"), | |||
| image: { source: "./media/objects/credit-card-vertical.svg" }, | |||
| name: "Credit card (vertical)", | |||
| }, | |||
| } | |||
| ) | |||
| }); | |||
| results.push({ | |||
| name: "Molecular", | |||
| constructor: () => makeObject( | |||
| @@ -919,6 +906,7 @@ function makeObjects() { | |||
| /* ***Straws*** */ results.push(makeModel({"name": "Straws", "kind": "objects", "forms": [{"name": "Normal", "views": [{"name": "Front", "height": 0.2159000039100647}, {"name": "Top", "height": 0.006095999851822853}]}, {"name": "Wide", "views": [{"name": "Front", "height": 0.2159000039100647}, {"name": "Top", "height": 0.008127997629344463}]}, {"name": "Smoothie", "views": [{"name": "Front", "height": 0.2159000039100647}, {"name": "Top", "height": 0.00914399977773428}]}, {"name": "Boba", "views": [{"name": "Front", "height": 0.2159000039100647}, {"name": "Top", "height": 0.012191999703645706}]}]})); | |||
| /* ***Coins*** */ results.push(makeModel({"name": "Coins", "kind": "objects", "forms": [{"name": "U.S. Dollar", "views": [{"name": "Top", "height": 0.026492198929190636, "mass": 0.008100000210106373}, {"name": "Side", "height": 0.0020000000949949026, "mass": 0.008100000210106373}]}, {"name": "U.S. Half Dollar", "views": [{"name": "Top", "height": 0.03060699999332428, "mass": 0.011339999735355377}, {"name": "Side", "height": 0.00215000007301569, "mass": 0.011339999735355377}]}, {"name": "U.S. Quarter", "views": [{"name": "Top", "height": 0.024257000535726547, "mass": 0.005669999867677689}, {"name": "Side", "height": 0.0017500000540167093, "mass": 0.005669999867677689}]}, {"name": "U.S. Dime", "views": [{"name": "Top", "height": 0.017906999215483665, "mass": 0.002268000040203333}, {"name": "Side", "height": 0.0013500000350177288, "mass": 0.002268000040203333}]}, {"name": "U.S. Nickel", "views": [{"name": "Top", "height": 0.021208999678492546, "mass": 0.004999999888241291}, {"name": "Side", "height": 0.0019500000635161996, "mass": 0.004999999888241291}]}, {"name": "U.S. Penny", "views": [{"name": "Top", "height": 0.019050000235438347, "mass": 0.0024999999441206455}, {"name": "Side", "height": 0.0015200000489130616, "mass": 0.0024999999441206455}]}, {"name": "UK \u00a35", "views": [{"name": "Top", "height": 0.028400002047419548, "mass": 0.028279999271035194}, {"name": "Side", "height": 0.0028900043107569218, "mass": 0.028279999271035194}]}, {"name": "UK \u00a32", "views": [{"name": "Top", "height": 0.028400002047419548, "mass": 0.012000000104308128}, {"name": "Side", "height": 0.0025000039022415876, "mass": 0.012000000104308128}]}, {"name": "UK \u00a31", "views": [{"name": "Top", "height": 0.023430000990629196, "mass": 0.008750000037252903}, {"name": "Side", "height": 0.0028000001329928637, "mass": 0.008750000037252903}]}, {"name": "UK 50p", "views": [{"name": "Top", "height": 0.027300003916025162, "mass": 0.00800000037997961}, {"name": "Side", "height": 0.0017800000496208668, "mass": 0.00800000037997961}]}, {"name": "UK 20p", "views": [{"name": "Top", "height": 0.021400000900030136, "mass": 0.004999999888241291}, {"name": "Side", "height": 0.0017000001389533281, "mass": 0.004999999888241291}]}, {"name": "UK 10p", "views": [{"name": "Top", "height": 0.024500001221895218, "mass": 0.006500000134110451}, {"name": "Side", "height": 0.0018500001169741154, "mass": 0.006500000134110451}]}, {"name": "UK 5p", "views": [{"name": "Top", "height": 0.018000001087784767, "mass": 0.0032500000670552254}, {"name": "Side", "height": 0.0017000001389533281, "mass": 0.0032500000670552254}]}, {"name": "UK 2p", "views": [{"name": "Top", "height": 0.02590000070631504, "mass": 0.007120000198483467}, {"name": "Side", "height": 0.00203000009059906, "mass": 0.007120000198483467}]}, {"name": "UK 1p", "views": [{"name": "Top", "height": 0.0203000009059906, "mass": 0.0035600000992417336}, {"name": "Side", "height": 0.0016500001074746251, "mass": 0.0035600000992417336}]}, {"name": "Canadian Two Dollar", "views": [{"name": "Top", "height": 0.02800000086426735, "mass": 0.007300000172108412}, {"name": "Side", "height": 0.0018000000854954123, "mass": 0.007300000172108412}]}, {"name": "Canadian Dollar", "views": [{"name": "Top", "height": 0.026500001549720764, "mass": 0.0062699997797608376}, {"name": "Side", "height": 0.0019500007620081306, "mass": 0.0062699997797608376}]}, {"name": "2 Euro", "views": [{"name": "Top", "height": 0.02575000189244747, "mass": 0.008500000461935997}, {"name": "Side", "height": 0.0022000002209097147, "mass": 0.008500000461935997}]}, {"name": "1 Euro", "views": [{"name": "Top", "height": 0.023250000551342964, "mass": 0.007499999832361937}, {"name": "Side", "height": 0.0023300000466406345, "mass": 0.007499999832361937}]}, {"name": "500 Yen", "views": [{"name": "Top", "height": 0.026500001549720764, "mass": 0.0071000000461936}, {"name": "Side", "height": 0.0018100000452250242, "mass": 0.0071000000461936}]}, {"name": "50 Yen", "views": [{"name": "Top", "height": 0.021000003442168236, "mass": 0.004000000189989805}, {"name": "Side", "height": 0.0015100002055987716, "mass": 0.004000000189989805}]}, {"name": "5 Yen", "views": [{"name": "Top", "height": 0.02200000174343586, "mass": 0.0037499999161809683}, {"name": "Side", "height": 0.0015100002055987716, "mass": 0.0037499999161809683}]}]})); | |||
| /* ***Doors*** */ results.push(makeModel({"name": "Doors", "kind": "objects", "forms": [{"name": "6 Panel Door", "views": [{"name": "Front", "height": 2.0320000648498535, "mass": 11.793399810791016}, {"name": "Angled", "height": 2.0320000648498535, "mass": 11.793399810791016}, {"name": "Side", "height": 2.0320000648498535, "mass": 11.793399810791016}, {"name": "Top", "height": 0.03492499887943268, "mass": 11.793399810791016}]}, {"name": "French Door", "views": [{"name": "Front", "height": 2.0320000648498535, "mass": 31.75149917602539}, {"name": "Angled", "height": 2.0320000648498535, "mass": 31.75149917602539}, {"name": "Side", "height": 2.0320000648498535, "mass": 31.75149917602539}, {"name": "Top", "height": 0.03492499887943268, "mass": 31.75149917602539}]}, {"name": "Fire Door", "views": [{"name": "Front", "height": 2.0320000648498535, "mass": 54.54545593261719}, {"name": "Angled", "height": 2.0320000648498535, "mass": 54.54545593261719}, {"name": "Side", "height": 2.0320000648498535, "mass": 54.54545593261719}, {"name": "Top", "height": 0.10518216341733932, "mass": 54.54545593261719}]}]})); | |||
| /* ***Cards*** */ results.push(makeModel({"name": "Cards", "kind": "objects", "forms": [{"name": "Credit Card", "views": [{"name": "Front", "height": 0.053975000977516174, "mass": 11.793399810791016, "extra": 1.0047993079868203, "bottom": 0.00475367924528303}, {"name": "Back", "height": 0.053975000977516174, "mass": 11.793399810791016, "extra": 1.0047993079868203, "bottom": 0.00475367924528303}, {"name": "Edge", "height": 0.0015578659949824214, "mass": 11.793399810791016, "extra": 1.1704167, "bottom": 0.127097594675073}]}]})); | |||
| /* ***INSERT HERE*** */ | |||
| return results; | |||
| } | |||
| @@ -12,7 +12,8 @@ VIEW_DATA = { | |||
| "Back Angled": [1.5, 1, 2, "Back Angled"], | |||
| "Back": [2, 1, 2, "Back"], | |||
| "Top": [0, 0, 1, "Top"], | |||
| "Bottom": [0, 2, 1, "Bottom"] | |||
| "Bottom": [0, 2, 1, "Bottom"], | |||
| "Bottom Flipped": [2, 2, 1, "Bottom Flipped"], | |||
| } | |||
| def get_bounds(objects): | |||
| @@ -42,6 +43,7 @@ config = json.load(open(json_path.resolve(), encoding="utf-8")) | |||
| parent_workdir = config["work-directory"] | |||
| c = bpy.data.objects["cam"] | |||
| lineart = bpy.data.objects["lineart"] | |||
| c.data.type = "ORTHO" | |||
| bpy.data.scenes["Scene"].render.resolution_x = 2000 | |||
| @@ -65,6 +67,12 @@ default_views = [] | |||
| for view in mv["MVViews"].split(","): | |||
| default_views.append(VIEW_DATA[view.strip()]) | |||
| if "MVViewLabels" in mv: | |||
| for pair in mv["MVViewLabels"].split(","): | |||
| key, val = pair.split(":") | |||
| VIEW_DATA[key.strip()][3] = val.strip() | |||
| workdir = pathlib.Path(parent_workdir).joinpath(all_data["name"]) | |||
| os.makedirs(workdir, exist_ok=True) | |||
| @@ -120,9 +128,14 @@ for coll in collections: | |||
| if "Mass" in coll: | |||
| data["views"][-1]["mass"] = coll["Mass"] | |||
| lineart.hide_render = False | |||
| filename = f"{coll.name}-{angles[3]}.png" | |||
| bpy.context.scene.render.filepath = workdir.joinpath(filename).resolve().__str__() | |||
| bpy.ops.render.render(write_still = True) | |||
| lineart.hide_render = True | |||
| filename = f"{coll.name}-{angles[3]}-noline.png" | |||
| bpy.context.scene.render.filepath = workdir.joinpath(filename).resolve().__str__() | |||
| bpy.ops.render.render(write_still = True) | |||
| all_data["forms"].append(data) | |||
| coll.hide_render = True | |||
| @@ -1,11 +1,12 @@ | |||
| import sys | |||
| import re | |||
| import json | |||
| import glob | |||
| import os | |||
| import subprocess | |||
| import pathlib | |||
| from xml.dom import minidom | |||
| # an affront to god | |||
| def combine(base_path, highlight_path, vivid_path, output_path): | |||
| base = open(base_path, "r", encoding="utf-8").read() | |||
| @@ -57,6 +58,7 @@ for data in all_data["forms"]: | |||
| for view in data["views"]: | |||
| view_name = view["name"] | |||
| input = sourcedir.joinpath(name + "-" + view_name + ".png").__str__() | |||
| input_noline_raw = sourcedir.joinpath(name + "-" + view_name + "-" + "noline.png").__str__() | |||
| result = outputdir.joinpath(name + "-" + view_name + ".svg").__str__() | |||
| print(result) | |||
| if os.path.exists(result) and os.path.getmtime(input) < os.path.getmtime(result): | |||
| @@ -66,19 +68,47 @@ for data in all_data["forms"]: | |||
| input_base = sourcedir.joinpath(name + "-" + view_name + "-base.bmp").__str__() | |||
| input_highlight = sourcedir.joinpath(name + "-" + view_name + "-highlight.bmp").__str__() | |||
| input_vivid = sourcedir.joinpath(name + "-" + view_name + "-vivid.bmp").__str__() | |||
| input_noline = sourcedir.joinpath(name + "-" + view_name + "-noline.bmp").__str__() | |||
| subprocess.run(["magick", "convert", input, base_lut, "-channel", "RGB", "-clut", "-background", "#FFFFFF", "-flatten", input_base], shell=False) | |||
| subprocess.run(["magick", "convert", input, highlight_lut, "-channel", "RGB", "-clut", "-background", "#FFFFFF", "-flatten", input_highlight], shell=False) | |||
| subprocess.run(["magick", "convert", input, vivid_lut, "-channel", "RGB", "-clut", "-background", "#FFFFFF", "-flatten", input_vivid], shell=False) | |||
| # to correct for extra height from lines | |||
| subprocess.run(["magick", "convert", input_noline_raw, base_lut, "-channel", "RGB", "-clut", "-background", "#FFFFFF", "-flatten", input_noline], shell=False) | |||
| output_base = sourcedir.joinpath(name + "-" + view_name + "-base.svg").__str__() | |||
| output_highlight = sourcedir.joinpath(name + "-" + view_name + "-highlight.svg").__str__() | |||
| output_vivid = sourcedir.joinpath(name + "-" + view_name + "-vivid.svg").__str__() | |||
| output_noline = sourcedir.joinpath(name + "-" + view_name + "-noline.svg").__str__() | |||
| subprocess.run([POTRACE, input_base, "-b", "svg", "-o", output_base], shell=False) | |||
| subprocess.run([POTRACE, input_highlight, "-b", "svg", "-C", "#1a1a1a", "-o", output_highlight], shell=False) | |||
| subprocess.run([POTRACE, input_vivid, "-b", "svg", "-C", "#333333", "-o", output_vivid], shell=False) | |||
| subprocess.run([POTRACE, input_noline, "-b", "svg", "-C", "#333333", "-o", output_noline], shell=False) | |||
| combine(output_base, output_highlight, output_vivid, result) | |||
| noline_result = sourcedir.joinpath(name + "-" + view_name + "-noline_processed.svg").__str__() | |||
| # we now learn how much height was added by the lineart! | |||
| original_xml = minidom.parse(open(result)) | |||
| noline_xml = minidom.parse(open(noline_result)) | |||
| original_height = float(original_xml.childNodes[0].attributes["height"].value[:-2]) | |||
| noline_height = float(noline_xml.childNodes[0].attributes["height"].value[:-2]) | |||
| delta = original_height - noline_height | |||
| height = original_height | |||
| bottom = height - (height - delta / 2) | |||
| top = height - delta / 2 | |||
| view["extra"] = (height - bottom) / (top - bottom) | |||
| view["bottom"] = bottom / height | |||
| combine(output_noline, output_noline, output_noline, noline_result) | |||
| # os.unlink(input_base) | |||
| # os.unlink(input_highlight) | |||