opus2761 Posted March 1, 2016 Share Posted March 1, 2016 Hi, I am still pretty new to houdini and I can't figure out this seemingly easy question... I have a box poly mesh that has divisions of 12, 6, 6. I'd like create groups for points on the same x axes. How can I achieve that? Any help is greatly appreciated. Thanks! ycc Quote Link to comment Share on other sites More sharing options...
opus2761 Posted March 1, 2016 Author Share Posted March 1, 2016 I was struggling for a while and then figured it out right after I posted the question. assign $CR = $PT to all the points on the 1st column attribute transfer the color value to the rest of the points add partition sop with rule "group by color" Not sure if it's the best way, but it is working. Quote Link to comment Share on other sites More sharing options...
anim Posted March 1, 2016 Share Posted March 1, 2016 Point Wrangle: float error = 0.00001; string name = sprintf("group_y%g_z%g", rint(@P.y/error)*error, rint(@P.z/error)*error); name = re_replace(r'\.', '_',name); setpointgroup(0, name, @ptnum, 1); 1 Quote Link to comment Share on other sites More sharing options...
opus2761 Posted March 1, 2016 Author Share Posted March 1, 2016 Thank you very much Tomas! So much cleaner to use vex. I'd really like to start using it more. Quote Link to comment Share on other sites More sharing options...
cupoftea Posted March 1, 2016 Share Posted March 1, 2016 Point Wrangle: float error = 0.00001; string name = sprintf("group_y%g_z%g", rint(@P.y/error)*error, rint(@P.z/error)*error); name = re_replace(r'\.', '_',name); setpointgroup(0, name, @ptnum, 1); Hi Thomas can You comment out these lines? What do they say? Interested in learning VEX. Thank you Quote Link to comment Share on other sites More sharing options...
anim Posted March 2, 2016 Share Posted March 2, 2016 ... can You comment out these lines? What do they say? Interested in learning VEX. Thank you ... sure the idea is that all points that lie on the same axis parallel to x-axis will have the same y and z coordinate therefore group name generated using y and z position values will be the same for all points on the same x axis to introduce some tolerance we can round them to certain decimal place, so rint(@P.y/error)*error rounds y coordinate and rint(@P.z/error)*error rounds z coordinate so if y is 0.200000001 and z is 0.9000000001 then after rounding they are 0.2 and 0.9 then sprintf("group_y%g_z%g", y, z); constructs string "group_y0.2_z0.9" but since group names can't contain dots name = re_replace(r'\.', '_',name) replaces all dots with underscores, giving you "group_y0_2_z0_9" 1 Quote Link to comment Share on other sites More sharing options...
cupoftea Posted March 4, 2016 Share Posted March 4, 2016 Thomas,thank You verymuch! i´ve never read such a VEXcode (i am a VEX noob), very interesting. why cant group names have dots in it? just a general VEX rule to know? i guess it has a reason Quote Link to comment Share on other sites More sharing options...
anim Posted March 4, 2016 Share Posted March 4, 2016 (edited) it's not about VEX, houdini geometry groups can't have dots in them, among other invalid characters Edited March 4, 2016 by anim Quote Link to comment Share on other sites More sharing options...
6ril Posted March 5, 2016 Share Posted March 5, 2016 That's a very nice answer Tomas! thanks for your explanations and time. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.