0

I have an application in which I am using an octree to store a volume mesh of axis-aligned bounding boxes (AABBs).

Given a water-tight triangle mesh, I need to:

  • find if an AABB is intersected by or completely inside/outside of the surface mesh,

  • clip the surface mesh with the intersected AABBs to generate triangles that completely lie within each AABB.

The triangulation and the octree containing the AABBs are both dynamic. The number of leaf nodes in the octree is huge. The number of triangles in the surface mesh is much smaller (O(10^9 - 10^13) octree nodes, vs O(10^6) triangles).

Which data-structures and algorithm are suitable for my problem?

Right now I:

  • store the triangles in the same octree as the volume mesh,
  • store each triangle in the smallest octree node that contains it,
  • clip the triangle mesh with a single AABB by traversing from that AABB to both the root node and its leafs clipping each triangle contained in the nodes with the AABB.

The triangles in the nodes until the leafs are fully contained within the AABB and don't need any clipping, while the ones contained in the nodes from the AABB to the root need clipping. However:

  • due to the way I am storing the triangles I don't have an upper bound in the maximum number of triangles that can be store within each single octree node, so I don't have an upper bound in the number of triangles that have to be clip when clipping the surface mesh with a single AABB.

  • testing if an AABB is intersected by the triangle mesh might require clipping if triangles are stored in the root node.

  • have no fast way of determining if a node is inside/outside/intersected by the mesh.

gnzlbg
  • 7,135
  • 5
  • 53
  • 106
  • Are you really saying up to 10 tera-nodes, which is ten milion nodes per triangle ?? –  Apr 29 '16 at 07:18
  • Yes the number of nodes in the octree is much larger than the number of triangles. The orders of magnitude provided are representative (10^9 octree nodes vs 10^6 triangles is accurate). – gnzlbg Apr 29 '16 at 10:32
  • I could understand 10^9, but not 10^13. –  Apr 29 '16 at 10:51
  • 10^9 is where it starts... 10^13 is the state of the art. Anyhow the question is about how to clip triangles with AABBs that correspond to nodes in an octree. The number of octree nodes and the number of triangles was just to give a feel for how often these clipping operations are to be performed. – gnzlbg Apr 29 '16 at 13:33
  • How big are the triangles compared to the AABBs ? Is the octree spatially related to the triangle mesh ? –  Apr 29 '16 at 14:37
  • The triangle mesh always fits in the largest AABB of the octree (the root node). In general the size of the bounding box of the triangle mesh is of the same order than the largest AABB of the octree. The triangles are, in general, way larger than most of the AABBs. The octree is spatially related to the triangle mesh in the sense that the whole triangle mesh always fits within the octree, but sometimes the triangle mesh might be much smaller than the octree (still because the octree has much more nodes the triangles in the mesh are still way larger than most AABBs). – gnzlbg Apr 29 '16 at 18:58
  • Are the AABB made of voxels (sides at integer multiples of some unit size) or just parallelepipeds with arbitrary coordinates ? –  Apr 29 '16 at 20:44
  • The AABBs are nodes of the octree. – gnzlbg May 02 '16 at 08:12
  • This doesn't answer my question. –  May 02 '16 at 08:41
  • Sorry, your question wasn't very clear to me so I tried to provide an useful answer. Each AABB is a node of an octree (not necesarily a leaf node). So they are not "just parallelepipeds with arbitrary coordinates" since the coordinates of any octree node can be normalized such that for all nodes at a given depth within the octree its coordinates can be expressed as "integer multiples of some unit size". Implementation-wise I only store the "real coordinates" of the root node of the octree and recompute the coordinates of each AABB from its morton index. Does this help? – gnzlbg May 02 '16 at 08:59
  • Should I understand that there are no voxels involved, no grid ? –  May 02 '16 at 09:10
  • Each node of an octree should be a voxel by definition but I don't know if we mean "the same thing by voxel". The nodes of an octree are cubes. – gnzlbg May 02 '16 at 09:11
  • Combinations of nodes within an octree form a lot of different cubic volume grids. In some sense, there is not just a single grid. The leaf nodes of an octree form a single grid, but I am interested in intersecting AABBs that are not necessary leaf nodes. – gnzlbg May 02 '16 at 09:14
  • Not necessarily. Octrees can be based on arbitrary parallelepipeds. So if you have voxels, you can slice the mesh with equidistant planes. –  May 02 '16 at 09:14
  • Then yes, all my octree nodes are cubes with equal sized sides. (In hindsight I see what you mean, the octree graph allows for distorted nodes, sorry for the confusion). – gnzlbg May 02 '16 at 09:15

0 Answers0