less copy protection, more size visualization
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

51 lignes
3.5 KiB

  1. function makeFurniture() {
  2. results = [];
  3. const dataSofas = [
  4. {
  5. name: "Two Seat",
  6. sides: {
  7. "Front": { height: math.unit(30, "inches") },
  8. "Side": { height: math.unit(30, "inches") },
  9. "Top": { height: math.unit(30.5, "inches") },
  10. }
  11. },
  12. ]
  13. results.push({
  14. name: "Sofas",
  15. constructor: () => makeAutoVehicleGroup(dataSofas,
  16. "Sofas",
  17. "furniture")
  18. });
  19. results.push(
  20. makeHeight(
  21. [
  22. ["twin", 75, "inches"],
  23. ["twin-xl", 80, "inches"],
  24. ["twin-xl", 80, "inches"],
  25. ["full", 75, "inches"],
  26. ["queen", 80, "inches"],
  27. ["king", 80, "inches"],
  28. ["california-king", 84, "inches"],
  29. ],
  30. "Mattresses",
  31. "",
  32. "furniture"
  33. )
  34. )
  35. /* ***Tables*** */ results.push(makeModel({"name": "Tables", "kind": "furniture", "forms": [{"name": "Picnic Table", "views": [{"name": "Front", "height": 0.7535526156425476, "extra": 1.0058282909930716, "bottom": 0.005761135840809958}, {"name": "Angled", "height": 0.7535526156425476, "extra": 1.0092250922509225, "bottom": 0.009057971014492754}, {"name": "Side", "height": 0.7535526156425476, "extra": 1.0073926822157433, "bottom": 0.007284971260779868}, {"name": "Top", "height": 1.8287999629974365, "extra": 1.003046218487395, "bottom": 0.003027771977448346}, {"name": "Bottom", "height": 1.8287999629974365, "extra": 1.003046218487395, "bottom": 0.003027771977448346}]}, {"name": "Small Folding Table", "views": [{"name": "Front", "height": 0.8018024563789368, "extra": 1.0033813096412243, "bottom": 0.0033585967302146766}, {"name": "Angled", "height": 0.8018024563789368, "extra": 1.0040256234915528, "bottom": 0.003993471069651093}, {"name": "Side", "height": 0.8018024563789368, "extra": 1.003167808219178, "bottom": 0.0031478645567465553}, {"name": "Top", "height": 0.6096000075340271, "extra": 1.004279089376054, "bottom": 0.004242778915687869}, {"name": "Bottom", "height": 0.6096000075340271, "extra": 1.004279089376054, "bottom": 0.004242778915687869}]}]}));
  36. /* ***Stools*** */ results.push(makeModel({"name": "Stools", "kind": "furniture", "forms": [{"name": "Tall Barstool", "views": [{"name": "Front", "height": 0.8789909482002258, "extra": 1.0012079744564009, "bottom": 0.0012050630855495337}, {"name": "Slightly Angled", "height": 0.8789909482002258, "extra": 1.0012192880930424, "bottom": 0.001216321999180584}, {"name": "Angled", "height": 0.8789909482002258, "extra": 1.0012192880930424, "bottom": 0.001216321999180584}, {"name": "Top", "height": 0.4042597711086273, "extra": 1.0013041924250352, "bottom": 0.0013007994394842364}]}, {"name": "Counter Stool", "views": [{"name": "Front", "height": 0.6924768090248108, "extra": 1.0008852513128281, "bottom": 0.000883686743129245}, {"name": "Slightly Angled", "height": 0.6924768090248108, "extra": 1.0010763629214054, "bottom": 0.001074050784525029}, {"name": "Angled", "height": 0.6924768090248108, "extra": 1.0011664973602852, "bottom": 0.001163782262410989}, {"name": "Top", "height": 0.3737407326698303, "extra": 1.0005802727702944, "bottom": 0.0005796001179620889}]}]}));
  37. /* ***INSERT HERE*** */
  38. results.sort((b1, b2) => {
  39. e1 = b1.constructor();
  40. e2 = b2.constructor();
  41. return -math.subtract(e1.views[e1.defaultView].height, e2.views[e2.defaultView].height).value;
  42. });
  43. return results;
  44. }