Load the network modeled with Rhinoceros in Python ③

Finally, we will load the pedestrian space network in Python. Once you can do this, you will be free to switch between Rhinoceros and Python for network analysis.

Last time, I exported the pedestrian space network modeled by Rhinoceros as .txt. → Read the network modeled by Rhinoceros in Python②

In this article, we will rebuild the file into an adjacent array in Python.

Goal

  1. Draw a network with Rhinoceros
  2. Export the network drawn in Rhinoceros so that it can be read in Python
  3. Read the exported file with Python and create an adjacent array

This article addresses Section 3.

The content of this article is out of the scope of network analysis, as it is all about how to handle .txt. However, I've seen many students who can't do this and give up on network analysis, so I'd like to conclude my series of articles so that such sad things don't happen.

File reading and data reconstruction

The files created last time are three types: adjacent array (adjacentList.txt), attribute (attributeList.txt), and coordinates (coordinations.txt). Let's take a look at the contents of each and the code to get the desired data structure.

Adjacent array

adjacentList.txt is text like this:

adjacentList.txt

adjacentList.txt


0
1,3,4,
1
0,2,27,
2
1,
3
0,
4
0,5,10,
5
4,9,7,
6
7,
7
6,8,5,
8
7,
9
5,
10
4,39,64,
11
12,
12
11,14,27,
13
14,
14
13,15,12,
15
14,
16
17,
17
16,19,20,
18
19,
19
18,17,21,
20
17,59,60,
21
19,23,30,
22
23,
23
22,21,31,
24
25,26,28,
25
24,61,64,
26
24,27,60,
27
26,12,1,
28
24,29,30,
29
28,58,61,
30
21,28,60,
31
23,32,36,
32
31,
33
34,
34
33,36,47,
35
36,
36
35,34,31,
37
38,
38
37,39,46,
39
38,10,62,
40
41,
41
40,42,44,
42
41,56,62,
43
44,
44
43,46,41,
45
46,
46
45,38,44,
47
34,48,
48
47,55,58,
49
50,52,56,
50
49,
51
52,
52
51,53,49,
53
52,54,55,
54
53,
55
48,53,57,
56
49,42,57,65,
57
55,56,58,65,
58
57,48,29,
59
20,
60
20,26,30,
61
29,25,63,
62
39,42,66,
63
61,64,65,66,
64
25,10,63,
65
57,56,63,66,
66
65,63,62,

Thus, adjacentList.txt is ** Node number _i _ ** ** Number of adjacent node 1 of i, number of adjacent node 2 of i, ..., number of adjacent node * n * of i, ** (Rather, I wrote it that way). Therefore, when adjacentList.txt is read in order, the adjacent array can be reconstructed by setting the odd-numbered rows as the key and the even-numbered rows as the value, separated by commas.

Here is the code to do this:

read_adjacentList.py


adjacentList = {}
f = open("C:\\Users\\Owner\\Desktop\\adjacentList.txt", "r")
cnt = 1
for l in f:
    if cnt % 2 == 1:
        target = int(l) 
    else:
        neis = l.rstrip("\n").split(",")
        neighbors = []
        for i in range(len(neis)-1):
            neighbors.append(int(neis[i]))
        adjacentList[target] = neighbors
    cnt += 1
f.close()

print(adjacentList)
Results
{0: [1, 3, 4], 1: [0, 2, 27], 2: [1], 3: [0], 4: [0, 5, 10], 5: [4, 9, 7], 6: [7], 7: [6, 8, 5], 8: [7], 9: [5], 10: [4, 39, 64], 11: [12], 12: [11, 14, 27], 13: [14], 14: [13, 15, 12], 15: [14], 16: [17], 17: [16, 19, 20], 18: [19], 19: [18, 17, 21], 20: [17, 59, 60], 21: [19, 23, 30], 22: [23], 23: [22, 21, 31], 24: [25, 26, 28], 25: [24, 61, 64], 26: [24, 27, 60], 27: [26, 12, 1], 28: [24, 29, 30], 29: [28, 58, 61], 30: [21, 28, 60], 31: [23, 32, 36], 32: [31], 33: [34], 34: [33, 36, 47], 35: [36], 36: [35, 34, 31], 37: [38], 38: [37, 39, 46], 39: [38, 10, 62], 40: [41], 41: [40, 42, 44], 42: [41, 56, 62], 43: [44], 44: [43, 46, 41], 45: [46], 46: [45, 38, 44], 47: [34, 48], 48: [47, 55, 58], 49: [50, 52, 56], 50: [49], 51: [52], 52: [51, 53, 49], 53: [52, 54, 55], 54: [53], 55: [48, 53, 57], 56: [49, 42, 57, 65], 57: [55, 56, 58, 65], 58: [57, 48, 29], 59: [20], 60: [20, 26, 30], 61: [29, 25, 63], 62: [39, 42, 66], 63: [61, 64, 65, 66], 64: [25, 10, 63], 65: [57, 56, 63, 66], 66: [65, 63, 62]}

