123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506 |
- var wallData = [{
- "id": "0_0",
- "roomIndex": 0,
- "points": [{
- "x": 1.62,
- "y": 0.501
- }, {
- "x": 1.62,
- "y": -4.124
- }],
- "linkedLineID": ["0_6", "0_1"],
- "otherobjs": [
- {
- id: "window_1",
- points2d: [{
- "x": 1.62,
- "y": 0.501
- }, {
- "x": 1.62,
- "y": -1
- }]
- }
- ]
- },
- {
- "id": "0_1",
- "roomIndex": 0,
- "points": [{
- "x": 1.62,
- "y": -4.124
- }, {
- "x": 8.295,
- "y": -5.874
- }],
- "linkedLineID": ["0_0", "0_2"],
- "otherobjs1": [{
- id: "door_1",
- points2d: [{
- "x": 1.62,
- "y": -4.124
- }, {
- x: 3.845,
- y: -4.707333333333333
- }]
- }]
- },
- {
- "id": "0_2",
- "roomIndex": 0,
- "points": [{
- "x": 8.295,
- "y": -5.874
- }, {
- "x": 10.67,
- "y": -5.874
- }],
- "linkedLineID": ["0_1", "0_3"]
- },
- {
- "id": "0_3",
- "roomIndex": 0,
- "points": [{
- "x": 10.67,
- "y": -5.874
- }, {
- "x": 10.67,
- "y": -10.924
- }],
- "linkedLineID": ["0_2", "0_4"]
- },
- {
- "id": "0_4",
- "roomIndex": 0,
- "points": [{
- "x": 10.67,
- "y": -10.924
- }, {
- "x": -14.63,
- "y": -10.924
- }],
- "casements": [{
- points: [{
- "x": 5.67,
- "y": -10.924
- },
- {
- "x": 3.67,
- "y": -10.924
- }
- ]
- }],
- "linkedLineID": ["0_3", "0_5"],
- "doors": [{
- points: [{
- "x": 6.67,
- "y": -10.924
- },
- {
- "x": 9.67,
- "y": -10.924
- }
- ]
- }]
- }, {
- "id": "0_5",
- "roomIndex": 0,
- "points": [{
- "x": -14.63,
- "y": -10.924
- }, {
- "x": -14.63,
- "y": 0.501
- }],
- "linkedLineID": ["0_4", "0_6"]
- }, {
- "id": "0_6",
- "roomIndex": 0,
- "points": [{
- "x": -14.63,
- "y": 0.501
- }, {
- "x": 1.62,
- "y": 0.501
- }],
- "linkedLineID": ["0_5", "0_0"]
- }, {
- "id": "1_0",
- "roomIndex": 1,
- "points": [{
- "x": 1.17,
- "y": 0.501
- }, {
- "x": -12.83,
- "y": 0.501
- }],
- "linkedLineID": ["1_5", "1_1"]
- }, {
- "id": "1_1",
- "roomIndex": 1,
- "points": [{
- "x": -12.83,
- "y": 0.501
- }, {
- "x": -12.83,
- "y": 11.626
- }],
- "linkedLineID": ["1_0", "1_2"]
- }, {
- "id": "1_2",
- "roomIndex": 1,
- "points": [{
- "x": -12.83,
- "y": 11.626
- }, {
- "x": 3.845,
- "y": 11.626
- }],
- "linkedLineID": ["1_1", "1_3"]
- }, {
- "id": "1_3",
- "roomIndex": 1,
- "points": [{
- "x": 3.845,
- "y": 11.626
- }, {
- "x": 3.845,
- "y": 7.026
- }],
- "linkedLineID": ["1_2", "1_4"]
- }, {
- "id": "1_4",
- "roomIndex": 1,
- "points": [{
- "x": 3.845,
- "y": 7.026
- }, {
- "x": 1.17,
- "y": 7.026
- }],
- "linkedLineID": ["1_3", "1_5"]
- }, {
- "id": "1_5",
- "roomIndex": 1,
- "points": [{
- "x": 1.17,
- "y": 7.026
- }, {
- "x": 1.17,
- "y": 0.501
- }],
- "linkedLineID": ["1_4", "1_0"]
- }, {
- "id": "2_0",
- "roomIndex": 2,
- "points": [{
- "x": 3.845,
- "y": 5.301
- }, {
- "x": 3.845,
- "y": 13.476
- }],
- "linkedLineID": ["2_5", "2_1"]
- }, {
- "id": "2_1",
- "roomIndex": 2,
- "points": [{
- "x": 3.845,
- "y": 13.476
- }, {
- "x": 11.97,
- "y": 13.476
- }],
- "linkedLineID": ["2_0", "2_2"]
- }, {
- "id": "2_2",
- "roomIndex": 2,
- "points": [{
- "x": 11.97,
- "y": 13.476
- }, {
- "x": 11.97,
- "y": 7.576
- }],
- "linkedLineID": ["2_1", "2_3"]
- }, {
- "id": "2_3",
- "roomIndex": 2,
- "points": [{
- "x": 11.97,
- "y": 7.576
- }, {
- "x": 13.02,
- "y": 7.576
- }],
- "linkedLineID": ["2_2", "2_4"]
- }, {
- "id": "2_4",
- "roomIndex": 2,
- "points": [{
- "x": 13.02,
- "y": 7.576
- }, {
- "x": 13.02,
- "y": 5.301
- }],
- "linkedLineID": ["2_3", "2_5"]
- }, {
- "id": "2_5",
- "roomIndex": 2,
- "points": [{
- "x": 13.02,
- "y": 5.301
- }, {
- "x": 3.845,
- "y": 5.301
- }],
- "linkedLineID": ["2_4", "2_0"]
- }, {
- "id": "3_0",
- "roomIndex": 3,
- "points": [{
- "x": 7.92,
- "y": 5.301
- }, {
- "x": 11.67,
- "y": 5.301
- }],
- "linkedLineID": ["3_3", "3_1"]
- }, {
- "id": "3_1",
- "roomIndex": 3,
- "points": [{
- "x": 11.67,
- "y": 5.301
- }, {
- "x": 11.67,
- "y": 0.076
- }],
- "linkedLineID": ["3_0", "3_2"]
- }, {
- "id": "3_2",
- "roomIndex": 3,
- "points": [{
- "x": 11.67,
- "y": 0.076
- }, {
- "x": 7.92,
- "y": 0.076
- }],
- "linkedLineID": ["3_1", "3_3"]
- }, {
- "id": "3_3",
- "roomIndex": 3,
- "points": [{
- "x": 7.92,
- "y": 0.076
- }, {
- "x": 7.92,
- "y": 5.301
- }],
- "linkedLineID": ["3_2", "3_0"]
- }, {
- "id": "4_0",
- "roomIndex": 4,
- "points": [{
- "x": 11.67,
- "y": 5.301
- }, {
- "x": 15.67,
- "y": 5.301
- }],
- "linkedLineID": ["4_3", "4_1"]
- }, {
- "id": "4_1",
- "roomIndex": 4,
- "points": [{
- "x": 15.67,
- "y": 5.301
- }, {
- "x": 15.67,
- "y": 2.226
- }],
- "linkedLineID": ["4_0", "4_2"]
- }, {
- "id": "4_2",
- "roomIndex": 4,
- "points": [{
- "x": 15.67,
- "y": 2.226
- }, {
- "x": 11.67,
- "y": 2.226
- }],
- "linkedLineID": ["4_1", "4_3"]
- }, {
- "id": "4_3",
- "roomIndex": 4,
- "points": [{
- "x": 11.67,
- "y": 2.226
- }, {
- "x": 11.67,
- "y": 5.301
- }],
- "linkedLineID": ["4_2", "4_0"]
- }, {
- "id": "5_0",
- "roomIndex": 5,
- "points": [{
- "x": 8.295,
- "y": 0.076
- }, {
- "x": 10.67,
- "y": 0.076
- }],
- "linkedLineID": ["5_3", "5_1"]
- }, {
- "id": "5_1",
- "roomIndex": 5,
- "points": [{
- "x": 10.67,
- "y": 0.076
- }, {
- "x": 10.67,
- "y": -5.874
- }],
- "linkedLineID": ["5_0", "5_2"]
- }, {
- "id": "5_2",
- "roomIndex": 5,
- "points": [{
- "x": 10.67,
- "y": -5.874
- }, {
- "x": 8.295,
- "y": -5.874
- }],
- "linkedLineID": ["5_1", "5_3"]
- }, {
- "id": "5_3",
- "roomIndex": 5,
- "points": [{
- "x": 8.295,
- "y": -5.874
- }, {
- "x": 8.295,
- "y": 0.076
- }],
- "linkedLineID": ["5_2", "5_0"]
- }
- ]
- var wallCamera = {
- '0': [{
- x: -2.0050000000000003,
- y: -6.375515151515152
- }],
- '1': [{
- x: -4.6830303030303035,
- y: 4.374863636363637
- }],
- '2': [{
- x: 8.36280303030303,
- y: 9.195318181818182
- }],
- '3': [{
- x: 9.969621212121211,
- y: 3.188878787878788
- }],
- '4': [{
- x: 13.374545454545455,
- y: 3.762742424242424
- }],
- '5': [{
- x: 9.319242424242423,
- y: -2.702787878787879
- }]
- }
- var floorJson = {
- "vertex": [{
- "x": -1.198,
- "y": 4.705
- }, {
- "x": 8.877,
- "y": 6.05
- }, {
- "x": 9.877,
- "y": -5.295
- }, {
- "x": -1.198,
- "y": -5.295
- }, {
- "x": -1.198,
- "y": -4.745
- }, {
- "x": -9.973,
- "y": -4.745
- }, {
- "x": -9.973,
- "y": 5.305
- }, {
- "x": -1.198,
- "y": 5.305
- }],
- "wall": [{
- "p1": 0,
- "p2": 1,
- "room": 1
- }, {
- "p1": 1,
- "p2": 2,
- "room": 1
- }, {
- "p1": 2,
- "p2": 3,
- "room": 1
- }, {
- "p1": 4,
- "p2": 5,
- "room": 2
- }, {
- "p1": 5,
- "p2": 6,
- "room": 2
- }, {
- "p1": 6,
- "p2": 7,
- "room": 2
- }
- //, {"p1":3,"p2":7}
- , {
- "p1": 3,
- "p2": 0,
- "room": 1
- }, {
- "p1": 7,
- "p2": 4,
- "room": 2
- }
- ]
- }
- var test = floorJson.wall.map((item, index) => {
- return {
- "id": item.room + "_" + index,
- "roomIndex": item.room,
- "points": [floorJson.vertex[item.p1], floorJson.vertex[item.p2]],
- "linkedLineID": ["0_6", "0_1"]
- }
- })
- test.forEach(item => {
- var prev = test.find(item1 => {
- return item.points[0] === item1.points[1]
- })
- var last = test.find(item1 => {
- return item.points[1] === item1.points[0]
- })
- item.linkedLineID = [prev.id, last.id]
- })
- // wallData = test
- // wallCamera = {}
|