function makeBuilding(name, height, image) { views = { building: { attributes: { height: { name: "Height", power: 1, type: "length", base: height } }, image: image, name: "building" }, }; return makeEntity({ name: name }, views); } function makeSkyscraper(name, image) { views = { building: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(1, "meter") } }, image: image, name: "building" }, }; const sizes = []; sizes.push({ name: "Short", height: math.unit(15, "stories") }); sizes.push({ name: "Medium", height: math.unit(40, "stories"), default: true }); sizes.push({ name: "Supertall", height: math.unit(350, "meters") }); sizes.push({ name: "Megatall", height: math.unit(650, "meters") }); const entity = makeEntity({ name: name }, views, sizes); return entity; } function makeBuildings() { const results = []; results.push({ name: "Two-Story Home", constructor: () => makeBuilding( "Two-Story Home", math.unit(25, "feet"), { source: "./media/buildings/house.svg" } ) }); results.push({ name: "Mobile Home", constructor: () => makeBuilding( "Mobile Home", math.unit(10, "feet"), { source: "./media/buildings/mobile-home.svg" } ) }); results.push({ name: "Mailbox", constructor: () => makeBuilding( "Mailbox", math.unit(5.1, "feet"), { source: "./media/buildings/mailbox.svg" } ) }); results.push({ name: "Bus Stop", constructor: () => makeBuilding( "Bus Stop", math.unit(8, "feet"), { source: "./media/buildings/bus-stop.svg" } ) }); results.push( { name: "Wide Skyscraper", constructor: () => makeSkyscraper( "Wide Skyscraper", { source: "./media/buildings/skyscrapers/wide.svg" } ) } ); results.push( { name: "Skyscraper", constructor: () => makeSkyscraper( "Skyscraper", { source: "./media/buildings/skyscrapers/medium.svg" } ) } ); results.push( { name: "Slender Skyscraper", constructor: () => makeSkyscraper( "Slender Skyscraper", { source: "./media/buildings/skyscrapers/slender.svg" } ) } ); results.push( { name: "Narrow Skyscraper", constructor: () => makeSkyscraper( "Narrow Skyscraper", { source: "./media/buildings/skyscrapers/narrow.svg" } ) } ); results.push( makeHeight( [ ["four-lane-highway", 27.432, "meters"], ["sidewalk", 24, "feet"] ], "Roads", "", "buildings" ) ) results.push( makeHeight( [ ["compact-parking-space", 16 + 4/12, "feet"], ["crosswalk", 26.25, "feet"], ["line", 26.25, "feet"], ["broken-line", 50, "feet"], ["dotted-line", 39, "feet"], ], "Road Markings", "", "buildings" ) ) results.push( makeHeight( [ ["residential", 12, "feet"], ["freeway", 50, "feet"] ], "Street Lamps", "", "buildings" ) ) results.push( makeHeight( [ ["badminton-court", 13.4, "meters"], ["basketball-court", 28, "meters"], ["bocce-court", 27.5, "meters"], ["bowling-lane", 23.8, "meters"], ["football-field", 160, "feet"], ["ice-hockey", 30, "meters"], ["netball-court", 30.5, "meters"], ["olympic-swimming-pool", 25, "meters"], ["snooker-table", 3.7, "meters"], ["squash-court", 9.8, "meters"], ["table-tennis", 2.79, "meters"], ["tennis-court", 23.8, "meters"], ["volleyball-court", 21.6, "meters"], ], "Sports Fields", "", "buildings" ) ) results.push( makeHeight( [ ["small", 51.8, "meters"], ["medium", 108.1, "meters"], ["large", 141.7, "meters"], ["extra-large", 190.2, "meters"] ], "Wind Turbines", "", "buildings" ) ) results.push({ name: "Gas Station", constructor: () => makeBuilding( "Gas Station", math.unit(6.78, "meters"), { source: "./media/buildings/gas-station.svg" } ) }); results.push({ name: "Staircase", constructor: () => makeBuilding( "Staircase", math.unit(12.956, "feet"), { source: "./media/buildings/staircase.svg" } ) }); results.push( makeHeight( [ ["residential", 83, "inches"], ["garage-door", 7.5, "feet"], ["double-garage-door", 7.5, "feet"], ["small-private-hangar", 10.5, "feet"], ], "Doorways", "", "buildings" ) ) results.push( makeHeight( [ ["akashi-kaikyō-bridge", 283, "meters"], ["chaotianmen-bridge", 160, "meters"], ["forth-bridge", 100, "meters"], ["golden-gate-bridge", 230, "meters"], ["millau-viaduct", 421, "meters"], ["rialto-bridge", 17, "meters"], ["russky-bridge", 306, "meters"], ["sydney-harbour-bridge", 129, "meters"], ["tower-bridge", 65, "meters"], ["trajan's-bridge", 40, "meters"], ], "Bridges", "", "buildings" ) ) results.push( makeHeight( [ ["channel-tunnel", 6.23, "meters"], ["crossrail", 5.08, "meters"], ["victoria-line", 3.24, "meters"], ], "Tunnels", "", "buildings" ), ) const dataHouses = [ { name: "Shotgun House", sides: { "Front": { height: math.unit(3.968526840209961, "meters") }, "Angled": { height: math.unit(3.968526840209961, "meters") }, "Side": { height: math.unit(3.968526840209961, "meters") }, "Top": { height: math.unit(9.709759712219238, "meters") }, } }, { name: "Two-Story House", sides: { "Front": { height: math.unit(8.241991996765137, "meters") }, "Angled": { height: math.unit(8.241991996765137, "meters") }, "Side": { height: math.unit(8.241991996765137, "meters") }, "Top": { height: math.unit(6.589994430541992, "meters") }, } }, { name: "Groverhaus", sides: { "Front": { height: math.unit(7.607376575469971, "meters") }, "Angled": { height: math.unit(7.607376575469971, "meters") }, "Side": { height: math.unit(7.607376575469971, "meters") }, "Top": { height: math.unit(15.512463569641113, "meters") }, } } ] const dataRooms = [ { name: "Kitchen", sides: { "Front": { height: math.unit(2.621997833251953, "meters") }, "Top": { height: math.unit(2.6049766540527344, "meters") } } } ] results.push({ name: "Houses", constructor: () => makeAutoVehicleGroup( dataHouses, "Houses", "buildings" ) }) results.push({ name: "Rooms", constructor: () => makeAutoVehicleGroup( dataRooms, "Rooms", "buildings" ) }) /* ***Billboards*** */ results.push(makeModel({"name": "Billboards", "kind": "buildings", "forms": [{"name": "Bulletin 14x48", "views": [{"name": "Front", "height": 4.267199993133545}]}, {"name": "Mounted Bulletin", "views": [{"name": "Front", "height": 14.325600624084473}, {"name": "Angled", "height": 14.325600624084473}, {"name": "Side", "height": 14.325600624084473}, {"name": "Back", "height": 14.325600624084473}, {"name": "Top", "height": 8.992412567138672}]}, {"name": "Bulletin 10.5x36", "views": [{"name": "Front", "height": 3.2004001140594482}]}, {"name": "Bulletin 10x40", "views": [{"name": "Front", "height": 3.0480000972747803}]}, {"name": "Poster", "views": [{"name": "Front", "height": 3.174999952316284}]}, {"name": "Junior Poster", "views": [{"name": "Front", "height": 1.8287999629974365}]}]})); /* ***Utility Poles*** */ results.push(makeModel({"name": "Utility Poles", "kind": "buildings", "forms": [{"name": "Utility Pole", "views": [{"name": "Front", "height": 10.825987815856934, "extra": 1.0017812424969987, "bottom": 0.001774919373365673}, {"name": "Angled", "height": 10.825987815856934, "extra": 1.0016084333733493, "bottom": 0.0016032758485862602}, {"name": "Side", "height": 10.825987815856934, "extra": 1.0016086734693879, "bottom": 0.001603514407218507}, {"name": "Top", "height": 0.7558963298797607, "extra": 1.008390140625, "bottom": 0.00825167519445341}]}]})); /* ***Transmission Towers*** */ results.push(makeModel({"name": "Transmission Towers", "kind": "buildings", "forms": [{"name": "Lattice Tower", "views": [{"name": "Front", "height": 46.617923736572266, "extra": 1.0011498212012875, "bottom": 0.0011471830904092298}, {"name": "Angled", "height": 46.617923736572266, "extra": 1.0010523109243699, "bottom": 0.0010501008591581864}, {"name": "Side", "height": 46.617923736572266, "extra": 1.001149673061723, "bottom": 0.0011470356297943348}, {"name": "Top", "height": 8.258213996887207, "extra": 1.0025463078703705, "bottom": 0.0025334062060477845}]}, {"name": "Concrete Tower", "views": [{"name": "Front", "height": 24.613733291625977, "extra": 1.0011611044417765, "bottom": 0.0011584143616551604}, {"name": "Angled", "height": 24.613733291625977, "extra": 1.0011987954902433, "bottom": 0.0011959281437125874}, {"name": "Side", "height": 24.613733291625977, "extra": 1.0012004801920769, "bottom": 0.0011976047904191617}, {"name": "Top", "height": 2.0, "extra": 1.0047247101394032, "bottom": 0.004680482295089333}]}]})); /* ***Fences*** */ results.push(makeModel({"name": "Fences", "kind": "buildings", "forms": [{"name": "Picket", "views": [{"name": "Front", "height": 1.198826789855957, "extra": 1.0032463354037267, "bottom": 0.003225393982374819}, {"name": "Angled", "height": 1.198826789855957, "extra": 1.0030113600426571, "bottom": 0.0029933320416477963}, {"name": "Corner", "height": 1.198826789855957, "extra": 1.0043504818571962, "bottom": 0.004312954992306321}, {"name": "Side", "height": 1.198826789855957, "extra": 1.0012004801920769, "bottom": 0.0011976047904191617}, {"name": "Top", "height": 0.12314067780971527, "extra": 1.0294348106917595, "bottom": 0.027798333333333345}]}, {"name": "Wrought Iron", "views": [{"name": "Front", "height": 0.9687931537628174, "extra": 1.0031269052863436, "bottom": 0.003107471746679822}, {"name": "Angled", "height": 0.9687931537628174, "extra": 1.0039823942771011, "bottom": 0.003950925987021264}, {"name": "Corner", "height": 0.9687931537628174, "extra": 1.0022842993630574, "bottom": 0.002273910777177546}, {"name": "Side", "height": 0.9687931537628174, "extra": 1.0009630172676205, "bottom": 0.0009611660286552252}, {"name": "Top", "height": 0.07901737093925476, "extra": 1.0543478819116272, "bottom": 0.049019653258358886}]}]})); /* ***Doors*** */ results.push(makeModel({"name": "Doors", "kind": "buildings", "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}]}]})); /* ***Times Square NYE*** */ results.push(makeModel({"name": "Times Square NYE", "kind": "buildings", "forms": [{"name": "Ball", "views": [{"name": "Front", "height": 3.4989547729492188, "mass": 5397.72705078125, "extra": 1.0016937456872217, "bottom": 0.0016880275085964648}, {"name": "Angled", "height": 3.4989547729492188, "mass": 5397.72705078125, "extra": 1.0025409836065575, "bottom": 0.00252813570380047}, {"name": "Corner", "height": 3.4989547729492188, "mass": 5397.72705078125, "extra": 1.0018165582086815, "bottom": 0.00180998233215548}, {"name": "Side", "height": 3.4989547729492188, "mass": 5397.72705078125, "extra": 1.001850383633639, "bottom": 0.001843561043274757}, {"name": "Back", "height": 3.4989547729492188, "mass": 5397.72705078125, "extra": 1.0016623910180016, "bottom": 0.0016568822456753673}, {"name": "Top", "height": 3.657600164413452, "mass": 5397.72705078125, "extra": 1.001771054685155, "bottom": 0.001764803557935817}]}, {"name": "Tower", "views": [{"name": "Front", "height": 23.458213806152344, "extra": 1.0016112545018008, "bottom": 0.0016060788980911244}, {"name": "Angled", "height": 23.458213806152344, "extra": 1.0016112545018008, "bottom": 0.0016060788980911244}, {"name": "Corner", "height": 23.458213806152344, "extra": 1.0016112545018008, "bottom": 0.0016060788980911244}, {"name": "Side", "height": 23.458213806152344, "extra": 1.0016112545018008, "bottom": 0.0016060788980911244}, {"name": "Back", "height": 23.458213806152344, "extra": 1.0016112545018008, "bottom": 0.0016060788980911244}, {"name": "Top", "height": 1.5605759620666504, "extra": 1.0015567074184117, "bottom": 0.0015518757853168342}]}, {"name": "2022", "views": [{"name": "Front", "height": 2.1339330673217773, "extra": 1.003530708012506, "bottom": 0.0035059510336938327}, {"name": "Angled", "height": 2.1339330673217773, "extra": 1.0047998012242747, "bottom": 0.004754163148077668}, {"name": "Corner", "height": 2.1339330673217773, "extra": 1.0028325, "bottom": 0.002816544276672584}, {"name": "Side", "height": 2.1339330673217773, "extra": 1.001694837935174, "bottom": 0.0016891123916577266}, {"name": "Back", "height": 2.1339330673217773, "extra": 1.003530708012506, "bottom": 0.0035059510336938327}, {"name": "Top", "height": 0.4862631559371948, "extra": 1.0157526272448099, "bottom": 0.01527149491119562}]}]})); /* ***Sheds*** */ results.push(makeModel({"name": "Sheds", "kind": "buildings", "forms": [{"name": "Small Shed", "views": [{"name": "Front", "height": 3.479300022125244, "extra": 1.005440565201383, "bottom": 0.0053820029257200174}, {"name": "Angled", "height": 3.479300022125244, "extra": 1.0054253856774116, "bottom": 0.0053671479818332875}, {"name": "Corner", "height": 3.479300022125244, "extra": 1.0053985294117647, "bottom": 0.005340863791242229}, {"name": "Side", "height": 3.479300022125244, "extra": 1.0054021608643458, "bottom": 0.005344418052256532}, {"name": "Back", "height": 3.479300022125244, "extra": 1.005440565201383, "bottom": 0.0053820029257200174}, {"name": "Top", "height": 2.638400077819824, "extra": 1.0066026410564226, "bottom": 0.006516587677725118}]}, {"name": "Medium Shed", "views": [{"name": "Front", "height": 3.9618988037109375, "extra": 1.0048322228224984, "bottom": 0.004785969084423278}, {"name": "Angled", "height": 3.9618988037109375, "extra": 1.0047982893157263, "bottom": 0.004752679849837231}, {"name": "Corner", "height": 3.9618988037109375, "extra": 1.004316382460414, "bottom": 0.004279439068938889}, {"name": "Side", "height": 3.9618988037109375, "extra": 1.0048019207683074, "bottom": 0.0047562425683709865}, {"name": "Back", "height": 3.9618988037109375, "extra": 1.0048322228224984, "bottom": 0.004785969084423278}, {"name": "Top", "height": 3.0480000972747803, "extra": 1.006093637454982, "bottom": 0.006020266808357238}]}, {"name": "Large Shed", "views": [{"name": "Front", "height": 4.26669979095459, "extra": 1.0041839246053184, "bottom": 0.004149204686160603}, {"name": "Angled", "height": 4.26669979095459, "extra": 1.0043687027707808, "bottom": 0.004330862270776434}, {"name": "Corner", "height": 4.26669979095459, "extra": 1.0035310734463276, "bottom": 0.0035063113604488078}, {"name": "Side", "height": 4.26669979095459, "extra": 1.004201680672269, "bottom": 0.004166666666666667}, {"name": "Back", "height": 4.26669979095459, "extra": 1.0041839246053184, "bottom": 0.004149204686160603}, {"name": "Top", "height": 3.857600212097168, "extra": 1.0048019207683074, "bottom": 0.0047562425683709865}]}]})); /* ***Townhouses*** */ results.push(makeModel({"name": "Townhouses", "kind": "buildings", "trace_alpha": 0.0, "forms": [{"name": "Three Story Townhouse", "views": [{"name": "Front", "height": 7.595012664794922, "volume": 697.7749681878887, "extra": 1.0033003300330032, "bottom": 0.003278688524590164}, {"name": "Angled", "height": 7.595012664794922, "volume": 697.7749681878887, "extra": 1.0035971223021583, "bottom": 0.0035714285714285713}, {"name": "Corner", "height": 7.595012664794922, "volume": 697.7749681878887, "extra": 1.0035046728971964, "bottom": 0.0034802784222737818}, {"name": "Side", "height": 7.595012664794922, "volume": 697.7749681878887, "extra": 1.0034802784222738, "bottom": 0.0034562211981566822}, {"name": "Back Corner", "height": 7.595012664794922, "volume": 697.7749681878887, "extra": 1.0035046728971964, "bottom": 0.0034802784222737818}, {"name": "Back", "height": 7.595012664794922, "volume": 697.7749681878887, "extra": 1.0033003300330032, "bottom": 0.003278688524590164}, {"name": "Top", "height": 16.01599884033203, "volume": 697.7749681878887, "extra": 1.0015126512651265, "bottom": 0.001508088840142583}]}]})); /* ***Midrise Buildings*** */ results.push(makeModel({"name": "Midrise Buildings", "kind": "buildings", "trace_alpha": 0.0, "forms": [{"name": "Medium", "views": [{"name": "Front", "height": 42.69080352783203, "volume": 26752.172098824078, "extra": 1.0005500550055006, "bottom": 0.0005494505494505495}, {"name": "Angled", "height": 42.69080352783203, "volume": 26752.172098824078, "extra": 1.0005500550055006, "bottom": 0.0005494505494505495}, {"name": "Corner", "height": 42.69080352783203, "volume": 26752.172098824078, "extra": 1.0005500550055006, "bottom": 0.0005494505494505495}, {"name": "Side", "height": 42.69080352783203, "volume": 26752.172098824078, "extra": 1.0005500550055006, "bottom": 0.0005494505494505495}, {"name": "Top", "height": 27.632001876831055, "volume": 26752.172098824078, "extra": 1.0004578754578755, "bottom": 0.0004574565416285453}, {"name": "Back", "height": 42.69080352783203, "volume": 26752.172098824078, "extra": 1.0005500550055006, "bottom": 0.0005494505494505495}, {"name": "Front", "height": 42.69080352783203, "volume": 26752.172098824078, "extra": 1.0005500550055006, "bottom": 0.0005494505494505495}]}]})); /* ***Metal Buildings*** */ results.push(makeModel({"name": "Metal Buildings", "kind": "buildings", "trace_alpha": 0.0, "forms": [{"name": "40x80 Storage", "views": [{"name": "Front", "height": 5.368299961090088, "volume": 1440.3480344680756, "extra": 1.0025252525252526, "bottom": 0.002512562814070352}, {"name": "Angled", "height": 5.368299961090088, "volume": 1440.3480344680756, "extra": 1.0036785654691163, "bottom": 0.0036516994382022436}, {"name": "Corner", "height": 5.368299961090088, "volume": 1440.3480344680756, "extra": 1.0001344581913003, "bottom": 0.00013442204301074932}, {"name": "Side", "height": 5.368299961090088, "volume": 1440.3480344680756, "extra": 1.001920614596671, "bottom": 0.001913265306122449}, {"name": "Back Corner", "height": 5.368299961090088, "volume": 1440.3480344680756, "extra": 1.0001344581913003, "bottom": 0.00013442204301074932}, {"name": "Back", "height": 5.368299961090088, "volume": 1440.3480344680756, "extra": 1.0025252525252526, "bottom": 0.002512562814070352}, {"name": "Top", "height": 12.496800422668457, "volume": 1440.3480344680756, "extra": 1.001086956521739, "bottom": 0.0010845986984815619}]}, {"name": "30x46 Garage", "views": [{"name": "Front", "height": 4.758699893951416, "volume": 543.0568615865818, "extra": 1.002183406113537, "bottom": 0.002173913043478261}, {"name": "Angled", "height": 4.758699893951416, "volume": 543.0568615865818, "extra": 1.0028782894736843, "bottom": 0.0028618152085036794}, {"name": "Corner", "height": 4.758699893951416, "volume": 543.0568615865818, "extra": 1.003793793774319, "bottom": 0.0037652248014974398}, {"name": "Side", "height": 4.758699893951416, "volume": 543.0568615865818, "extra": 1.0028973509933774, "bottom": 0.002880658436213992}, {"name": "Back Corner", "height": 4.758699893951416, "volume": 543.0568615865818, "extra": 1.003793793774319, "bottom": 0.0037652248014974398}, {"name": "Back", "height": 4.758699893951416, "volume": 543.0568615865818, "extra": 1.002183406113537, "bottom": 0.002173913043478261}, {"name": "Top", "height": 14.325603485107422, "volume": 543.0568615865818, "extra": 1.000962596259626, "bottom": 0.0009607466373867692}]}, {"name": "28x70 Shed", "views": [{"name": "Front", "height": 4.758699893951416, "volume": 684.8870681407852, "extra": 1.0028118609406953, "bottom": 0.0027961362480935434}, {"name": "Angled", "height": 4.758699893951416, "volume": 684.8870681407852, "extra": 1.0023786869647955, "bottom": 0.0023674242424242425}, {"name": "Corner", "height": 4.758699893951416, "volume": 684.8870681407852, "extra": 1.0024875621890548, "bottom": 0.0024752475247524753}, {"name": "Side", "height": 4.758699893951416, "volume": 684.8870681407852, "extra": 1.0025, "bottom": 0.0024875621890547263}, {"name": "Back Corner", "height": 4.758699893951416, "volume": 684.8870681407852, "extra": 1.0024875621890548, "bottom": 0.0024752475247524753}, {"name": "Back", "height": 4.758699893951416, "volume": 684.8870681407852, "extra": 1.0028118609406953, "bottom": 0.0027961362480935434}, {"name": "Top", "height": 21.64080047607422, "volume": 684.8870681407852, "extra": 1.0005500550055006, "bottom": 0.0005494505494505495}]}]})); /* ***INSERT HERE*** */ results.sort((b1, b2) => { e1 = b1.constructor(); e2 = b2.constructor(); return e1.name.localeCompare(e2.name) }); return results; }