attribute

attributeList.txt has the following text:

adjacentList.txt

attributeList.txt


0
11.1074033249
network::crosswalk
14.8220751918
network::street
8.61537806501
network::street
_
1
11.1074033249
network::crosswalk
14.0744954367
network::street
3.95438837971
network::street
_
2
14.0744954367
network::street
_
3
14.8220751918
network::street
_
4
8.61537806501
network::street
48.2886157329
network::street
9.17188538270
network::crosswalk
_
5
48.2886157329
network::street
38.2320244198
network::street
6.97422800317
network::crosswalk
_
6
40.3569306817
network::street
_
7
40.3569306817
network::street
15.3391958646
network::street
6.97422800317
network::crosswalk
_
8
15.3391958646
network::street
_
9
38.2320244198
network::street
_
10
9.17188538270
network::crosswalk
49.1429730022
network::street
2.00298106587
network::street
_
11
14.7349112166
network::street
_
12
14.7349112166
network::street
6.00447373329
network::crosswalk
67.1804616121
network::street
_
13
14.7930810004
network::street
_
14
14.7930810004
network::street
11.5591537855
network::street
6.00447373329
network::crosswalk
_
15
11.5591537855
network::street
_
16
10.5419208643
network::street
_
17
10.5419208643
network::street
4.09407392038
network::crosswalk
39.2181710352
network::street
_
18
10.5671080962
network::street
_
19
10.5671080962
network::street
4.09407392038
network::crosswalk
38.9582224218
network::street
_
20
39.2181710352
network::street
10.3003819330
network::street
8.22728202026
network::crosswalk
_
21
38.9582224218
network::street
5.83857121526
network::street
8.74848798352
network::crosswalk
_
22
5.93624890305
network::street
_
23
5.93624890305
network::street
5.83857121526
network::street
15.4510120333
network::crosswalk
_
24
10.7772181147
network::crosswalk
4.73207293592
network::street
94.7302103075
network::street
_
25
10.7772181147
network::crosswalk
73.6539359760
network::street
7.25940897404
network::street
_
26
4.73207293592
network::street
12.1531970184
network::crosswalk
61.2110001514
network::street
_
27
12.1531970184
network::crosswalk
67.1804616121
network::street
3.95438837971
network::street
_
28
94.7302103075
network::street
9.718645919
network::crosswalk
9.38343949814
network::street
_
29
9.718645919
network::crosswalk
8.03452453354
network::street
22.7713890855
network::street
_
30
8.74848798352
network::crosswalk
9.38343949814
network::street
82.5846309517
network::street
_
31
15.4510120333
network::crosswalk
5.11688760372
network::street
6.68887011579
network::street
_
32
5.11688760372
network::street
_
33
41.4590394290
network::street
_
34
41.4590394290
network::street
9.29237197423
network::crosswalk
6.90711619475
network::street
_
35
41.8832149564
network::street
_
36
41.8832149564
network::street
9.29237197423
network::crosswalk
6.68887011579
network::street
_
37
14.8342074603
network::street
_
38
14.8342074603
network::street
9.59916809269
network::crosswalk
50.4814441178
network::street
_
39
9.59916809269
network::crosswalk
49.1429730022
network::street
82.6287670373
network::street
_
40
28.5748595052
network::street
_
41
28.5748595052
network::street
8.68658703253
network::crosswalk
51.1282514133
network::street
_
42
8.68658703253
network::crosswalk
26.5439265585
network::street
26.8233221519
network::street
_
43
22.1203390311
network::street
_
44
22.1203390311
network::street
8.20061629523
network::crosswalk
51.1282514133
network::street
_
45
21.1566509723
network::street
_
46
21.1566509723
network::street
50.4814441178
network::street
8.20061629523
network::crosswalk
_
47
6.90711619475
network::street
11.4459529225
network::street
_
48
11.4459529225
network::street
42.2319342080
network::street
16.0155420529
network::crosswalk
_
49
31.9962915471
network::street
5.66253116804
network::street
15.5603119385
network::crosswalk
_
50
31.9962915471
network::street
_
51
9.92586057028
network::street
_
52
9.92586057028
network::street
25.4074153103
network::crosswalk
5.66253116804
network::street
_
53
25.4074153103
network::crosswalk
20.1797182359
network::street
4.47301902413
network::street
_
54
20.1797182359
network::street
_
55
42.2319342080
network::street
4.47301902413
network::street
16.0158455236
network::crosswalk
_
56
15.5603119385
network::crosswalk
26.5439265585
network::street
31.6330587708
network::street
19.8124701576
network::street
_
57
16.0158455236
network::crosswalk
31.6330587708
network::street
42.1919163230
network::street
21.1866298608
network::street
_
58
42.1919163230
network::street
16.0155420529
network::crosswalk
8.03452453354
network::street
_
59
10.3003819330
network::street
_
60
8.22728202026
network::crosswalk
61.2110001514
network::street
82.5846309517
network::street
_
61
22.7713890855
network::street
73.6539359760
network::street
47.7318942765
network::street
_
62
82.6287670373
network::street
26.8233221519
network::street
13.4918015112
network::street
_
63
47.7318942765
network::street
79.7521068203
network::street
18.4889931821
network::street
34.3333101162
network::street
_
64
7.25940897404
network::street
2.00298106587
network::street
79.7521068203
network::street
_
65
21.1866298608
network::street
19.8124701576
network::street
18.4889931821
network::street
24.1678872496
network::street
_
66
24.1678872496
network::street
34.3333101162
network::street
13.4918015112
network::street
_

