0

If I have some basic 3D shapes like rectangular prisms, cylinders and spheres (whose positions, orientations and dimensions are fully known), what is the simplest way of finding the shortest distance from any given point (x,y,z) to each of these shapes? Spheres are easy since orientation is irrelevant and it just involves finding the Euclidean distance between the point and the centre of the sphere, but what about cylinders and rectangular prisms in arbitrary orientations (as defined by roll, pitch, yaw angles)? I'd also like to know if the point is inside or outside the given shape.

Ali250
  • 111
  • Break down a shape and consider each part separately. – Henricus V. Mar 30 '16 at 22:02
  • As in decompose the shape into bounded planes? – Ali250 Mar 30 '16 at 22:03
  • For polyhedra you will want to look up the simplex method. – John Wayland Bales Mar 30 '16 at 22:13
  • It looks like something that's quite general and needlessly complicated. Isn't there a simpler analytical solution seeing as I'll only ever have fully described rectangular prisms, cylinders and spheres? – Ali250 Mar 30 '16 at 22:19
  • You could write a formula for the surfaces, compute the distance from the point to each point on the surface, and minimize using calculus (+ other techniques where the surface is non-differentiable) –  Mar 31 '16 at 01:57

0 Answers0