You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hash tree (or Merkle tree) is a tree data structure in which every leaf node is labelled with the hash of a data block and every non-leaf node is labelled with the cryptographic hash of the labels of its child nodes.
6
+
Hash trees are useful because they allow efficient and secure verification of the contents of large data structures. It is widly used in modern distributed version control systems like Git as well as peer-to-peer systems like Blockchain.
7
+
COMPAS provides a simple implementation of a hash tree that can be used for detecting and locating changes in a complex data structure. In context of AEC, this feature can also be useful for many real-world applications,
8
+
such as detecting changes in a complicated Building Information Model, tracking minor deformation in structural assessments, or even detecting robot joint movements in a digital fabracation process, and many more.
9
+
10
+
Hash Tree From Dict
11
+
===================
12
+
13
+
A COMPAS hash tree can be created from any raw python dictionary using the `HashTree.from_dict` method.
The structure of the hash tree and crypo hash on each node can be visualised using the `print` function.
20
+
21
+
>>> print(tree)
22
+
<Tree with 6 nodes>
23
+
└── ROOT @ b2e1c
24
+
├── .a:1 @ 4d9a8
25
+
├── .b:2 @ 82b86
26
+
└── .c @ 664a3
27
+
├── .d:3 @ 76d82
28
+
└── .e:4 @ ebe84
29
+
30
+
Once the original data is modified, a new hash tree can be created from the modified data and the changes can be detected by comparing the two hash trees.
A COMPAS hash tree can also be created from any classes that inherit from the base `Data` class in COMPAS, such as `Mesh`, `Graph`, `Shape`, `Geometry`, etc.
52
+
This is done by hashing the serilised data of the object.
Copy file name to clipboardExpand all lines: docs/userguide/basics.visualisation.rst
+28-22Lines changed: 28 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,28 +64,6 @@ For example, meshes can have different colors for the vertices, the edges, and t
64
64
And the colors of vertices, edges, and faces can be specified individually, per element.
65
65
See the section about mesh visualisation for more information.
66
66
67
-
Object Transformation
68
-
=====================
69
-
70
-
All scene objects have a transformation matrix that can be used to transform the object in the visualisation,
71
-
independently of the geometry of the underlying data object.
72
-
The default transformation matrix is the identity matrix, which means that the visualised geometry is the same as the geometry represented by the data.
For more information about working with transformations in COMPAS, see :doc:`basics.geometry.transformations`.
88
-
89
67
Scene Hierarchy
90
68
===============
91
69
@@ -115,6 +93,34 @@ To use a different scene object as the parent, the parent attribute of the scene
115
93
>>> boxobj.parent
116
94
PointObject
117
95
96
+
Object Frame And Transformation
97
+
=====================
98
+
99
+
Every scene objects can have a reference "frame" that represents its local coordinate system relative to the frame of its hierarchical parent.
100
+
In addition, an object can also have a local "transformation" which orientates this object from its frame.
101
+
The final transformation of an object relative to the world coordinate system is the aggregated multiplication of all its hierarchical ancesters' frames,
102
+
together with its own local frame and transformation. This prorperty can be accessed through the read-only attribute "worldtransformation".
0 commit comments