-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathexample.body
More file actions
48 lines (47 loc) · 1.22 KB
/
example.body
File metadata and controls
48 lines (47 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//body is array of cells:
//in json-but-with-comments format
[
//cells:
{
//template for the cell (name from the library):
"template":"knit -l1 +L1 -y1 -L1 +y1 +l1",
//^^ converted into reference into library when loading
//array of current vertex positions in model:
// (same order as vertices in the library)
// (converted to {x:, y:, z:} when loading)
"vertices":[
[0,0,0], [0,0,2], [0,2,0], [0,2,2],
[2,0,0], [2,0,2], [2,2,0], [2,2,2]
],
//array of face connections: (same length as template.faces)
"connections":[
null, //non-connected face
null,
null,
null,
{ //connected face:
"cell":1, //index of cell the face connects to
//^^ converted into reference into cell list when loading
"face":2 //index of face in cells[cell].template.faces
//NOTE:
// connections align the "first" edge.
// in other words:
// face.indices[i] <-> otherFace.indices[(L + 1 - i) % L]
// (L === length of face.indices)
},
null
]
},
{
"template":"knit -l1 +L1 -y1 -L1 +y1 +l1",
"vertices":[
[2.5,0,0], [2.5,0,2], [2.5,2,0], [2.5,2,2],
[4.5,0,0], [4.5,0,2], [4.5,2,0], [4.5,2,2]
],
"connections":[
null, null,
{ "cell":0, "face":4 },
null, null, null
]
}
]