{"id":743,"date":"2023-12-04T07:24:38","date_gmt":"2023-12-04T15:24:38","guid":{"rendered":"http:\/\/fx-td.com\/houdiniandchill\/?p=743"},"modified":"2023-12-04T07:33:06","modified_gmt":"2023-12-04T15:33:06","slug":"archived-post-by-mattiasmalmer-10","status":"publish","type":"post","link":"http:\/\/fx-td.com\/houdiniandchill\/2023\/12\/04\/archived-post-by-mattiasmalmer-10\/","title":{"rendered":"Archived post by mattiasmalmer"},"content":{"rendered":"<div class=\"postie-post\">\n<p class=\"\">sometimes xyzdist() is not really what you want when you want to get distance from the edge of a font and so on because you get all these rounded corners. i wrote a quick wrangle that gives you the same type of sharp distance that an inset would give you:<\/p>\n<p class=\"\">&#8220;` int numprims=nprimitives(1);<br \/>\nfloat dist=10000000000000000000; for (int i=0; i<numprims;i++) {     int pnts[]=primpoints(1,i);          int pt0=pnts[0];     int pt1=pnts[1];          \/\/ outerpts     int pt2=-1;     int pt3=-1;          int neipt0[]=neighbours(1,pt0);     pt2=neipt0[0];     if (neipt0[0]==pt1)      {         pt2=neipt0[1];     }          int neipt1[]=neighbours(1,pt1);     pt3=neipt1[0];     if (neipt1[0]==pt0)      {         pt3=neipt1[1];     }               vector p0=point(1,\"P\",pt0);     vector p1=point(1,\"P\",pt1);          vector p2=point(1,\"P\",pt2);     vector p3=point(1,\"P\",pt3);          vector dir=p1-p0;          vector <a href=\"mailto:pp=v@P-p0\" >pp=v@P-p0<\/a>;               if (dot(normalize(-normalize(p3-p1)+normalize(p0-p1)),<a href=\"mailto:v@P-p1\" >v@P-p1<\/a>)>=0)     {         if (dot(normalize(-normalize(p2-p0)+normalize(p1-p0)),pp)>=0)         {             dist=min(dist,(length(cross(pp,dir))\/length(dir)));         }     }<br \/>\n}<br \/>\n@dist=dist; &#8220;`<\/p>\n<p class=\"\">(the second input is a &#8220;convertline&#8221; of the font)<\/p>\n<p>Attachments in this post: <br \/><a href=\"http:\/\/fx-td.com\/houdiniandchill\/wp-content\/uploads\/discord\/20232412\/04\/23\/houdinifx_CuEDfyQLMW.gif\">http:\/\/fx-td.com\/houdiniandchill\/wp-content\/uploads\/discord\/20232412\/04\/23\/houdinifx_CuEDfyQLMW.gif<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>sometimes xyzdist() is not really what you want when you want to get distance from the edge of a font and so on because you get all these rounded corners. i wrote a quick wrangle that gives you the same type of sharp distance that an inset would give you: &#8220;` int numprims=nprimitives(1); float dist=10000000000000000000; &hellip; <a href=\"http:\/\/fx-td.com\/houdiniandchill\/2023\/12\/04\/archived-post-by-mattiasmalmer-10\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Archived post by mattiasmalmer<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[],"_links":{"self":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/743"}],"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=743"}],"version-history":[{"count":0,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/743\/revisions"}],"wp:attachment":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/media?parent=743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/categories?post=743"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/tags?post=743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}