xushiting vor 4 Jahren
Ursprung
Commit
9583c56a3c
1 geänderte Dateien mit 11 neuen und 8 gelöschten Zeilen
  1. 11 8
      src/CAD/core/additional/calcRoom.js

+ 11 - 8
src/CAD/core/additional/calcRoom.js

@@ -32,14 +32,14 @@ export default function calcRoom(data, cad) {
         exceptWalls.push(k);
       }
       let wall1 = wallIds[i];
-      let startPointId = wall1.p1;
-      let endPointId = wall1.p2;
+      let startPointId = wall1.p1.id;
+      let endPointId = wall1.p2.id;
       ringPoints.push(endPointId);
       ringWalls.push(wall1.id);
       let currentPointId = null;
       for (let j = i + 1; j < wallIds.length; ++j) {
         let wall2 = wallIds[j];
-        if (startPointId == wall2.p1 || startPointId == wall2.p2) {
+        if (startPointId == wall2.p1.id || startPointId == wall2.p2.id) {
           //相连
           let _ringPoints = JSON.parse(JSON.stringify(ringPoints));
           let _ringWalls = JSON.parse(JSON.stringify(ringWalls));
@@ -49,11 +49,11 @@ export default function calcRoom(data, cad) {
           _ringPoints.push(startPointId);
           _ringWalls.push(wall2.id);
           _exceptWalls.push(j);
-          if (_startPointId == wall2.p1) {
-            currentPointId = wall2.p2;
+          if (_startPointId == wall2.p1.id) {
+            currentPointId = wall2.p2.id;
           }
           else {
-            currentPointId = wall2.p1;
+            currentPointId = wall2.p1.id;
           }
           _exceptPoints.push(_startPointId);
           addLineToRoom(wallIds, endPointId, _ringPoints, _ringWalls, _exceptWalls, _exceptPoints, currentPointId);
@@ -72,8 +72,8 @@ export default function calcRoom(data, cad) {
         continue;
       }
       let wall = wallIds[i];
-      let startPointId = wall.p1;
-      let endPointId = wall.p2;
+      let startPointId = wall.p1.id;
+      let endPointId = wall.p2.id;
       if (currentPointId == startPointId || currentPointId == endPointId) {
         let _roomPoints = JSON.parse(JSON.stringify(roomPoints));
         let _roomWalls = JSON.parse(JSON.stringify(roomWalls));
@@ -95,6 +95,9 @@ export default function calcRoom(data, cad) {
           _roomsWalls.push(_roomWalls);
         }
         else {
+			//if(_roomWalls[2] == 45&&_roomWalls[26] == 13){
+				//console.log('test')
+			//}
           addLineToRoom(wallIds, begin, _roomPoints, _roomWalls, _exceptWalls, _exceptPoints, _currentPointId)
         }
       }