Axis-aligned bounding box parameters (meaning)

Asked by Marcus Moravia

Hello, I wonder which means the parameters '0', '1', '2' (script excerpt: 'aabb[1][2]-aabb[0][2]') in the horse surface script (https://github.com/yade/trunk/blob/master/examples/gts-horse/gts-horse.py). I am trying to understand how translate surfaces.

Thanks a lot.

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jérôme Duriez
Solved:
Last query:
Last reply:
Revision history for this message
Best Jérôme Duriez (jduriez) said :
#1

Hello,

Indeed the doc of the corresponding function does not really help here [1]...
There is more information in the corresponding source code, namely in a comment appearing l. 11-13 of [2] (I do not blame you you did not find it..). It turns out this aabb() function is pretty much like aabbExtrema() function which is better documented [3]

In the end your aabb is a "tuple" ie (roughly) a list of 2 elements, each of them being a vector:
- aabb[0] (1st element of the tuple) is a vector describing the lowest corner of the predicate (xMin,yMin,zMin) for all (x,y,z) in the predicate
- aabb[1] (2d element of the tuple) is another vector describing the upper corner of the predicate (xMax, yMax,zMax) for all (x,y,z) in the predicate

Such that aabb[1][2]-aabb[0][2] is equal to zMax - zMin : the last coordinate of a vector between the 2 corners.

Jerome

[1] https://yade-dem.org/doc/yade.pack.html?highlight=aabb#yade._packPredicates.inGtsSurface.aabb
[2] https://github.com/yade/trunk/blob/68092b127a9cc6a00be3ba7f4fc5dfb60530f0a7/py/pack/_packPredicates.cpp
[3] https://yade-dem.org/doc/yade.utils.html?highlight=aabbextrema#yade._utils.aabbExtrema

Revision history for this message
Marcus Moravia (mgmoravia) said :
#2

Thanks Jérôme Duriez, that solved my question.

Revision history for this message
Marcus Moravia (mgmoravia) said :
#3

Hi Jérôme,

Thank you for all your assistance. I really appreciate your help in giving references.

Marcus.