How can I test if a point lies within a 3d shape with its surface defined by a point cloud?

前端 未结 3 752
北海茫月
北海茫月 2021-01-02 03:35

I have a collection of points which describe the surface of a shape that should be roughly spherical, and I need a method with which to determine if any other given point li

3条回答
  •  感动是毒
    2021-01-02 03:43

    I think Bill Carey's method is on the right track, but I do want to suggest a possible optimization.

    Since the shape is roughly spherical, you can pre-calculate the radius of the sphere bound by it and of the sphere that bounds it. This way, if the distance of the point is within the smaller sphere, it's a definite hit and if it's outside the outer sphere, it's a definite miss.

    This ought to let you resolve the easy cases very quickly. For the harder ones, Carey's method takes over.

提交回复
热议问题