Jump to content

Duplication finder in radius


Mykman

Recommended Posts

Hi All!

I have a VEX problem,I have a point cloud and I use it for instancing various objects to it. I would like to search all points in a radius and replacing the identical instances to an another what is not there. Like this I could get a nicer variation because the same instance would not be placed next to each other.
My theory was this :
- using pcfind search all points in a radius and put the variations into an array
- remove the source point value from the array
- pick a random one from the array and replace the identical neighbours
- run through this on all points
 
my vex code :
 
int pts = pcfind_radius(1, P”, pscale”, 0.0, 1 , 4, 5 );
string instance_array = s@unreal_instance;
removevalue(instance_array, s@instance);
foreach(int pt; pts)
{
string instance_string = point(0, instance”, pt);
removevalue(instance_array, instance_string);
if(s@instance_string == instance_string)
{
s@instance_string = instance_array;
}
}


For some reason something does not work and If someone could help me that would be amazing !

Thanks a lot !
Karoly

Attachments:

instanceInRadius.hiplc

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...