Juzwa Posted February 16, 2017 Share Posted February 16, 2017 (edited) Hi, I guess this is easy question. I ahve a Bound sop and I want to get its xyz dimentions. What is a vex function for getting sop dimentions? I've been trying to look into help but Im not getting lucky. Edited February 16, 2017 by Juzwa Quote Link to comment Share on other sites More sharing options...
f1480187 Posted February 16, 2017 Share Posted February 16, 2017 Try getbbox function. // Point wrangle. vector min, max; getbbox(0, min, max); To visualize: addpoint(0, min); addpoint(0, max); Quote Link to comment Share on other sites More sharing options...
Juzwa Posted February 16, 2017 Author Share Posted February 16, 2017 Ok that makes sense, thx Quote Link to comment Share on other sites More sharing options...
vtrvtr Posted February 16, 2017 Share Posted February 16, 2017 Just as an addendum, the very useful bbox functions work in wrangles. E.g ysize = `bbox(0, D_YSIZE)`; Will give you the size of the bound box in the y axis Quote Link to comment Share on other sites More sharing options...
cwhite Posted February 16, 2017 Share Posted February 16, 2017 3 hours ago, vtrvtr said: Just as an addendum, the very useful bbox functions work in wrangles. E.g ysize = `bbox(0, D_YSIZE)`; Will give you the size of the bound box in the y axis It's very important to understand why that appears to "work". Your example uses an expression function that's evaluated while evaluating the string parameter for the wrangle's code. This happens before the VEX code is compiled, and means that the VEX code will keep being recompiled whenever the value is dirtied by the upstream SOP's geometry changing. That can have significant overhead, such as when running inside a foreach loop. 2 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.