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