It's a little more confusing than adjacentList.txt, but attributeList.txt is ** Node number i _ ** ** Edge length between i and adjacent node 1 ** ** Layer name of the edge between i and adjacent node 1 ** ** Edge length between i and adjacent node 2 ** ** Layer name of the edge between i and adjacent node 2 **   ... ** Edge length between i and adjacent node_n ** ** Layer name of the edge between i and adjacent node_n_ ** ** _ (underbar) ** Is repeated. The node of interest and the edge with that node as the end point are grouped together, and the break is clearly indicated by an underscore.

Immediately after the underscore is the number of the node of interest, which is retained as a key. After that, until the underscore appears again, if you create [length, layer name] in order and use a list of them as value, a dictionary type that stores edge attributes corresponding to the adjacent array and order. Data can be obtained.

Here is the code to do this:

read_attributeList.py


attributeList = {}

f = open("C:\\Users\\Owner\\Desktop\\attributeList.txt", "r")
cnt = 1
nex = True
for l in f:
    if l == "_\n":
        attributeList[target] = edges
        nex = True
        continue
    
    if nex:
        target = int(l.rstrip("\n"))
        nex = False
        edge_attr = [] # edge_attr = [length, category]
        edges = []     # edges = [[length, category], [length, category],....]
        cnt = 1
        continue
    else:
        if cnt % 2 == 1:
            edge_attr.append(float(l.rstrip("\n"))) # length is appended
            cnt += 1
        elif cnt % 2 == 0:
            edge_attr.append(l.rstrip("\n")) # category is appended
            edges.append(edge_attr)
            edge_attr = []
            cnt += 1
f.close()

