pcfind into group?

   1583   3   0
User Avatar
Member
1004 posts
Joined: April 2017
Offline
Hi!

I've got a color gradient (black to red) on a line and I would like to find all points close to the color 0.5 and place them in a group. I'm using pcfind to get the 10 points closest to color 0.5. in the range of 0.3

I don't get how to take all those found points and place them in a group.

float grad = @ptnum/(@numpt-1.0); //gradient 0 to 1
float ref = 0.5; //mid value aka center of my line
float vRange = 0.3; //color range to search for points
int taken = 10; //total closest points taken

@Cd = 0;
@Cd.r = grad; //black to red gradient

i@group_myGroup = pcfind(0, “Cd”, ref, vRange, taken);

Thanks for any help!

-Olivier
Edited by olivierth - April 5, 2018 13:41:55

Attachments:
pcfind_by_color_on_line.JPG (65.7 KB)

User Avatar
Member
472 posts
Joined: July 2005
Offline
Hi,

here is an approach. I've put the pcfind result into a detail attribute, which can be written back into a point attribute/group. Maybe there are simpler solutions.

Attachments:
colorline.hipnc (80.3 KB)

User Avatar
Member
1004 posts
Joined: April 2017
Offline
Cool. I'll have a look and try to understand it.

Thanks!

-Olivier
User Avatar
Member
8521 posts
Joined: July 2007
Online
maybe I'm misunderstanding, but I'm not sure why you need pcfind, can't you just do this?:
float value = 0.5; // value to group by
float threshold = 0.1; // which is value +- 0.05

@group_mygroup = abs(v@Cd.x-value)<=threshold/2.0;
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links