|
@@ -10,7 +10,8 @@ function Color(){
|
|
|
|
|
|
export default function calcRoom(data, cad) {
|
|
|
let startTime = Date.now()
|
|
|
- console.log('开始计算房间')
|
|
|
+
|
|
|
+
|
|
|
let _roomsEdges = [];
|
|
|
let _roomsEdgesPoints = [];
|
|
|
let _roomsWalls = [];
|
|
@@ -239,6 +240,8 @@ export default function calcRoom(data, cad) {
|
|
|
|
|
|
getAllRooms(wall)
|
|
|
|
|
|
+
|
|
|
+ _roomsPoints = _roomsPoints.map(points => points.map(point => data.vertex.find(({id}) => point === id)))
|
|
|
// 将_roomsWalls所有的p1 p2转化为真实坐标
|
|
|
_roomsWalls = _roomsWalls.map(walls => {
|
|
|
return walls.map(cid => wall.find(({id}) => cid === id))
|
|
@@ -282,12 +285,11 @@ export default function calcRoom(data, cad) {
|
|
|
})
|
|
|
|
|
|
|
|
|
- console.log(_roomsWalls)
|
|
|
|
|
|
if (test_debugger) {
|
|
|
window.testCenterPoints && cad.processing.render.remove(...window.testCenterPoints)
|
|
|
window.testCenterPoints = _roomsPoints.map(points => {
|
|
|
- points = points.map(pid => data.vertex.find(({id}) => pid === id))
|
|
|
+ // points = points.map(pid => data.vertex.find(({id}) => pid === id))
|
|
|
let point = getPolygonAreaCenter(points.map(point => ({...point, y: -point.y})))
|
|
|
let color = Color();
|
|
|
let epoint = new Point({ fillColor: color, storkeColor: color, x: point.x, y: point.y, renderer: cad.processing.render })
|
|
@@ -297,7 +299,7 @@ export default function calcRoom(data, cad) {
|
|
|
|
|
|
window.testCenterPoints.forEach((point, i) => {
|
|
|
let ground = {
|
|
|
- room: data.room[i].ground.map(point => cad.processing.points.find(({id}) => id === point).ele.real),
|
|
|
+ room: data.room[i].ground.map(point => cad.processing.points.find(({id}) => id === point.id).ele.real),
|
|
|
center: point.real,
|
|
|
pointData: _roomsWalls[i],
|
|
|
lineData: _roomsPoints[i]
|