print(attributeList)
Results
{0: [[11.1074033249, 'network::crosswalk'], [14.8220751918, 'network::street'], [8.61537806501, 'network::street']], 1: [[11.1074033249, 'network::crosswalk'], [14.0744954367, 'network::street'], [3.95438837971, 'network::street']], 2: [[14.0744954367, 'network::street']], 3: [[14.8220751918, 'network::street']], 4: [[8.61537806501, 'network::street'], [48.2886157329, 'network::street'], [9.1718853827, 'network::crosswalk']], 5: [[48.2886157329, 'network::street'], [38.2320244198, 'network::street'], [6.97422800317, 'network::crosswalk']], 6: [[40.3569306817, 'network::street']], 7: [[40.3569306817, 'network::street'], [15.3391958646, 'network::street'], [6.97422800317, 'network::crosswalk']], 8: [[15.3391958646, 'network::street']], 9: [[38.2320244198, 'network::street']], 10: [[9.1718853827, 'network::crosswalk'], [49.1429730022, 'network::street'], [2.00298106587, 'network::street']], 11: [[14.7349112166, 'network::street']], 12: [[14.7349112166, 'network::street'], [6.00447373329, 'network::crosswalk'], [67.1804616121, 'network::street']], 13: [[14.7930810004, 'network::street']], 14: [[14.7930810004, 'network::street'], [11.5591537855, 'network::street'], [6.00447373329, 'network::crosswalk']], 15: [[11.5591537855, 'network::street']], 16: [[10.5419208643, 'network::street']], 17: [[10.5419208643, 'network::street'], [4.09407392038, 'network::crosswalk'], [39.2181710352, 'network::street']], 18: [[10.5671080962, 'network::street']], 19: [[10.5671080962, 'network::street'], [4.09407392038, 'network::crosswalk'], [38.9582224218, 'network::street']], 20: [[39.2181710352, 'network::street'], [10.300381933, 'network::street'], [8.22728202026, 'network::crosswalk']], 21: [[38.9582224218, 'network::street'], [5.83857121526, 'network::street'], [8.74848798352, 'network::crosswalk']], 22: [[5.93624890305, 'network::street']], 23: [[5.93624890305, 'network::street'], [5.83857121526, 'network::street'], [15.4510120333, 'network::crosswalk']], 24: [[10.7772181147, 'network::crosswalk'], [4.73207293592, 'network::street'], [94.7302103075, 'network::street']], 25: [[10.7772181147, 'network::crosswalk'], [73.653935976, 'network::street'], [7.25940897404, 'network::street']], 26: [[4.73207293592, 'network::street'], [12.1531970184, 'network::crosswalk'], [61.2110001514, 'network::street']], 27: [[12.1531970184, 'network::crosswalk'], [67.1804616121, 'network::street'], [3.95438837971, 'network::street']], 28: [[94.7302103075, 'network::street'], [9.718645919, 'network::crosswalk'], [9.38343949814, 'network::street']], 29: [[9.718645919, 'network::crosswalk'], [8.03452453354, 'network::street'], [22.7713890855, 'network::street']], 30: [[8.74848798352, 'network::crosswalk'], [9.38343949814, 'network::street'], [82.5846309517, 'network::street']], 31: [[15.4510120333, 'network::crosswalk'], [5.11688760372, 'network::street'], [6.68887011579, 'network::street']], 32: [[5.11688760372, 'network::street']], 33: [[41.459039429, 'network::street']], 34: [[41.459039429, 'network::street'], [9.29237197423, 'network::crosswalk'], [6.90711619475, 'network::street']], 35: [[41.8832149564, 'network::street']], 36: [[41.8832149564, 'network::street'], [9.29237197423, 'network::crosswalk'], [6.68887011579, 'network::street']], 37: [[14.8342074603, 'network::street']], 38: [[14.8342074603, 'network::street'], [9.59916809269, 'network::crosswalk'], [50.4814441178, 'network::street']], 39: [[9.59916809269, 'network::crosswalk'], [49.1429730022, 'network::street'], [82.6287670373, 'network::street']], 40: [[28.5748595052, 'network::street']], 41: [[28.5748595052, 'network::street'], [8.68658703253, 'network::crosswalk'], [51.1282514133, 'network::street']], 42: [[8.68658703253, 'network::crosswalk'], [26.5439265585, 'network::street'], [26.8233221519, 'network::street']], 43: [[22.1203390311, 'network::street']], 44: [[22.1203390311, 'network::street'], [8.20061629523, 'network::crosswalk'], [51.1282514133, 'network::street']], 45: [[21.1566509723, 'network::street']], 46: [[21.1566509723, 'network::street'], [50.4814441178, 'network::street'], [8.20061629523, 'network::crosswalk']], 47: [[6.90711619475, 'network::street'], [11.4459529225, 'network::street']], 48: [[11.4459529225, 'network::street'], [42.231934208, 'network::street'], [16.0155420529, 'network::crosswalk']], 49: [[31.9962915471, 'network::street'], [5.66253116804, 'network::street'], [15.5603119385, 'network::crosswalk']], 50: [[31.9962915471, 'network::street']], 51: [[9.92586057028, 'network::street']], 52: [[9.92586057028, 'network::street'], [25.4074153103, 'network::crosswalk'], [5.66253116804, 'network::street']], 53: [[25.4074153103, 'network::crosswalk'], [20.1797182359, 'network::street'], [4.47301902413, 'network::street']], 54: [[20.1797182359, 'network::street']], 55: [[42.231934208, 'network::street'], [4.47301902413, 'network::street'], [16.0158455236, 'network::crosswalk']], 56: [[15.5603119385, 'network::crosswalk'], [26.5439265585, 'network::street'], [31.6330587708, 'network::street'], [19.8124701576, 'network::street']], 57: [[16.0158455236, 'network::crosswalk'], [31.6330587708, 'network::street'], [42.191916323, 'network::street'], [21.1866298608, 'network::street']], 58: [[42.191916323, 'network::street'], [16.0155420529, 'network::crosswalk'], [8.03452453354, 'network::street']], 59: [[10.300381933, 'network::street']], 60: [[8.22728202026, 'network::crosswalk'], [61.2110001514, 'network::street'], [82.5846309517, 'network::street']], 61: [[22.7713890855, 'network::street'], [73.653935976, 'network::street'], [47.7318942765, 'network::street']], 62: [[82.6287670373, 'network::street'], [26.8233221519, 'network::street'], [13.4918015112, 'network::street']], 63: [[47.7318942765, 'network::street'], [79.7521068203, 'network::street'], [18.4889931821, 'network::street'], [34.3333101162, 'network::street']], 64: [[7.25940897404, 'network::street'], [2.00298106587, 'network::street'], [79.7521068203, 'network::street']], 65: [[21.1866298608, 'network::street'], [19.8124701576, 'network::street'], [18.4889931821, 'network::street'], [24.1678872496, 'network::street']], 66: [[24.1678872496, 'network::street'], [34.3333101162, 'network::street'], [13.4918015112, 'network::street']]}

