Q about selecting faces with Ray SOP

   2069   4   1
User Avatar
Member
109 posts
Joined: June 2008
Offline
Hi,

is there a way to select faces that are pointing specific direction/object?

I'm trying to create Bullet sim and then emit some smoke from the exploding chunks. Now, i forget to add inside groups in Voronoi Fracture, and instead of enabling it and resimming and writing the geo into disk, i decided to use the geo that i have and educate myself and hopefully learn something new and find a way to select the inside faces other way.

I tried to use the Ray SOP, and then use some attributes and transfer them, but it doesn't seem to work quite as well i hoped…or i'm not using it correctly: it seems to select a bit more than i need.

Any ideas how to select only the polys that are facing the grid? Using Ray SOP or something else.

Cheers
-kimmo

Attachments:
wall_02.hipnc (117.8 KB)
img.png (264.6 KB)

User Avatar
Member
648 posts
Joined: July 2005
Offline
see attached….

Attachments:
wall_get_inside.hipnc (121.2 KB)

User Avatar
Member
109 posts
Joined: June 2008
Offline
Thank you, but not quite what im after. Hopefully the attached images explains it better

I want to select all the red faces (manual selection here) and then use rest for sourcing smoke

-kimmo

Attachments:
img2.png (577.8 KB)

User Avatar
Member
648 posts
Joined: July 2005
Offline
oic, replace wrangle code with:

vector nn = normalize(@N);
vector op = @P + (nn*0.0001);
vector huv = set(0,0,0);
vector hpos = set(0,0,0);
nn = nn * 0.2;
int hit = intersect(1,op,nn,hpos,huv);
@Cd = set(1,0,0);
if (hit >= 0) {
@Cd = set(0,1,0);
setprimgroup(0,“inside”,@primnum,1,“add”);
}

It switches the target geo to 2nd input, shortens the ray to 0.2
User Avatar
Member
109 posts
Joined: June 2008
Offline
Haa - its working!
Now i just try to figure out what heck you write

Thank you!
  • Quick Links