index.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <title>Page Title</title>
  7. <meta name="viewport" content="width=device-width, initial-scale=1" />
  8. <style>
  9. * {
  10. margin: 0;
  11. padding: 0;
  12. border: 0;
  13. }
  14. html,
  15. body {
  16. width: 100%;
  17. height: 100%;
  18. overflow: hidden;
  19. background-color: rgba(0, 0, 0, 0.5)
  20. }
  21. canvas {
  22. width: 600px;
  23. height: 600px;
  24. position: absolute;
  25. left: 50%;
  26. top: 50%;
  27. margin-left: -300px;
  28. margin-top: -300px;
  29. }
  30. </style>
  31. </head>
  32. <body>
  33. <div id="asdas">
  34. <canvas id="myCanvas" width="600" height="600"></canvas>
  35. </div>
  36. <!-- <canvas id="myCanvas" width="1400" height="1400" >
  37. Your browser does not support the HTML5 canvas tag.
  38. </canvas> -->
  39. <script src="js/CAD.js"></script>
  40. <script src="model/data.js"></script>
  41. <script>
  42. var $canvas = document.getElementById("myCanvas")
  43. var cad = grendCAD($canvas, wallData, wallCamera)
  44. cad.position({x: -5, y: -4.5}, 5)
  45. wallData[1].otherobjs = [
  46. {
  47. id: "door_1",
  48. points2d: [{
  49. "x": 1.62,
  50. "y": -4.124
  51. }, {
  52. x: 3.845,
  53. y: -4.707333333333333
  54. }]
  55. }
  56. ]
  57. // wallData[4].otherobjs = [
  58. // {
  59. // id: 'column_1',
  60. // points2d: [
  61. // {x: -6, y: -10.924},
  62. // {x: 0, y: -10.924},
  63. // { x: 0, y: -8 },
  64. // { x: -6, y: -8 },
  65. // ]
  66. // },
  67. // {
  68. // id: 'column_1',
  69. // points2d: [
  70. // { x: -8, y: -10.924 },
  71. // { x: -10, y: -10.924 },
  72. // { x: -10, y: -8 },
  73. // { x: -8, y: -8 },
  74. // ]
  75. // }
  76. // ]
  77. cad.updateComponents()
  78. </script>
  79. </body>
  80. </html>