Adam Ferestad Posted September 23, 2019 Share Posted September 23, 2019 I am trying to figure out how to get the converse of a field, mathematically. I am attempting to blur a Cd field in using a Gas Blur microsolver. I have some mixed results, but I want to get some finer control over the radius, namely that I want it to blur more as it slows down. I have used the gas analysis microsolver to get the speed field by taking the length of the velocity, but I can't figure out how to get larger values to be in the lower speed areas. Obviously I would love to use a fit to invert the values, but I am struggling with an elegant way to get the minimum and maximum values for a given field. I could easily just do a loop in a wrangle and get the min/max values that way, but that is going to be extremely slow as this is a very large, dense simulation. Is there a simple way I can get the min/max values in a field so I can use fit(@speed, min, max, max, min) in a Gas Field Wrangle node to get the converse of my field? Quote Link to comment Share on other sites More sharing options...
bunker Posted September 23, 2019 Share Posted September 23, 2019 (edited) hscript volumemin() and volumemax() if you open the Textport, type: exhelp volumemax Edited September 23, 2019 by bunker Quote Link to comment Share on other sites More sharing options...
Adam Ferestad Posted September 23, 2019 Author Share Posted September 23, 2019 (edited) 13 minutes ago, bunker said: hscript volumemin() and volumemax() if you open the Textport, type: exhelp volumemax Are you suggesting that I need to use hscript to do this? There is no way directly in VEX? Or is hscript a command in VEX that I was unaware of? I can't figure out how to use HScript within my DOPs context. I have done it in SOPSolver nodes in the past, but never in DOPs. Also, how to pass the value downstream to other wrangle nodes? Edited September 23, 2019 by Adam Ferestad Quote Link to comment Share on other sites More sharing options...
bunker Posted September 23, 2019 Share Posted September 23, 2019 there isn't anything in vex to do that directly but you can reference the hscript output value in vex, eg: float maxvalue = chf("maxvalue"); create a spare parameter, then you can enter your hscript expression there: volumemax("/obj/geo/myvolume", 0) Quote Link to comment Share on other sites More sharing options...
Adam Ferestad Posted September 23, 2019 Author Share Posted September 23, 2019 2 hours ago, bunker said: there isn't anything in vex to do that directly but you can reference the hscript output value in vex, eg: float maxvalue = chf("maxvalue"); create a spare parameter, then you can enter your hscript expression there: volumemax("/obj/geo/myvolume", 0) I actually ended up trying something similar to this, but within DOPs I couldn't seem to get the function to target the field. It always returned 0. Quote Link to comment Share on other sites More sharing options...
bunker Posted September 24, 2019 Share Posted September 24, 2019 you can use a sopnet inside DOPs volumemax_in_dops.hipnc Quote Link to comment Share on other sites More sharing options...
anim Posted September 24, 2019 Share Posted September 24, 2019 there is also Volume Reduce SOP and Gas Reduce DOP for that 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.