bobbybob Posted December 16, 2020 Share Posted December 16, 2020 Hi. I have a curve that has one sharp bend. I want to smooth/relax the bend, without smoothing the rest of the curve in a procedural way. Is it possible somehow to smooth the curve based on curvature. The two images show how the curve is now, and how I could like the sharp edge to look (correct) curve_example.hip Quote Link to comment Share on other sites More sharing options...
Librarian Posted December 16, 2020 Share Posted December 16, 2020 (edited) Resample Sop- resample by Polygons Edge-Maximum Segments- Treat Polygons As Subdivision Curves @bobbybob Sorry for the quick response earlier Maybe This Also Can by Useful ! Who Knows float maxedgelength = chf("maxedgelength"); int n = npoints(1); // create a polygonal primitive, returns primitive number int polygon = addprim(0,’poly’); //run over the points of the spherical curve for(int i=0; i<n; i++){ vector currT = attrib(1,’point’,’P’,i); vector nextT = attrib(1,’point’,’P’,(i+1)%n); float edgelength = acos(dot(currT,nextT)); vector B = normalize(cross(currT,nextT)); int d = floor(edgelength/maxedgelength); if(d!=0) edgelength/=d; vector4 q = quaternion(edgelength, B); // add subdivision points vector T_tilde = currT; do{int point = addpoint(0,T_tilde); addvertex(0,polygon,point); T_tilde = qrotate(q,T_tilde); d--;}while(d>0); } Smth.hiplc Edited December 18, 2020 by Librarian 1 Quote Link to comment Share on other sites More sharing options...
bobbybob Posted December 18, 2020 Author Share Posted December 18, 2020 Hi @Librarian thank you so much for the answer! I ended up with a ghetto solution relative to your answer I used a measure node, to get the "curvature -> to group -> expanding group -> blasting points -> smoothing" curve_example_ghetto_solution.hip 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.