Jump to content
Krion

How to have one line cut off a line and have it continue below it?

Recommended Posts

Hi,

I am wondering how you would do something like this. How would you get a line with one length parameter, that has a constraint after which it can go no further, and then it continues below, like a little 'paragraph', so you could create variations of that line on different 'cards'.

5d8560f3abcb2_Screenshot2019-09-21at01_28_26.thumb.png.35e83b1e09585bf3c9e0c47b8d0b351e.png

Would really like to know how you could do something like that.

 

Thanks :) 

 

Share this post


Link to post
Share on other sites

while easily possible without coding, I just did a quick wrangle

vector startP = chv("startP");
float width = chf("width");
float spacing = chf("spacing");
float length = chf("length");

int nlines = ceil(length/width);
for(int i=0; i<nlines; i++){
    float linewidth = min(length - i*width, width);
    vector linestartP = startP + {0,-1,0}*spacing*i;
    int pt0 = addpoint(0, linestartP);
    int pt1 = addpoint(0, linestartP + {1,0,0}*linewidth);
    addprim(0, "polyline", pt0, pt1);    

}

 

ts_paragraph_line.hip

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Ok, here comes the nice and simple SOP solution:

  • Segment the input line with a polycut node.
  • Align the segments with a primitive node.
  • Assign letters with another primitive node. 

image.png.30d02a4a873a04aea14afbf85c4f5604.png

paragraph.hipnc

Edited by konstantin magnus
  • Like 1

Share this post


Link to post
Share on other sites

Super crazy shit guys.. too awesome. :) Glad to be on the path of learning Houdini.

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

×