I am a bit stuck with my VEX code, as I am trying to use only VEX in one Attrib Wrangle (Primitives) to do this whole process. Meaning using other SOPs is not an option. I am not a full beginner but not an expert either, so please bear with me.
I am getting a polyline in input, so a prim with points. I created in VEX a sphere prim that would need to be checked for intersection with the polyline, by going through all its segments using
intersect
intersect
int origin = addpoint(0,origin_pos); int sphere = addprim(0, "sphere", origin); setprimintrinsic(0, "transform", sphere, radius * matrix3(ident())); string s_group = "s_group"; setprimgroup(0, s_group, sphere, 1, "set");
My sphere is behaving correctly when referencing its primnum to change its radius or its origin point to move it later on. The thing is, when I check if the sphere prim is in the group with
int test = inprimgroup(0, "s_group", sphere)
nprimitivesgroup(0, "s_group")
Then of course, it returns -1 when I try to use "s_group" as a string group name in the
intersect
int intersect = intersect(0, "s_group", pt_origin, dir, pos, uv);
So I am wondering what I did wrong or if there is another way to do this whole process?
Thank you so much!

