about octree

Feel free to ask any question here
Post Reply
leslie
Posts: 1
Joined: Mon Mar 27, 2017 2:23 am

about octree

Post by leslie »

when I read your DgmOctree .cpp code ,I found a variable called maxDiagFactor (double maxDiagFactor = squareRadius + (0.75*cs + SQRT_3*radius)*cs;)
and It decides whether the cell is in totally inside or outside ((cellCenter -query_point).norm2d() <= maxDiagFactor),I wonder how does the maxDiagFactor is defined !is it an experienced value?
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: about octree

Post by daniel »

Well, I believe it's simple maths to detect the potential intersection of a box with a sphere, without spending too much times into details (i.e. the worst case, considering the box diagonal and the distance to any point in the cell, i.e. the farthest vertex of the cell bounding-box). But right now I can't remember what exactly the computation was ;).
Daniel, CloudCompare admin
Post Reply