less copy protection, more size visualization
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

358 lines
14 KiB

  1. function makeBuilding(name, height, image) {
  2. views = {
  3. building: {
  4. attributes: {
  5. height: {
  6. name: "Height",
  7. power: 1,
  8. type: "length",
  9. base: height
  10. }
  11. },
  12. image: image,
  13. name: "building"
  14. },
  15. };
  16. return makeEntity({ name: name }, views);
  17. }
  18. function makeSkyscraper(name, image) {
  19. views = {
  20. building: {
  21. attributes: {
  22. height: {
  23. name: "Height",
  24. power: 1,
  25. type: "length",
  26. base: math.unit(1, "meter")
  27. }
  28. },
  29. image: image,
  30. name: "building"
  31. },
  32. };
  33. const sizes = [];
  34. sizes.push({
  35. name: "Short",
  36. height: math.unit(15, "stories")
  37. });
  38. sizes.push({
  39. name: "Medium",
  40. height: math.unit(40, "stories"),
  41. default: true
  42. });
  43. sizes.push({
  44. name: "Supertall",
  45. height: math.unit(350, "meters")
  46. });
  47. sizes.push({
  48. name: "Megatall",
  49. height: math.unit(650, "meters")
  50. });
  51. const entity = makeEntity({ name: name }, views, sizes);
  52. return entity;
  53. }
  54. function makeBuildings() {
  55. const results = [];
  56. results.push({
  57. name: "Two-Story Home",
  58. constructor: () => makeBuilding(
  59. "Two-Story Home",
  60. math.unit(25, "feet"),
  61. { source: "./media/buildings/house.svg" }
  62. )
  63. });
  64. results.push({
  65. name: "Mobile Home",
  66. constructor: () => makeBuilding(
  67. "Mobile Home",
  68. math.unit(10, "feet"),
  69. { source: "./media/buildings/mobile-home.svg" }
  70. )
  71. });
  72. results.push({
  73. name: "Mailbox",
  74. constructor: () => makeBuilding(
  75. "Mailbox",
  76. math.unit(5.1, "feet"),
  77. { source: "./media/buildings/mailbox.svg" }
  78. )
  79. });
  80. results.push({
  81. name: "Bus Stop",
  82. constructor: () => makeBuilding(
  83. "Bus Stop",
  84. math.unit(8, "feet"),
  85. { source: "./media/buildings/bus-stop.svg" }
  86. )
  87. });
  88. results.push(
  89. {
  90. name: "Wide Skyscraper",
  91. constructor: () => makeSkyscraper(
  92. "Wide Skyscraper",
  93. { source: "./media/buildings/skyscrapers/wide.svg" }
  94. )
  95. }
  96. );
  97. results.push(
  98. {
  99. name: "Skyscraper",
  100. constructor: () => makeSkyscraper(
  101. "Skyscraper",
  102. { source: "./media/buildings/skyscrapers/medium.svg" }
  103. )
  104. }
  105. );
  106. results.push(
  107. {
  108. name: "Slender Skyscraper",
  109. constructor: () => makeSkyscraper(
  110. "Slender Skyscraper",
  111. { source: "./media/buildings/skyscrapers/slender.svg" }
  112. )
  113. }
  114. );
  115. results.push(
  116. {
  117. name: "Narrow Skyscraper",
  118. constructor: () => makeSkyscraper(
  119. "Narrow Skyscraper",
  120. { source: "./media/buildings/skyscrapers/narrow.svg" }
  121. )
  122. }
  123. );
  124. results.push(
  125. makeHeight(
  126. [
  127. ["four-lane-highway", 27.432, "meters"],
  128. ["sidewalk", 24, "feet"]
  129. ],
  130. "Roads",
  131. "",
  132. "buildings"
  133. )
  134. )
  135. results.push(
  136. makeHeight(
  137. [
  138. ["compact-parking-space", 16 + 4/12, "feet"],
  139. ["crosswalk", 26.25, "feet"],
  140. ["line", 26.25, "feet"],
  141. ["broken-line", 50, "feet"],
  142. ["dotted-line", 39, "feet"],
  143. ],
  144. "Road Markings",
  145. "",
  146. "buildings"
  147. )
  148. )
  149. results.push(
  150. makeHeight(
  151. [
  152. ["residential", 12, "feet"],
  153. ["freeway", 50, "feet"]
  154. ],
  155. "Street Lamps",
  156. "",
  157. "buildings"
  158. )
  159. )
  160. results.push(
  161. makeHeight(
  162. [
  163. ["badminton-court", 13.4, "meters"],
  164. ["basketball-court", 28, "meters"],
  165. ["bocce-court", 27.5, "meters"],
  166. ["bowling-lane", 23.8, "meters"],
  167. ["football-field", 160, "feet"],
  168. ["ice-hockey", 30, "meters"],
  169. ["netball-court", 30.5, "meters"],
  170. ["olympic-swimming-pool", 25, "meters"],
  171. ["snooker-table", 3.7, "meters"],
  172. ["squash-court", 9.8, "meters"],
  173. ["table-tennis", 2.79, "meters"],
  174. ["tennis-court", 23.8, "meters"],
  175. ["volleyball-court", 21.6, "meters"],
  176. ],
  177. "Sports Fields",
  178. "",
  179. "buildings"
  180. )
  181. )
  182. results.push(
  183. makeHeight(
  184. [
  185. ["small", 51.8, "meters"],
  186. ["medium", 108.1, "meters"],
  187. ["large", 141.7, "meters"],
  188. ["extra-large", 190.2, "meters"]
  189. ],
  190. "Wind Turbines",
  191. "",
  192. "buildings"
  193. )
  194. )
  195. results.push({
  196. name: "Gas Station",
  197. constructor: () => makeBuilding(
  198. "Gas Station",
  199. math.unit(6.78, "meters"),
  200. { source: "./media/buildings/gas-station.svg" }
  201. )
  202. });
  203. results.push({
  204. name: "Staircase",
  205. constructor: () => makeBuilding(
  206. "Staircase",
  207. math.unit(12.956, "feet"),
  208. { source: "./media/buildings/staircase.svg" }
  209. )
  210. });
  211. results.push(
  212. makeHeight(
  213. [
  214. ["residential", 83, "inches"],
  215. ["garage-door", 7.5, "feet"],
  216. ["double-garage-door", 7.5, "feet"],
  217. ["small-private-hangar", 10.5, "feet"],
  218. ],
  219. "Doorways",
  220. "",
  221. "buildings"
  222. )
  223. )
  224. results.push(
  225. makeHeight(
  226. [
  227. ["akashi-kaikyō-bridge", 283, "meters"],
  228. ["chaotianmen-bridge", 160, "meters"],
  229. ["forth-bridge", 100, "meters"],
  230. ["golden-gate-bridge", 230, "meters"],
  231. ["millau-viaduct", 421, "meters"],
  232. ["rialto-bridge", 17, "meters"],
  233. ["russky-bridge", 306, "meters"],
  234. ["sydney-harbour-bridge", 129, "meters"],
  235. ["tower-bridge", 65, "meters"],
  236. ["trajan's-bridge", 40, "meters"],
  237. ],
  238. "Bridges",
  239. "",
  240. "buildings"
  241. )
  242. )
  243. results.push(
  244. makeHeight(
  245. [
  246. ["channel-tunnel", 6.23, "meters"],
  247. ["crossrail", 5.08, "meters"],
  248. ["victoria-line", 3.24, "meters"],
  249. ],
  250. "Tunnels",
  251. "",
  252. "buildings"
  253. ),
  254. )
  255. const dataHouses = [
  256. {
  257. name: "Shotgun House",
  258. sides: {
  259. "Front": { height: math.unit(3.968526840209961, "meters") },
  260. "Angled": { height: math.unit(3.968526840209961, "meters") },
  261. "Side": { height: math.unit(3.968526840209961, "meters") },
  262. "Top": { height: math.unit(9.709759712219238, "meters") },
  263. }
  264. },
  265. {
  266. name: "Two-Story House",
  267. sides: {
  268. "Front": { height: math.unit(8.241991996765137, "meters") },
  269. "Angled": { height: math.unit(8.241991996765137, "meters") },
  270. "Side": { height: math.unit(8.241991996765137, "meters") },
  271. "Top": { height: math.unit(6.589994430541992, "meters") },
  272. }
  273. },
  274. {
  275. name: "Groverhaus",
  276. sides: {
  277. "Front": { height: math.unit(7.607376575469971, "meters") },
  278. "Angled": { height: math.unit(7.607376575469971, "meters") },
  279. "Side": { height: math.unit(7.607376575469971, "meters") },
  280. "Top": { height: math.unit(15.512463569641113, "meters") },
  281. }
  282. }
  283. ]
  284. const dataRooms = [
  285. {
  286. name: "Kitchen",
  287. sides: {
  288. "Front": { height: math.unit(2.621997833251953, "meters") },
  289. "Top": { height: math.unit(2.6049766540527344, "meters") }
  290. }
  291. }
  292. ]
  293. results.push({
  294. name: "Houses",
  295. constructor: () => makeAutoVehicleGroup(
  296. dataHouses,
  297. "Houses",
  298. "buildings"
  299. )
  300. })
  301. results.push({
  302. name: "Rooms",
  303. constructor: () => makeAutoVehicleGroup(
  304. dataRooms,
  305. "Rooms",
  306. "buildings"
  307. )
  308. })
  309. /* ***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}]}]}));
  310. /* ***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}]}]}));
  311. /* ***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}]}]}));
  312. /* ***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}]}]}));
  313. /* ***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}]}]}));
  314. /* ***INSERT HERE*** */
  315. results.sort((b1, b2) => {
  316. e1 = b1.constructor();
  317. e2 = b2.constructor();
  318. return e1.name.localeCompare(e2.name)
  319. });
  320. return results;
  321. }