# Geometry Intersection / Closest Geo Lookup?

Hi - I’m trying to control 16 lights that I have placed around a room in a circle. I have a table of real positions, with corresponding fixture ID’s, which I’m using to create instanced geometry. Then I have a virtual sphere moving around the circle. I want the sphere’s position to be used to select an ID of one of my Geos. How could I go about this? It doesn’t need to be super accurate, the nearest neighboring ID to the sphere would suffice. Toe attached…

Or in other words - how do you find the sample index in a set of two channels, where a pair values match at the same index across the two channels? IE

given two channel operators, value (time slice) & chop (multi sample)

``````value[0] == chop[0][n] && value[1] == chop[1][n]....
``````

could probably use numpy but I’m not sure that is the best way to do it.

Thanks!
B
lightidea1.toe (12.2 KB)

Just some rough ideas:

You can use Sort SOP to sort points closest to a specified location.

You can use Math CHOP to calculate distances, and then use a Sort CHOP to sort ascending.

You can use Group SOP to select points within a bounding Sphere.

Closer to your question, you can use Analyze CHOP to find first peak in a set of results.

Cheers,
Rob.

hi @bnew, did you ever get to solve your problem? I am almost doing the same thing, trying to use boolean operator bu no success yet…