WLVL Posted August 30, 2015 Share Posted August 30, 2015 Hi Everyone! I have a grid, i'd like to select the diagonal points. Im using a group SOP, filter by expression: abs(TX) = abs(TZ); The result is funky (does not select all "TX=-TZ" diagonal but only corner pts) Any workarounds? Thank you very much!!! diagonal_select.hip Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted August 30, 2015 Share Posted August 30, 2015 you can identify 'diagonal' points in a pointvop, as well. grid_diag.hiplc Quote Link to comment Share on other sites More sharing options...
mestela Posted September 1, 2015 Share Posted September 1, 2015 Huh, you're right, looks like a subtle rounding error with absolute and the if statement. Happens in your setup too konstantin if you put an abs vop on each wire before the equality test. Might be worth sending to sidefx support a a bug. In the interim, you can make it work if you subtract one from the other, and test if its within a very small range. Eg, for the group expression: if( abs($TX)-abs($TZ)<0.0001 && abs($TX)-abs($TZ)>-0.001, 1 ,0 ) Or directly in a wrangle (slightly easier to read I reckon) : float diff = abs(@P.x)-abs(@P.z); float max = 0.001; float min = -max; if (diff<max && diff>min) { @Cd={1,0,0}; @group_group1=1; } Quote Link to comment Share on other sites More sharing options...
WLVL Posted October 29, 2015 Author Share Posted October 29, 2015 (edited) Thank you very much!! PS.sorry for the late response, i didnt realize the post was answered! Edited October 29, 2015 by WLVL 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.