Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Hierarchical data structures for gigantic geometric models Master in Computing Pere Brunet 2010 Basic geometric problems • Geometric search (by position) -> Exists ? – Information • Geometric search (by region): region clipping • Geometric sorting, topological sorting, ordering (*) • Neighbour finding Data and complexity Model complexity vs scene complexity Points Point sets Meshes General objects (*) Sorting = classifying (screws) Ordering = sorting according to an ordering Data and complexity Model complexity versus scene complexity Elements Points (surfels) Points Polygon Soups Polygons Meshes Polygons Instances Objects Geometry Appearance Structure Semantics Data and complexity Scene Example Elements Geometry Appearance Structure Semantics Points (surfels) Points X X X Polygon Soups Polygons Meshes Polygons X X Instances Objects X X X Space division (uniform) Uniform grid Buckets with data Memory requirements Geometric search by position Geometric search by region Topological sorting Neighbour finding Type of data: • Points • One object or mesh • Set of many objects Parameters: • Size of cells • Size of buckets Hierarchical (recursive) space subdivision Bintrees Space subdivision Image space Tree nodes boxes Tree structure: binary Nodes: G, T (W,B,L) Tree depth G=T-1 Universe Subdivision criterion: split, 50% Alternate directions (or not; flag) Leaf criterion Hierarchical (recursive) space subdivision Unrestricted quadtree: 2D Space subdivision Image space Tree nodes squares Tree structure: quaternary Nodes: G, T (W,B,L) Tree depth G=(T-1)/3. Subdivision criterion: split in four Leaf criterion • Points • Mesh • Objects Hierarchical (recursive) space subdivision Point quadtrees: 2D Space subdivision Object space Tree nodes rectangles Tree structure: quaternary Nodes: G, T Information on G nodes G=(T-1)/3. Subdivision criterion: split in four Leaf criterion • Points Hierarchical (recursive) space subdivision Unrestricted octree: 3D Space subdivision Image space Tree nodes cubes Tree structure: octal Nodes: G, T (W,B,L) Tree depth G=(T-1)/7. Subdivision criterion: split in eight Leaf criterion • Points • Mesh • Objects Hierarchical (recursive) space subdivision Kd-trees Space subdivision Object space Tree nodes boxes Tree structure: binary Nodes: G, T (W,B,L) Tree depth G=(T-1) Subdivision criterion: orthogonal Alternate / Flagged direction Leaf criterion • Points • Mesh • Objects Hierarchical (recursive) space subdivision Vector octrees (and quadtrees) Space subdivision Image space Tree nodes cubes Tree structure: octal Nodes: G, T (W,B,F,E,V,TG) Tree depth G=(T-1)/7. Subdivision criterion: orthogonal Leaf criterion • Polyhedral Objects Hierarchical (recursive) space subdivision Binary space partition (BSP) trees Space subdivision Object space Tree nodes polyhedra Tree structure: binary Nodes: G, T (W,B) Grey nodes: Plane G=(T-1) Subdivision criterion: general Search of the best plane Leaf criterion • Polyhedral Objects • Sets of objects, scenes Hierarchical (recursive) space subdivision Binary space partition (BSP) trees Space subdivision Object space Tree nodes polyhedra Tree structure: binary Nodes: G, T (W,B) Grey nodes: Plane G=(T-1) Subdivision criterion: general Search of the best plane Leaf criterion • Polyhedral Objects • Sets of objects, scenes Hierarchical space subdivision - Unrestricted quadtree Hierarchical space subdivision - Restricted quadtrees 1-restricted quadtree (edges) 1-restricted quadtree (edges and vertices) 1-restricted quadtree (edges) 1-restricted quadtree (edges and vertices) Summary on Space Subdivision y Number of son nodes 2 4 8 Bintrees Quadtrees Octrees Kd-trees PointQuadtrees PointOctrees BSP - - x 50 % ortho split Orthogonal split General split Depth, N=8.000.000.000 32 16 11 s=Number_Sons s1=s-1 logs ((s1*N+1)/s) Tetra Puzzles SQRT(2) Subdivision Pyramid of geometry Subdivision ex. a Avoid T-junctions Deeper trees - slower b a b SQRT(2) Subdivision (a 2D example) Pyramid of geometry 2D and 3D Diamonds Split all tetras in the same diamond a) Diamond-external vertices are locked b) Diamond-internal vertices are free. Vertices alternate between a) and b) Subdivision ex. SQRT(2) Subdivision (a 2D example) Pyramid of geometry 2D and 3D Diamonds Split all tetras in the same diamond a) Diamond-external vertices are locked b) Diamond-internal vertices are free. Vertices alternate between a) and b) Subdivision ex. SQRT(2) Subdivision (a 2D example) Pyramid of geometry 2D and 3D Diamonds Split all tetras in the same diamond a) Diamond-external vertices are locked b) Diamond-internal vertices are free. Vertices alternate between a) and b) Subdivision ex. SQRT(2) Subdivision (a 2D example) Diamond constraints No T-junctions Pyramid of geometry 2D and 3D Diamonds Split all tetras in the same diamond a) Diamond-external vertices are locked b) Diamond-internal vertices are free. Vertices alternate between a) and b) Subdivision ex. SQRT(2) Subdivision (a 2D example) Diamond constraints No T-junctions Pyramid of geometry 2D and 3D Diamonds Split all tetras in the same diamond a) Diamond-external vertices are locked b) Diamond-internal vertices are free. Vertices alternate between a) and b) Subdivision ex. Hierarchical (recursive) scene subdivision R-trees Scene subdivision Object space Tree nodes set + box Tree structure: binary Nodes: G, T Top-down construction Overlapping boxes Hierarchical (recursive) scene subdivision (or grouping) Box-trees Scene subdivision Object space Tree nodes set + box Tree structure: binary Nodes: G, T Bottom-up construction Overlapping boxes AABB trees OBB trees Sphere trees BV-trees: k-dops etc Hierarchical data structures: space vs scene subdivision Implementation of hierarchical data structures Pointer trees (octrees) Linear octrees DF- Representation: Operations on hierarchical data structures • Point searching/classification • Region clipping • Neighbour finding • Spatial sorting Hierarchical data structures: some problems (revisited: algorithms and discussion) Hierarchical frustum culling – region queries Surface simplification and multiresolution trees Octal search (extension of binary search) Spatial ordering – visibility, transparencies Neighbour finding and traversal Surface subdivision Collision detection Hierarchical data structures: some problems Hierarchical frustum culling – region queries Exact Conservative Hierarchical data structures: Conservative hierarchical frustum culling Requirements: Non- overlapping node regions (Space subdivision) Regular-shaped regions (cubes better than general boxes) Preorder tree traversal with early prunning Node region vs. Frustum test Stop if Node region is outside Frustum Node is empty Hierarchical data structures: Conservative hierarchical frustum culling Requirements: Non- overlapping node regions (Space subdivision) Regular-shaped regions (cubes better than general boxes) Preorder tree traversal with early prunning Node region vs. Frustum test Stop if Node region is outside Frustum Node is empty Problem: objects in several regions Hierarchical data structures: some examples Conservative hierarchical frustum culling: boxes vs spheres Convex polyhedra intersection test: Vertex of A in B Vertex of B in A Two edges: P of A.edge in B Hierarchical data structures: some examples Conservative hierarchical frustum culling: spheres Good and bad region shapes: Hierarchical data structures: some examples Conservative hierarchical frustum culling Sphere test: Still more conservative: centre point vs. enlarged Frustum Hierarchical data structures: some problems Surface simplification and multiresolution trees Bottom-up simplification. For each level, it’s good to have preserved borders changing position (in next iteration they become internal AND simplified) R. Scopigno et al. Hierarchical data structures: some problems Surface simplification and multiresolution trees Requirements: • Space subdivision tree • Grey nodes with information: simplified regions • Minimum of T-junctions: restricted trees or sqrt(2) Algorithm: Bottom-up simplification. For each level, it’s good to have preserved borders changing position (in next iteration they become internal AND simplified) Hierarchical data structures: some problems Octal search (extension of binary search) Example: locate (and query) an object Search key: spatial location – coordinates or region Requirements: • Space subdivision • Balanced tree Algorithm: • Preorder traversal • Complexity = O(Depth(tree)) Hierarchical data structures: some problems Spatial ordering – visibility, transparencies Omni-directional 3D ordering • In 1D, ordering is well-defined • In nD, sorting is not unique • Dominant point required • Closest point problem, or • Visible objects from Obs • Avoid sorting at every frame !! Obs Hierarchical data structures: some problems Spatial ordering – visibility, transparencies Omni-directional 3D ordering Requirements: • Hierarchical space subdivision tree - BSP Algorithm: • Test Obs – Root • if Obs in a- then • Traverse a+ • Output a • Traverse a• else … Obs • Complexity: O(Num_Nodes) Hierarchical data structures: some problems Neighbour finding and traversal Example: Find Eastern neighbour Requirements: • Space subdivision • Octree or quadtree Algorithm: • Climb until common ancestor • Descend on symmetric path Hierarchical data structures: some problems Neighbour finding and traversal Example: Find Eastern neighbour Algorithm: • Climb until common ancestor • Descend on symmetric path East Hierarchical data structures: some problems Surface subdivision – requirements and algorithm • Curvature metrics • Subdivision in the parametric space (u,v) • Mapping of the subdivision onto the 3D space • Crack avoidance • High quality triangles or polygons Min_Angle Max: Hierarchical data structures: some problems Collision detection Requirements: • Scene subdivision, boxes adapted to objects • Overlaps: traversal of multiple branches Algorithm: • Simultaneous preorder traversal of trees A, B • Box (or sphere) tests A B Hierarchical data structures: Conclusions • The “zoo” of Hierarchical Data Structures • No free lunch • Extremely powerful search data structures • Logarithmic depth • Problem-adapted