{"id":577,"date":"2022-05-11T19:02:20","date_gmt":"2022-05-12T02:02:20","guid":{"rendered":"http:\/\/fx-td.com\/houdiniandchill\/?p=577"},"modified":"2022-05-11T19:09:34","modified_gmt":"2022-05-12T02:09:34","slug":"archived-post-by-profbetis-5","status":"publish","type":"post","link":"http:\/\/fx-td.com\/houdiniandchill\/2022\/05\/11\/archived-post-by-profbetis-5\/","title":{"rendered":"Archived post by profbetis"},"content":{"rendered":"<p class=\"\">made a neat lil vex thing. Takes a sloppy hand-placed input curve and straightens it up for you on major axes. Doesn&#8217;t support diagonal lines yet. Has one control for maintaining segment length (as opposed to picking the closest spot to the original vertex position). Runs as a prim wrangle.<br \/>\n&#8220;`c int points[] = primpoints(0, @primnum); vector prev_pos = point(0, &#8220;P&#8221;, points[0]); foreach( int idx; int pt; points[1:] ){     vector this_pos = point(0, &#8220;P&#8221;, pt);     vector dir = normalize(this_pos &#8211; prev_pos);     float dist = distance(this_pos, prev_pos);          \/\/ Determine dominant direction axis     vector new_dir;     vector abs_dir = abs(dir);     if( abs_dir.x > abs_dir.y ){         if( abs_dir.x > abs_dir.z ) new_dir = sign(dir.x)*{1,0,0};         else                        new_dir = sign(dir.z)*{0,0,1};     } else {         if( abs_dir.y > abs_dir.z ) new_dir = sign(dir.y)*{0,1,0};         else                        new_dir = sign(dir.z)*{0,0,1};     }          int maintain_length = chi(&#8220;maintain_length&#8221;);     vector new_pos = prev_pos + new_dir*dist;     if( !maintain_length ) new_pos *= dot(dir, new_dir);          setpointattrib(0, &#8220;P&#8221;, pt, new_pos);          prev_pos = new_pos; }&#8220;`<\/p>\n<p class=\"\">finally got to use the dot product for something other than checking if two vectors point in the same direction! <:cross_gang:863101157307449365><\/p>\n<p>Attachments in this post: <br \/><a href=\"http:\/\/fx-td.com\/houdiniandchill\/wp-content\/uploads\/discord\/20220205\/11\/22\/unknown.png\">http:\/\/fx-td.com\/houdiniandchill\/wp-content\/uploads\/discord\/20220205\/11\/22\/unknown.png<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>made a neat lil vex thing. Takes a sloppy hand-placed input curve and straightens it up for you on major axes. Doesn&#8217;t support diagonal lines yet. Has one control for maintaining segment length (as opposed to picking the closest spot to the original vertex position). Runs as a prim wrangle. &#8220;`c int points[] = primpoints(0, &hellip; <a href=\"http:\/\/fx-td.com\/houdiniandchill\/2022\/05\/11\/archived-post-by-profbetis-5\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Archived post by profbetis<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/577"}],"collection":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/comments?post=577"}],"version-history":[{"count":0,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/577\/revisions"}],"wp:attachment":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/media?parent=577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/categories?post=577"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/tags?post=577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}