Nearpoint function adapt limited points
2945 10 0- kazurati
- Member
- 27 posts
- Joined: Oct. 2018
- Offline
- bonsak
- Member
- 459 posts
- Joined: Oct. 2011
- Offline
- kazurati
- Member
- 27 posts
- Joined: Oct. 2018
- Offline
- kazurati
- Member
- 27 posts
- Joined: Oct. 2018
- Offline
- BabaJ
- Member
- 2024 posts
- Joined: Sept. 2015
- Offline
You've set pt 0 to be in the group you are searching.
But also are using the position of pt 0 to search from.
In such a situation the way the function works, you will get pt 0 as a result.
So you have a polyline going from pt 0 to pt 0.
To do what you want, use the nearpoints function.
It returns an array of nearest pts according to your arguments specified.
If I remember correctly, the membership of the resulting array will be in increasing order of distances.
For such an array you could simply iterate over it creating your polyline.
Just remember though, like the nearpoint function - your first point you used to search from( in this case pt 0) will be part of the result(first member in the array).
But also are using the position of pt 0 to search from.
In such a situation the way the function works, you will get pt 0 as a result.
So you have a polyline going from pt 0 to pt 0.
To do what you want, use the nearpoints function.
It returns an array of nearest pts according to your arguments specified.
If I remember correctly, the membership of the resulting array will be in increasing order of distances.
For such an array you could simply iterate over it creating your polyline.
Just remember though, like the nearpoint function - your first point you used to search from( in this case pt 0) will be part of the result(first member in the array).
- kazurati
- Member
- 27 posts
- Joined: Oct. 2018
- Offline
Hi,Babaj.
what I want to do is to find near point in the search group and add as vertex it to polyline first and then remove vertex point from search target group.
And again find a closed point in the search group from first vertex.
but,it seems that nearpoint function is looking for point out of search group.
Is this bad for my script?
If you have any ideas,could you tell me?
Thanks.
what I want to do is to find near point in the search group and add as vertex it to polyline first and then remove vertex point from search target group.
And again find a closed point in the search group from first vertex.
but,it seems that nearpoint function is looking for point out of search group.
Is this bad for my script?
If you have any ideas,could you tell me?
Thanks.
- BabaJ
- Member
- 2024 posts
- Joined: Sept. 2015
- Offline
You have a group node before your wrangle which sets ( presumbably, because you haven't included a hip file) the membership for “search'.
But in the wrangle you ”set“ the group membership for ”search“ to only be pt. 0.
If there are some points defined to be in ”search“ with the group node, you should have used ”add“ instead of ”set“ for the setpointgroup function of the wrangle.
Otherwise, the way you have it set up is that there is a prim, but because it goes from pt. 0 to pt. 0 you don't see it.
( There's only one point in the group ”search" ).
Post your hip file, as I/others can make changes to it to get what you want.
But in the wrangle you ”set“ the group membership for ”search“ to only be pt. 0.
If there are some points defined to be in ”search“ with the group node, you should have used ”add“ instead of ”set“ for the setpointgroup function of the wrangle.
Otherwise, the way you have it set up is that there is a prim, but because it goes from pt. 0 to pt. 0 you don't see it.
( There's only one point in the group ”search" ).
Post your hip file, as I/others can make changes to it to get what you want.
- kazurati
- Member
- 27 posts
- Joined: Oct. 2018
- Offline
- kazurati
- Member
- 27 posts
- Joined: Oct. 2018
- Offline
- BabaJ
- Member
- 2024 posts
- Joined: Sept. 2015
- Offline
The wrangle colored red was added to your file, I think this is what you want?
In the process of working out the logic, I added some of my own defined variables along with yours so the code may look a bit messy.
Pretty sure from looking at your attempts you have a grasp of logic so you should be able to clean it up a bit.
In the process of working out the logic, I added some of my own defined variables along with yours so the code may look a bit messy.
Pretty sure from looking at your attempts you have a grasp of logic so you should be able to clean it up a bit.
- kazurati
- Member
- 27 posts
- Joined: Oct. 2018
- Offline
-
- Quick Links