Jump to content

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


Krion

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 :) 

 

Link to comment
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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...