{"id":1005,"date":"2025-08-01T12:22:21","date_gmt":"2025-08-01T19:22:21","guid":{"rendered":"http:\/\/fx-td.com\/houdiniandchill\/?p=1005"},"modified":"2025-08-01T12:28:01","modified_gmt":"2025-08-01T19:28:01","slug":"archived-post-by-sniperjake945-35","status":"publish","type":"post","link":"http:\/\/fx-td.com\/houdiniandchill\/2025\/08\/01\/archived-post-by-sniperjake945-35\/","title":{"rendered":"Archived post by sniperjake945"},"content":{"rendered":"<div class=\"postie-post\">\n<p class=\"\">It&#8217;s probably similar to the clip sop? Here&#8217;s like a paired back version of the code, which will only work for quads (since disney modeling only ever makes full quad meshes with planar quads cuz ptex).<br \/>\n&#8220;`c void march(vector src_p, dst_p; float omega_a, omega_b; int new_pts[];){     if(sign(omega_a) == sign(omega_b)) return;          float m = efit(0, omega_a, omega_b, 0, 1);     if(m < 0 || m > 1) return;              vector np = lerp(src_p, dst_p, m);     int npt = addpoint(0, np);     append(new_pts, npt); }<br \/>\nint pp[] = primpoints(0, @primnum); int new_pts[];<br \/>\nvector p0 = point(0, &#8220;P&#8221;, pp[0]); vector p1 = point(0, &#8220;P&#8221;, pp[1]); vector p2 = point(0, &#8220;P&#8221;, pp[2]); vector p3 = point(0, &#8220;P&#8221;, pp[3]);<br \/>\nfloat omega0 = point(0, &#8220;levelset&#8221;, pp[0]); float omega1 = point(0, &#8220;levelset&#8221;, pp[1]); float omega2 = point(0, &#8220;levelset&#8221;, pp[2]); float omega3 = point(0, &#8220;levelset&#8221;, pp[3]);<br \/>\nmarch(p0, p1, omega0, omega1, new_pts); march(p1, p2, omega1, omega2, new_pts); march(p2, p3, omega2, omega3, new_pts); march(p3, p0, omega3, omega0, new_pts);<br \/>\nif(len(new_pts) > 0){     int new_prim = addprim(0, &#8220;polyline&#8221;, (new_pts)); } &#8220;` now what i will say is that this might be a bit odd for people who are familiar with marching squares. It&#8217;s like even more simplified than normal. but that&#8217;s because our level set attribute in this case corresponds to the dot product between our point normals and the direction to the camera origin. And ideally there&#8217;s never going to be a primitive where that levelset enters and exits through more than 2 edges since that function will be linear across a planar quad. So we don&#8217;t really have to account for multiple crossings.  \ud83d\ude42<\/p>\n<p class=\"\">here&#8217;s an example with just a simple levelset<\/p>\n<p class=\"\">but yeah it&#8217;s effectively just the clip sop with an attribute<\/p>\n<p class=\"\">\ud83d\ude42<\/p>\n<p class=\"\">i used the above code though because it needed to get used in a houdini engine rig for maya artists so i needed everything to be as simple and fast as possible. The biggest bottleneck ended up being the I\/O from maya to houdini engine and back \ud83d\ude41<\/p>\n<p>Attachments in this post: <br \/><a href=\"http:\/\/fx-td.com\/houdiniandchill\/wp-content\/uploads\/discord\/20252208\/01\/25\/image.png\">http:\/\/fx-td.com\/houdiniandchill\/wp-content\/uploads\/discord\/20252208\/01\/25\/image.png<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s probably similar to the clip sop? Here&#8217;s like a paired back version of the code, which will only work for quads (since disney modeling only ever makes full quad meshes with planar quads cuz ptex). &#8220;`c void march(vector src_p, dst_p; float omega_a, omega_b; int new_pts[];){ if(sign(omega_a) == sign(omega_b)) return; float m = efit(0, omega_a, &hellip; <a href=\"http:\/\/fx-td.com\/houdiniandchill\/2025\/08\/01\/archived-post-by-sniperjake945-35\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Archived post by sniperjake945<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[],"_links":{"self":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/1005"}],"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=1005"}],"version-history":[{"count":0,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/1005\/revisions"}],"wp:attachment":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/media?parent=1005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/categories?post=1005"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/tags?post=1005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}