Jump to content

PolyExtrude in VEX


Recommended Posts

  • 2 weeks later...

Hi Ryuji, you can inset a polygon or polyline with these steps:

vector next = normalize( point(0, 'P', (@ptnum + 1) % @numpt) - v@P ); 
vector prev = normalize( v@P - point(0, 'P', (@ptnum - 1) % @numpt) ); 

vector avg  = normalize(next + prev);
vector up   = normalize( abs(cross(prev, avg)) );
vector in   = cross(avg, up);
float dist  = dot(next, avg);
vector dir  = in / dist;

v@P += dir * chf('extrude'); 

Kim Goossens discusses this here: https://www.youtube.com/watch?v=tnDqwcNG20Y

  • Like 1
Link to comment
Share on other sites

Hey Konstantin,


Thank you so much for this. It's really interesting.

I wanted to make a compilable version of polyextrude, but in the end, I used the polyextrude sop with local attributes (zscale, etc...).

My attempt at a compilable polyextrude was like 3 times slower than the normal one.


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.

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...