This is an old revision of the document!
Table of Contents
Using a point cloud to validate a simulation
Idea
The idea is to use a point cloud of a measured tree and “move it over” the simulate tree to see how similar the tree and the measurements are. In the following the point cloud (shown in the figure below) ware artificially created and fits the tree therefore very well.
The example model can be found in the GroIMP gallery
Steps
- Import the point cloud as a graph into the growth model. (see here)
- Grow the model to the right size (e.g. the age of the measured plant)
- Building the mathematical volume of the simulated plant
- Querying the points of the point cloud to estimate the coverage of the model
Generating a volume
A volumes in GroIMP can be handled using most operators known from set theory, therefore it is also possible to create a union out two volumes by using the logical or operator |
. This can be used to create one volume out of all elements from the simulation with a simple query:
Volume v = volume(first((*F*))); [ f:F ::> {v = v | volume(f);} ]
Counting the points
A volume in GroIMP comes with contains function, that checks if a point is included in the volume. This can be used in a XL query to count all point included in the volume created above:
long inside = count((*p:Point,(v.contains(p,false)==true)*)); long total = count((*Point*)); println((float)inside/(float)total);
Therefore the output from the last line above creates the relative portion of points inside of the simulated structure.
This approach can easily be extended to be used with bounding boxes or more abstract shapes.