Jump to content
isah_voodoo

store getbbox into attribute

Recommended Posts

Hello again

I come with another vex question. This time I am trying to figure out the function getbbox and store it into an attribute to see what the values are actually doing,....

The help cards states: 

Sets two vectors to the minimum and maximum corners of the bounding box for the geometry.

void  getbbox(vector &min, vector &max)

So I am trying to follow this exactly.

vector min;
vector max;

getbbox(min,max);

@P.x *= (@P.y/max.y);

Now, I found this simple pieces of code on the forums somewhere and it works great. However, I am trying to store the getbbox into my own attribute so I can actually see the values but when I try, it gives me an error. This is what im doing:

vector min;
vector max;

v@myBound= getbbox(min,max);

@P.x *= (@P.y/max.y);

What exactly am I doing wrong here? Why does the getbbox function not let me store its values into an attribute? 

Share this post


Link to post
Share on other sites
vector min;
vector max;

getbbox(min,max);

v@bbox_min = min;
v@bbox_max = max;
//or as array containing both
v[]@bbox = array(min, max);

 

  • Like 1

Share this post


Link to post
Share on other sites

Hi Matt, according to the docs, void  getbbox(vector &min, vector &max) is deprecated. We should use three arguments, first is the geometry input (integer number or "op:" string reference). 

getbbox (0, v@min, v@max);

This one line is also what you asked for. It stores the bounding box into two vector attributes.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×