Select vertices based on proximity or bounding box

Select vertices based on proximity or bounding box

sjrohitFAEQA
Explorer Explorer
560 Views
2 Replies
Message 1 of 3

Select vertices based on proximity or bounding box

sjrohitFAEQA
Explorer
Explorer

Hi,

 

I have two geos which are intersecting with each other. I want to select the vertices of the first geo based on the position of second geo.  Or in other words, I want to select the points of first geo which are inside the second geo. Is there any way to do this?

 

thanks in advance!

0 Likes
561 Views
2 Replies
Replies (2)
Message 2 of 3

mcw0
Advisor
Advisor

You can use position obviously.  And based on the shape of your objects, you can also use surface normals.  There is a thread in Bifrost where someone made a collision graph to push intersecting vertices out of another object.  So it's definitely possible.

0 Likes
Message 3 of 3

Kahylan
Advisor
Advisor

Hi!

 

To find out if a vetex is inside another object, raycasting is probably the best way to go.

The principal is to use the position of the vertex and cast a vector into a random direction and check how many times the vector intersects with the other object. If the number is even or 0, the vertex is not in the object, if the number is odd, it is inside. Now if the geometry you are checking against has holes in it, using multiple rays and then using the result that most rays give you is recommended.

 

I'm currently not on my working machine. But I found a good github example that shows how raycasting can be done using the python API:

 

https://gist.github.com/SlyCodePanda/46a47e0193074154eadbabfa8500b2a7

 

I hope this helps!

0 Likes