Twisted boxes from file

Hi everyone!
Could you guys help me with my problem, please.
For instance, there is *txt file with follow structure

*Node
1, 0., 25., 0.
2, 0., 0., 0.
3, -25., 0., 0.
4, 0., 0., -25.
5, 0., -25., 0.
6, 0., 0., 25.
7, 25., 0., 0.
8, 0., 12.5, 0.
9, -17.6776695, 17.6776695, 0.
10, 0., 17.6776695, -17.6776695
11, -12.5, 0., 0.
12, 0., 0., -12.5
13, -17.6776695, 0., -17.6776695
14, 0., -12.5, 0.
15, 0., 0., 12.5
16, -17.6776695, -17.6776695, 0.
17, 0., -17.6776695, 17.6776695
18, -17.6776695, 0., 17.6776695
19, 0., -17.6776695, -17.6776695
20, 12.5, 0., 0.
21, 17.6776695, 0., -17.6776695
22, 17.6776695, 17.6776695, 0.
23, 17.6776695, 0., 17.6776695
24, 17.6776695, -17.6776695, 0.
25, 0., 17.6776695, 17.6776695
26, -10.0592232, 10.0592232, 0.
27, -15.3093109, 15.3093109, -12.5
28, 0., 10.0592232, -10.0592232
29, -10.0592232, 0., -10.0592232
30, -10.0592232, -10.0592232, 0.
31, 0., -10.0592232, 10.0592232
32, -10.0592232, 0., 10.0592232
33, -15.3093109, -15.3093109, 12.5
34, -15.3093109, -15.3093109, -12.5
35, 0., -10.0592232, -10.0592232
36, 10.0592232, 0., -10.0592232
37, 10.0592232, 10.0592232, 0.
38, 15.30931, 15.3093109, -12.5
39, 10.0592232, 0., 10.0592232
40, 15.30931, -15.3093109, 12.5
41, 10.0592232, -10.0592232, 0.
42, 15.30931, -15.3093109, -12.5
43, 0., 10.0592232, 10.0592232
44, -15.3093109, 15.3093109, 12.5
45, 15.30931, 15.3093109, 12.5
46, -8.85693932, 8.85693932, -8.15461159
47, -8.85693932, -8.85693932, 8.15461159
48, -8.85693932, -8.85693932, -8.15461159
49, 8.85693932, 8.85693932, -8.15461159
50, 8.85693932, -8.85693932, 8.15461159
51, 8.85693932, -8.85693932, -8.15461159
52, -8.85693932, 8.85693932, 8.15461159
53, 8.85693932, 8.85693932, 8.15461159
*Box
1, 28, 10, 27, 46, 8, 1, 9, 26
2, 29, 12, 28, 46, 11, 2, 8, 26
3, 27, 13, 29, 46, 9, 3, 11, 26
4, 29, 13, 27, 46, 12, 4, 10, 28
5, 32, 15, 31, 47, 11, 2, 14, 30
6, 31, 17, 33, 47, 14, 5, 16, 30
7, 33, 18, 32, 47, 16, 3, 11, 30
8, 32, 18, 33, 47, 15, 6, 17, 31
9, 35, 19, 34, 48, 12, 4, 13, 29
10, 30, 14, 35, 48, 11, 2, 12, 29
11, 34, 16, 30, 48, 13, 3, 11, 29
12, 30, 16, 34, 48, 14, 5, 19, 35
13, 37, 8, 28, 49, 20, 2, 12, 36
14, 28, 10, 38, 49, 12, 4, 21, 36
15, 38, 22, 37, 49, 21, 7, 20, 36
16, 37, 22, 38, 49, 8, 1, 10, 28
17, 31, 17, 40, 50, 15, 6, 23, 39
18, 41, 14, 31, 50, 20, 2, 15, 39
19, 40, 24, 41, 50, 23, 7, 20, 39
20, 41, 24, 40, 50, 14, 5, 17, 31
21, 41, 14, 35, 51, 24, 5, 19, 42
22, 35, 12, 36, 51, 19, 4, 21, 42
23, 36, 20, 41, 51, 21, 7, 24, 42
24, 41, 20, 36, 51, 14, 2, 12, 35
25, 44, 25, 43, 52, 9, 1, 8, 26
26, 43, 15, 32, 52, 8, 2, 11, 26
27, 32, 18, 44, 52, 11, 3, 9, 26
28, 44, 18, 32, 52, 25, 6, 15, 43
29, 45, 25, 43, 53, 23, 6, 15, 39
30, 43, 8, 37, 53, 15, 2, 20, 39
31, 37, 22, 45, 53, 20, 7, 23, 39
32, 45, 22, 37, 53, 25, 1, 8, 43

where

*Node
1, 0., 25., 0.
2, 0., 0., 0.
3, -25., 0., 0.

First number is the number of the node. next is xyz coordinate


then we have
*Box
1, 28, 10, 27, 46, 8, 1, 9, 26
2, 29, 12, 28, 46, 11, 2, 8, 26
3, 27, 13, 29, 46, 9, 3, 11, 26

where first number is the number of the box and next 8 numbers is the numbers of nodes from above.

Is it possible to create a script which can convert these numbers in real Twisted boxes

Need to use script or GH?

which detection i should dig?



TwistedBoxes.gh (12.9 KB)

3 Likes

Many thanks! that’s exactly what i was looking. :wink: :star_struck: