Ryuji Posted February 2, 2019 Share Posted February 2, 2019 Hi, I've been wondering if anyone tried to recreate the polyextrude sop in vex? I'm particularly interested in the inset function of the sop, and how one would go about recreating this in vex. Any ideas? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted February 13, 2019 Share Posted February 13, 2019 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 1 Quote Link to comment Share on other sites More sharing options...
Ryuji Posted February 13, 2019 Author Share Posted February 13, 2019 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.