how do I revolve using vex?(SOLVED)

   516   7   1
User Avatar
Member
42 posts
Joined: Dec. 2020
Offline
Hay guys

Once again I face the issue of having loads of useful attributes that can't be accessed with simple nodes and need another work around.

I need to know how to wright a revolve function using vex so I can access the attributes.

I have a pipe profile that has different radius and angles that can be set.
I first started with the revolve but ended up with loads of them going through switches but it worked well.
I changed this to use a sweep along a curve to have more control but this causes other issues with alignments because of the normals so my bolts and flanges would move if resampling the curve.
I have now had to change the spawning of the flanges to use points but when changing them to a weld there is a gap between pipes when using the sweep as the angles don't come out correctly.

I just need a VEX revolve function but can't find anything on it in the docs?
Edited by Getyamamout - May 12, 2024 08:49:38
User Avatar
Member
213 posts
Joined: June 2023
Offline
It's generally quite hard to recreate SOPs in pure vex, especially those create new geometries.

The common practice is to use vex to convert attributes to a format that the SOP understands, or use Python SOP to call the verb of the SOP. Are you sure these approaches don't work in your case?
Edited by kodra - May 9, 2024 09:17:23
User Avatar
Member
42 posts
Joined: Dec. 2020
Offline
well I did use three points made in vex and used bbox of them to size the flanges and bolts for the extrude distance etc.

the problem is I am starting to chase my tail with fix after fix after fix as each way has its own issue.

all I need is to revolve with a set radius to the pipe diameter but some of the bends can max out as spesific angles all this is set in my first detail vex.

I will maybe just use the revolve and set sizes on it using the bbox of the disks profiles multiply by something just makes life difficult thought someone would know how I could revolve my profile in VEX so I can keep things clean
User Avatar
Member
4532 posts
Joined: Feb. 2012
Offline
Getyamamout
Hay guys

Once again I face the issue of having loads of useful attributes that can't be accessed with simple nodes and need another work around.

I need to know how to wright a revolve function using vex so I can access the attributes.

I have a pipe profile that has different radius and angles that can be set.
I first started with the revolve but ended up with loads of them going through switches but it worked well.
I changed this to use a sweep along a curve to have more control but this causes other issues with alignments because of the normals so my bolts and flanges would move if resampling the curve.
I have now had to change the spawning of the flanges to use points but when changing them to a weld there is a gap between pipes when using the sweep as the angles don't come out correctly.

I just need a VEX revolve function but can't find anything on it in the docs?

You just have to break it down and implement it in the best possible way.

You can start by taking the axis direction and origin to align the geometry to a specific direction like +X, and then using divisions, start/end angles, revolve type, start creating the points and then the faces.

Once you have the basic operation working, you can start adding more features that you need. Just make sure to plan all the features you need in advance so you don't use an approach that will be hard to modify to accommodate the new features later on.

I did this for the Subdivide SOP in my VEX course and it takes a lot of planning, testing and optimization to get it to the same level in features and performance to be usable in production:

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
42 posts
Joined: Dec. 2020
Offline
You just have to break it down and implement it in the best possible way.

You can start by taking the axis direction and origin to align the geometry to a specific direction like +X, and then using divisions, start/end angles, revolve type, start creating the points and then the faces.

I understand the principle but How do I "revolve"? in vex. I can send my shape into input 0 and info from the other vex with all the sizes and angles into input 1 etc... But can Someone give me that one line of code to actually do the revolve as I can't find any docs on doing it
User Avatar
Member
4532 posts
Joined: Feb. 2012
Offline
Getyamamout
You just have to break it down and implement it in the best possible way.

You can start by taking the axis direction and origin to align the geometry to a specific direction like +X, and then using divisions, start/end angles, revolve type, start creating the points and then the faces.

I understand the principle but How do I "revolve"? in vex. I can send my shape into input 0 and info from the other vex with all the sizes and angles into input 1 etc... But can Someone give me that one line of code to actually do the revolve as I can't find any docs on doing it

It's not a single line of code. You have to implement the entire logic in VEX. There is no shortcut

Maybe you are thinking of node verbs? There is no verb for revolve as it's an HDA.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
480 posts
Joined: July 2005
Offline
Here is an example for a revolved surface using VEX.

Attachments:
revolve_VEX_function.hipnc (120.0 KB)

User Avatar
Member
42 posts
Joined: Dec. 2020
Offline
@P = revolve(uv, chv('C'), normalize(chv('axis')), 2*PI*chf('angle'));

This was the part I was looking for I could not find anything on it anywhere.

Thank you Very much. @Aizatulin
  • Quick Links