Valent Posted August 4, 2018 Share Posted August 4, 2018 Hi) Can I somehow get the maximum(and the minimum) value of an attribute in VEX? I want to use them in a FIT function. Quote Link to comment Share on other sites More sharing options...
toadstorm Posted August 4, 2018 Share Posted August 4, 2018 not easily. just use attribute promote sop for this. 1 Quote Link to comment Share on other sites More sharing options...
Popular Post konstantin magnus Posted August 4, 2018 Popular Post Share Posted August 4, 2018 You can fit-range an attribute with setdetailattrib() set to "min" and "max". 1st pointwrangle: setdetailattrib(0, 'height_min', @height, "min"); setdetailattrib(0, 'height_max', @height, "max"); 2nd pointwrangle: float min = detail(0, "height_min", 0); float max = detail(0, "height_max", 0); @Cd.g = fit(@height, min, max, 0.0, 1.0); fit_range_VEX.hiplc 12 4 Quote Link to comment Share on other sites More sharing options...
Valent Posted August 5, 2018 Author Share Posted August 5, 2018 Thanks, have tried both suggested variants, and I like Vex pipeline a bit more. Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted October 8, 2021 Share Posted October 8, 2021 (edited) Remapping an attribute so its maximum is 1.0: 1st point wrangle: setdetailattrib(0, 'height_max', f@height, "max"); 2nd point wrangle: f@height /= detail(0, 'height_max', 0); Edited October 24, 2024 by konstantin magnus 3 Quote Link to comment Share on other sites More sharing options...
damonmaster Posted October 22, 2021 Share Posted October 22, 2021 How can I set and get in one node,because sometime need execute this every time in the loop。 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted October 24, 2024 Share Posted October 24, 2024 (edited) On 10/22/2021 at 9:36 AM, damonmaster said: How can I set and get in one node,because sometime need execute this every time in the loop。 The labs normalize float node wraps this up. Edited October 25, 2024 by konstantin magnus 1 Quote Link to comment Share on other sites More sharing options...
Ian10210123 Posted October 25, 2024 Share Posted October 25, 2024 float value; float values[]; string attrname = chs('attribute'); float max_value; float min_value; for (int i=0; i<@numpt; i++){ value = point(geoself(), attrname, i); append(values,value); } @min_value = min(values); @max_value = max(values); use one point wrangle and done 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.