The idea is to take a point cloud of a measured tree and 'move it over' it on the simulated tree to see how similar the tree and the measurements are. In the following, the point cloud (shown in the figure below) has been artificially created and therefore fits the tree very well.
The example model can be found in the GroIMP gallery
A volume in GroIMP can be handled with most operators known from set theory, os it is also possible to create a union of two volumes by using the logical or operator: |
. This can be used to create one volume from all elements of the simulation with a simple query:
Volume v = volume(first((*F*))); [ f:F ::> {v = v | volume(f);} ]
A volume in GroIMP comes with a contains function that checks if a point is contained in the volume. This can be used in an XL query to count all points contained in the volume created above:
long inside = count((*p:Point,(v.contains(p,false)==true)*)); long total = count((*Point*)); println((float)inside/(float)total);
The output from the last line above produces the relative proportions of points inside the simulated structure.
This approach can easily be extended to bounding boxes or more abstract shapes.