This was a bit tricky, since it's necessary to inspect the points returned
by component shapes to see if they're actually on the composite surface.
To that end, a temporary buffer is allocated. This is most likely used in
interactive point-and-pick situations, so the performance loss should not
be significant.