瀏覽代碼

完善cad功能,添加柱子建筑

zhibin 6 年之前
父節點
當前提交
e8c4f3c211
共有 3 個文件被更改,包括 788 次插入168 次删除
  1. 38 10
      index.html
  2. 750 157
      js/CAD.js
  3. 0 1
      model/data.js

+ 38 - 10
index.html

@@ -24,6 +24,11 @@
     canvas {
       width: 600px;
       height: 600px;
+      position: absolute;
+      left: 50%;
+      top: 50%;
+      margin-left: -300px;
+      margin-top: -300px;
     }
   </style>
 </head>
@@ -43,16 +48,39 @@
     var cad = grendCAD($canvas, wallData, wallCamera)
     cad.position({x: -5, y: -4.5}, 5)
 
-    wallData[1].otherobjs = [{
-      id: "door_1",
-      points2d: [{
-        "x": 1.62,
-        "y": -4.124
-      }, {
-        x: 3.845,
-        y: -4.707333333333333
-      }]
-    }]
+    wallData[1].otherobjs = [
+      {
+        id: "door_1",
+        points2d: [{
+          "x": 1.62,
+          "y": -4.124
+        }, {
+          x: 3.845,
+          y: -4.707333333333333
+        }]
+      }
+    ]
+
+    // wallData[4].otherobjs = [
+    //   {
+    //     id: 'column_1',
+    //     points2d: [
+    //       {x: -6, y: -10.924},
+    //       {x: 0, y: -10.924},
+    //       { x: 0, y: -8 },
+    //       { x: -6, y: -8 },
+    //     ]
+    //   },
+    //   {
+    //     id: 'column_1',
+    //     points2d: [
+    //       { x: -8, y: -10.924 },
+    //       { x: -10, y: -10.924 },
+    //       { x: -10, y: -8 },
+    //       { x: -8, y: -8 },
+    //     ]
+    //   }
+    // ]
 
     cad.updateComponents()
   </script>

File diff suppressed because it is too large
+ 750 - 157
js/CAD.js


+ 0 - 1
model/data.js

@@ -147,7 +147,6 @@ var wallData = [{
     "linkedLineID": ["1_0", "1_2"]
   }, {
     "id": "1_2",
-    'selected': true,
     "roomIndex": 1,
     "points": [{
       "x": -12.83,