Coordinate

coordinations.txt is text like this:

adjacentList.txt

coordinations.txt


68.9577325423
142.299807799
0.0
57.8753839319
143.045433643
0.0
59.0087545228
157.074221648
0.0
70.1454229038
157.074221648
0.0
73.7082078155
135.112477009
0.0
119.285945763
119.160667926
0.0
130.866333434
157.074221648
0.0
125.923869619
117.021083126
0.0
140.491336154
112.216934032
0.0
124.210388409
157.074221648
0.0
70.6015116756
126.482765509
0.0
-13.0847619715
157.074221648
0.0
-13.2559413252
142.340304783
0.0
-19.0899969033
157.074221648
0.0
-19.2601331305
142.282119054
0.0
-30.8187441791
142.170106276
0.0
-30.8187441791
92.7081720102
0.0
-20.2771545042
92.7917341848
0.0
-30.8187441791
88.6133189720
0.0
-20.2519732914
88.6977377056
0.0
-20.5183717202
132.009163392
0.0
-20.0123549282
49.7402521950
0.0
-30.8187441791
46.0626319844
0.0
-24.9025750130
46.5504776955
0.0
51.2355683215
127.788248237
0.0
61.5316533595
124.604058673
0.0
48.9198465834
131.914983884
0.0
53.9213659634
142.991310065
0.0
-1.88652901847
49.3544830648
0.0
6.88099405302
45.1613198567
0.0
-11.2697419494
49.4196897191
0.0
-25.7238995001
31.1213105456
0.0
-30.8187441791
30.6468672442
0.0
-9.92271249931
-14.2358586851
0.0
-10.7312752910
27.2152954193
0.0
-19.0935861117
-14.2358586851
0.0
-20.0140625572
27.6372402950
0.0
140.491336154
103.485124302
0.0
126.400392855
108.121828725
0.0
117.282188618
111.122225293
0.0
140.491336154
-11.6592682786
0.0
113.985301460
-0.984404318991
0.0
105.927624844
2.26069072088
0.0
140.491336154
42.0853777844
0.0
119.765832483
49.8160243571
0.0
140.491336154
50.5055515990
0.0
120.692989497
57.9640601630
0.0
-4.15791286976
29.3364179067
0.0
6.45922029186
25.0601670098
0.0
75.2547126670
-2.15882358227
0.0
104.884223225
-14.2358586851
0.0
67.1304719519
-14.2358586851
0.0
70.2533057857
-4.81404267612
0.0
46.8031631466
4.96489197722
0.0
40.5941211849
-14.2358586851
0.0
45.6330725865
9.28215815751
0.0
81.3054831974
12.1768481359
0.0
51.9626633982
23.9941800441
0.0
12.8254491750
39.7560411606
0.0
-30.8187441791
132.023133854
0.0
-12.2910972672
131.998004686
0.0
19.7870581607
63.9221745849
0.0
108.710277274
28.9392861996
0.0
64.2052947234
46.4477935691
0.0
68.6401653709
126.076497342
0.0
72.3273288929
29.8382953877
0.0
96.1551076071
33.8785596931
0.0

