konstantin magnus Posted February 16, 2019 Share Posted February 16, 2019 I am trying to fit a 2d mesh between 4 curves. Pretty much what the skin SOP does but potentially with a custom mesh. vector bbox = relbbox(0, v@P); function vector blerp(vector a, b, c, d; float x, y){ vector lr = a * (1.0 - x) + b * (x); vector tb = c * (1.0 - y) + d * (y); return 0.5 * (lr + tb); } vector p0 = primuv(1, 'P', 0, bbox.z); vector p1 = primuv(1, 'P', 1, bbox.x); vector p2 = primuv(1, 'P', 2, bbox.z); vector p3 = primuv(1, 'P', 3, bbox.x); v@P = blerp(p0, p2, p1, p3, bbox.x, bbox.z); How can I smoothly interpolate the point positions so the borders actually touch the curves? blerp.hiplc Quote Link to comment Share on other sites More sharing options...
Aizatulin Posted February 16, 2019 Share Posted February 16, 2019 (edited) Hi, here is an approach using linear blend for profile curves and transforming them onto the rail curves. blerpS.hipnc Edited February 16, 2019 by Aizatulin Quote Link to comment Share on other sites More sharing options...
petz Posted February 17, 2019 Share Posted February 17, 2019 the attached file shoud do the trick. hth. petz blerp_1.hiplc 5 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted February 24, 2019 Author Share Posted February 24, 2019 (edited) Thank you @petz! I can see myself creating procedural cars with this! * once I have found an elegant way to shape the guide curves and solved a bunch of other problems ; ) Edited February 24, 2019 by konstantin magnus Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted August 14, 2019 Author Share Posted August 14, 2019 Broken down into more comprehensible steps: vector uv = relbbox(0, v@P); vector crv_0 = primuv(1, 'P', 0, uv.z); vector crv_1 = primuv(1, 'P', 1, uv.x); vector crv_2 = primuv(1, 'P', 2, uv.z); vector crv_3 = primuv(1, 'P', 3, uv.x); vector start_0 = primuv(1, 'P', 0, 0); vector start_2 = primuv(1, 'P', 2, 0); vector end_0 = primuv(1, 'P', 0, 1); vector end_2 = primuv(1, 'P', 2, 1); vector ipol = lerp(crv_0, crv_2, uv.x); ipol += lerp(crv_1, crv_3, uv.z); vector fit_0 = lerp(start_0, end_0, uv.z); vector fit_2 = lerp(start_2, end_2, uv.z); v@P = ipol - lerp(fit_0, fit_2, uv.x); 2 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.