c# - Storing Rectangles/Circles/Triangles in a KD-Tree -


i looking @ kd-tree , found implementations of algorithm. of these storing points (2d in major of cases). trying achieve store different shapes in rectangle, triangle etc. so possible in kd-trees store shapes? have code quad-trees. in shapes being stored.

this not different method used quad trees.

for each shape, should able compute :

  • its centroid.

  • its envelope.

when computing median, use centroids. envelope of shape should fit in quad. when inserting shape in quad, check if envelope crosses hyperplane. if true, store shape in quad. if false, put shape in appropriate list of shapes of left or right quad construction call.

cheers


Comments