coordinations.txt is ** x_coordinates of node_i ** ** y coordinates of node i ** ** z_coordinates of node_i ** Is repeated. So, if you make a group of 3 lines at a time, you can get the coordinates of that node. This time, all the nodes are on the plane with z = 0, so we'll omit the z coordinates.

The actual code is below.

read_attributeList.py


coordinations = []
f = open("C:\\Users\\Owner\\Desktop\\coordinations.txt", "r")
cnt = 1
coordination = []
for l in f:
    if cnt % 3 == 0:
        coordinations.append(coordination)
        coordination = []
    else:
        coordination.append(float(l.rstrip("\n")))
    cnt += 1
f.close()

print(coordinations)
Results
[[68.9577325423, 142.299807799], [57.8753839319, 143.045433643], [59.0087545228, 157.074221648], [70.1454229038, 157.074221648], [73.7082078155, 135.112477009], [119.285945763, 119.160667926], [130.866333434, 157.074221648], [125.923869619, 117.021083126], [140.491336154, 112.216934032], [124.210388409, 157.074221648], [70.6015116756, 126.482765509], [-13.0847619715, 157.074221648], [-13.2559413252, 142.340304783], [-19.0899969033, 157.074221648], [-19.2601331305, 142.282119054], [-30.8187441791, 142.170106276], [-30.8187441791, 92.7081720102], [-20.2771545042, 92.7917341848], [-30.8187441791, 88.613318972], [-20.2519732914, 88.6977377056], [-20.5183717202, 132.009163392], [-20.0123549282, 49.740252195], [-30.8187441791, 46.0626319844], [-24.902575013, 46.5504776955], [51.2355683215, 127.788248237], [61.5316533595, 124.604058673], [48.9198465834, 131.914983884], [53.9213659634, 142.991310065], [-1.88652901847, 49.3544830648], [6.88099405302, 45.1613198567], [-11.2697419494, 49.4196897191], [-25.7238995001, 31.1213105456], [-30.8187441791, 30.6468672442], [-9.92271249931, -14.2358586851], [-10.731275291, 27.2152954193], [-19.0935861117, -14.2358586851], [-20.0140625572, 27.637240295], [140.491336154, 103.485124302], [126.400392855, 108.121828725], [117.282188618, 111.122225293], [140.491336154, -11.6592682786], [113.98530146, -0.984404318991], [105.927624844, 2.26069072088], [140.491336154, 42.0853777844], [119.765832483, 49.8160243571], [140.491336154, 50.505551599], [120.692989497, 57.964060163], [-4.15791286976, 29.3364179067], [6.45922029186, 25.0601670098], [75.254712667, -2.15882358227], [104.884223225, -14.2358586851], [67.1304719519, -14.2358586851], [70.2533057857, -4.81404267612], [46.8031631466, 4.96489197722], [40.5941211849, -14.2358586851], [45.6330725865, 9.28215815751], [81.3054831974, 12.1768481359], [51.9626633982, 23.9941800441], [12.825449175, 39.7560411606], [-30.8187441791, 132.023133854], [-12.2910972672, 131.998004686], [19.7870581607, 63.9221745849], [108.710277274, 28.9392861996], [64.2052947234, 46.4477935691], [68.6401653709, 126.076497342], [72.3273288929, 29.8382953877], [96.1551076071, 33.8785596931]]

