Jump to content
hopbin9

How to create a spiral curve in SOP?

Recommended Posts

Hi,

I need a line that spirals. Wish Houdini had a richer set of primitive objects to work with.

Anyone know how to create a spiral and control the turns and radius?

Thanks,

Share this post


Link to post
Share on other sites

I know using point sop and a simple expression for position you can do it easily! I don't think there's a built-in tool for it. I don't have access to Houdini on this machine, I can make a file for later and upload it here.

Share this post


Link to post
Share on other sites

Because everyone loves VOPs and lots of controls, here's a take on a helix (spiraling line) with a bunch of controls for radius, length, number of turns, offset and orientation. I built one a long time ago but couldn't find it so I quickly remade it.

helix.hip

  • Like 2

Share this post


Link to post
Share on other sites

Cheers Graham, with some tweaks and modifications it works great to make curly hair with :)

Share this post


Link to post
Share on other sites

Thanks!  Another satisfied customer!

 

 

D'oh - is it screwing up the tumbling in the perspective viewport?   Now that I have the spiral in my scene, it seems like the space bar-middle-mouse motion is 90 degrees off from what it should be.  Is there a quick-fix for that?  Still, nice spiral.  :)

Edited by johnLIC

Share this post


Link to post
Share on other sites

vex version

  • create attribute wrangle , connect nothing
  • run over > detail(only once)
  • add below code
//create parameters;
float turns  = ch("turns");
float length = ch("length");
int   count  = chi("point_count");
vector pos;
float mask;
float rad;
float radRamp;
float radmult = ch("rad");

pos = 0;

for (int n; n<count ; n++){
    mask = (n/float(count));
    radRamp = chramp("radius_ramp",mask);
    radRamp = fit(radRamp,0,count,0,1);
    rad = radRamp * radmult * 1000;
    pos = set(sin(mask*turns)*rad,-cos(mask*turns)*rad,mask*length);
    addpoint(0,pos);
}

 

  • create add sop set to polygon > by group

Thanks!

  • Like 2

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

×