Hi!
I'm making a window and I would like the side borders (sweeps) to drive the size X of the bottom sill. I don't get how to…
I tried putting a wrangle after the sweep with:
f@myBBox = relbbox(0, @P).x;
but I don't know how to use this attribute to affect the bottom sill' size X (in parallel to the wrangle…)
Any help?
-Olivier
How to use BBox from a geo to drive size of another geo
3886 7 2- olivierth
- Member
- 1007 posts
- Joined: April 2017
- Offline
- Konstantin Magnus
- Member
- 670 posts
- Joined: Sept. 2013
- Offline
The box node has an input. Just plug the sweep node in it and scale it back with .
With VEX it´s
1/$SIZEY
With VEX it´s
@P.x *= getbbox_size(1).x;
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- Konstantin Magnus
- Member
- 670 posts
- Joined: Sept. 2013
- Offline
Also there is a node called matchsize.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- olivierth
- Member
- 1007 posts
- Joined: April 2017
- Offline
Nice! I was waiting for the website to come back online to check your answer.
I like the idea that no matter the size and position of my reference geo, it would fit the main geo on the axes that I choose. So I started with this:
vector max = getbbox_max(1);
vector min = getbbox_min(1);
vector center = getbbox_center(1);
Now that I've got all the bbox infos I need from the reference geo, how can I use them on the main geo?
Thanks for the help!
-Olivier
I like the idea that no matter the size and position of my reference geo, it would fit the main geo on the axes that I choose. So I started with this:
vector max = getbbox_max(1);
vector min = getbbox_min(1);
vector center = getbbox_center(1);
Now that I've got all the bbox infos I need from the reference geo, how can I use them on the main geo?
Thanks for the help!
-Olivier
- BabaJ
- Member
- 2038 posts
- Joined: Sept. 2015
- Offline
You could use python in a parameter text box ( your box geo? or transform node?)
And if I do that, I usually use a wrangle set to detail for the bbox functions. Just to set up my reference attributes e.g.
Then elsewhere in the parameter textbox that will be accessing the detail created:
And if I do that, I usually use a wrangle set to detail for the bbox functions. Just to set up my reference attributes e.g.
v@My_Max = getbbox_max(geoself());
Then elsewhere in the parameter textbox that will be accessing the detail created:
Desired_Vector_Component = hou.node("Wrangle_Node_With_Bboxdetail").geometry().attribValue("My_Max")[0]
Edited by BabaJ - Feb. 26, 2018 11:01:47
- olivierth
- Member
- 1007 posts
- Joined: April 2017
- Offline
Thanks Babaj!
I'm just starting to learn vex (the only coding i've ever tried!) so I'd like to avoid python if I can.
I actually found the solution! (so proud!). I get the the bbox min and max for both my ref geo and the geo I want to modify. I pass all that info into a fit function:
vector Amin = getbbox_min(0);
vector Amax = getbbox_max(0);
vector Bmin = getbbox_min(1);
vector Bmax = getbbox_max(1);
@P = fit(@P, Amin, Amax, Bmin, Bmax);
…At some point, I'll see if I can also take the rotation into acount (something about the matrix..?)
Thanks for helping me out! I really appreciate it!
-Olivier
I'm just starting to learn vex (the only coding i've ever tried!) so I'd like to avoid python if I can.
I actually found the solution! (so proud!). I get the the bbox min and max for both my ref geo and the geo I want to modify. I pass all that info into a fit function:
vector Amin = getbbox_min(0);
vector Amax = getbbox_max(0);
vector Bmin = getbbox_min(1);
vector Bmax = getbbox_max(1);
@P = fit(@P, Amin, Amax, Bmin, Bmax);
…At some point, I'll see if I can also take the rotation into acount (something about the matrix..?)
Thanks for helping me out! I really appreciate it!
-Olivier
- BabaJ
- Member
- 2038 posts
- Joined: Sept. 2015
- Offline
Yes I prefer to avoid python myself - but at the moment it comes in very handy with some of the nodes that still only use Hscript/Python.( SideFX is working on progressively on being able to use vex in more nodes).
But to do what you want in vex, Mestela( spelling? ) has an excellent reference page. ( down the page is reference to rotations with matrix )
http://www.tokeru.com/cgwiki/index.php?title=HoudiniVex [www.tokeru.com]
But to do what you want in vex, Mestela( spelling? ) has an excellent reference page. ( down the page is reference to rotations with matrix )
http://www.tokeru.com/cgwiki/index.php?title=HoudiniVex [www.tokeru.com]
- olivierth
- Member
- 1007 posts
- Joined: April 2017
- Offline
-
- Quick Links