Changeset 7872 for trunk/anuga_core/source/anuga/geometry
- Timestamp:
- Jun 24, 2010, 10:38:40 PM (15 years ago)
- Location:
- trunk/anuga_core/source/anuga/geometry
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/geometry/aabb.py
r7861 r7872 12 12 13 13 class AABB: 14 """Axially-aligned bounding box class. 15 Defines a box which can check for intersections with other boxes, 16 or if a point lies within it. 14 """ Axially-aligned bounding box class. 15 An axially aligned bounding box (or AABB) defines a box-shaped region 16 of the plane which contains any other arbitrary geometry. 17 It is useful because intersections can be tested against it very 18 rapidly. Once all misses are trivially rejected, a more expensive 19 collision detection can be done against the remaining geometry. 20 21 This class defines a box which can check for intersections with other 22 boxes, or points. It can also subdivide itself, returning 23 smaller AABBs. This can be used as the basis of a recursive tree 24 structure for optimising geometry searches. 17 25 """ 18 26 -
trunk/anuga_core/source/anuga/geometry/quad.py
r7866 r7872 17 17 18 18 class Cell(): 19 """ class Cell20 21 One cell in the plane.19 """ One cell in the plane. 20 A cell is defined by an AABB, and can have smaller AABB children. 21 The children can be rapidly searched for intersections in log(n) time. 22 22 """ 23 23 … … 38 38 39 39 def __repr__(self): 40 """ String representation of the quadtree. """ 40 41 ret_str = '%s: leaves: %d' \ 41 42 % (self.name , len(self.leaves)) … … 84 85 #return 85 86 86 # option 2 - try splitting 2 ways - no diff noticed in practise 87 # option 2 - try splitting 2 ways - no performance difference 88 # noticed in practise between this and the above option. 87 89 if subregion1.is_trivial_in(new_region): 88 90 self.children = [Cell(subregion1, self), \ … … 160 162 161 163 def test_leaves(self, point): 162 """ Test all leaves to see if they intersect x. 164 """ Test all leaves on this node to see if they intersect x. 165 Does not recurse into children. 163 166 x is a point to test 164 167 return a list of leaves that intersect x
Note: See TracChangeset
for help on using the changeset viewer.