Summary

I showed you how to read .txt data written about the network with Rhinoceros with Python and reconstruct it into a usable data structure. As for how to create .txt data, this is not the correct answer, and any form that is easy for you to handle is fine. And the code needed for the rebuild also depends on how the .txt data is created. Also, since it is written to .txt, it does not have to be Python as the reading language.

Some people who are new to programming may feel uneasy when they say "anything is okay". However, it can be done with a simple combination of codes, so I would like you to try it with reference to the introduced code.

Overall summary

The code related to the series of articles can be found below. → Related Code

Read the network modeled by Rhinoceros in Python ① , Load network modeled in Rhinoceros in Python②, and through this article, you can now analyze the network modeled in Rhinoceros in Python. Once you have the data on the network, there is a fun phase where you can demonstrate your originality. There are various methods and viewpoints for network analysis, and there is also the direction of performing simulations on the network. We hope that you will make full use of them and feel a part of the fun of architecture and city planning mathematics, and we will continue to strive to provide practical information.

Homepage information

The contents of my research on architecture and urban planning mathematics and tips related to the research are available on my personal website. Eventually, I would like to create an analysis tool that can be used easily, so please come and take a look. → Shota Tabata's personal homepage

Recommended Posts

Load the network modeled with Rhinoceros in Python ③
Load the network modeled with Rhinoceros in Python ②
Load the network modeled with Rhinoceros in Python ①
Load the remote Python SDK in IntelliJ
Display Python 3 in the browser with MAMP
[Python] Get the files in a folder with Python
[Automation] Extract the table in PDF with Python
[Python] Get the numbers in the graph image with OCR
Try implementing associative memory with Hopfield network in Python
Crawl the URL contained in the twitter tweet with python
Convert the image in .zip to PDF with Python
Get the result in dict format with Python psycopg2
Write letters in the card illustration with OpenCV python
Load the module with the same name in another location
Scraping with selenium in Python
Working with LibreOffice in Python
Download the file in Python
Scraping with chromedriver in python
Find the difference in Python
Neural network with Python (scikit-learn)
Debugging with pdb in Python
Working with sounds in Python
Scraping with Selenium in Python
Scraping with Tor in Python
Tweet with image in Python
Combined with permutations in Python
Neural network implementation in python
Call the API with python3.
Network programming with Python Scapy
Try scraping the data of COVID-19 in Tokyo with Python
Calculate the square root of 2 in millions of digits with python
[Homology] Count the number of holes in data with Python
Try to automate the operation of network devices with Python
Get the source of the page to load infinitely with python.
Number recognition in images with Python
Extract the xz file with python
Testing with random numbers in Python
Getting the arXiv API in Python
Neural network with OpenCV 3 and Python 3
GOTO in Python with Sublime Text 3
Working with LibreOffice in Python: import
Python in the browser: Brython's recommendation
Save the binary file in Python
Scraping with Selenium in Python (Basic)
Hit the Sesami API in Python
Measuring network one-way delay with python
CSS parsing with cssutils in Python
Get the desktop path in Python
Numer0n with items made in Python
Dynamically load json type in python
Get the weather with Python requests
Get the weather with Python requests 2
Open UTF-8 with BOM in Python
Get the script path in Python
In the python command python points to python3.8
Implement the Singleton pattern in Python
Find the Levenshtein Distance with python
Use rospy with virtualenv in Python3
Hit the Etherpad-lite API with Python
Install the Python plugin with Netbeans 8.0.2
Hit the web API in Python