 # Selecting "visible" points and not ones that are in shadow of geometry

Hello
I have a geometry and a Point P
I have populated the Geometry with multiply points M

I would like to conect point P with all points M that are “vissible” to P

The best way i know to discribe this is a refrence:
In maya there is a way to select vertesies with “camera based selection” meaning you can only select vertesies seen by camera (If you have a sphere and do rectangular selection and CBS is on you only select vertesies on the side you can see)

does anybody know a way to do this in grasshopper i thought about connecting all M’s with P and then intersect all MP’s with the sphere and if there is a intersection i tried to cull them. but i am very new to GH and i didn’t manage I would appriciate any help
thanks!

If you make two vectors:

1. vector_cp: From the Sphere Center to point M
2. vector_pm: From point P to point M

Then only the M points with a vector angle less than or equal 90 degrees are “visible” as seen from point P.

``````var angle = Vector3d.VectorAngle(vector_cp, vector_pm); // radians, convert to degree
if (angle <= 90) // degrees
{

}
``````

The same test can be done with components of course.

// Rolf

Hi
thats a cool idea. would have never thought of that ^^ haha

but the way i understand it this would only work with a sphere right?
I would like to find a way that works with any geometry

thanks

How about using `IsoVist Ray` and comparing two sets of vector length?

SelectingVisiblePt_re.gh (14.9 KB)

1 Like

Yes. // Rolf

Hi

yes this is exactly what i need. very cool!
thanks so much 