MildlyRedBeard Posted April 10, 2020 Share Posted April 10, 2020 No one's asked for this (as far as I'm aware) but I thought I'd share anyway. Its a real basic method of carving a poly line base off of a uv attribute INSTEAD of using parametric uvs. This has the nice advantage of 1) allowing for all lines to grow at the same speed and 2) allowing for super easy adjustments, offsets and what not just by modifying the attribute. I wanted to share because I couldn't really find a simple way of doing this. All the other methods demanded parametric uvs. Not sure if I've missed something super obvious but wanted to share anyway. Hopefully there's something in here that'll help someone. carve_by_uv_attribute.hipnc 2 Quote Link to comment Share on other sites More sharing options...
Noobini Posted April 10, 2020 Share Posted April 10, 2020 so it carves by absolute length right ? Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted April 10, 2020 Share Posted April 10, 2020 I think you could also run this in a primitive wrangle: #include <groom.h> float dist = chf('distance'); float perimeter = primintrinsic(0, 'measuredperimeter', i@primnum); float dist_cut = clamp(dist, 0.0, perimeter); adjustPrimLength(0, i@primnum, perimeter, dist_cut); @mawi originally came up with this here: https://forums.odforce.net/topic/19626-carving-multiple-curves-by-attribute-hip-file-attached/ grow_curves.hipnc Quote Link to comment Share on other sites More sharing options...
petz Posted April 10, 2020 Share Posted April 10, 2020 there's also the primuvconvert() function in vex which can be used to carve/cut curves by absolute length. Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted April 10, 2020 Share Posted April 10, 2020 2 hours ago, petz said: there's also the primuvconvert() function in vex which can be used to carve/cut curves by absolute length. I too was fiddling around with primuvconvert() a bit. But how would you do the actual cutting? Quote Link to comment Share on other sites More sharing options...
anim Posted April 10, 2020 Share Posted April 10, 2020 here are some examples of carving by attribute, in my example it's using Clip SOP, but there are others 2 Quote Link to comment Share on other sites More sharing options...
Librarian Posted April 10, 2020 Share Posted April 10, 2020 maybe this example can be modified . to carve and Cut.. f@cl = primuvconvert(@OpInput1, 1, 0, 8)[0]; SmygiTe.hipnc Quote Link to comment Share on other sites More sharing options...
Noobini Posted April 10, 2020 Share Posted April 10, 2020 and here's one for non-VEXers, extremely simple setup, didn't even clamp it. vu_carvebyDist_NonVEX.hiplc Quote Link to comment Share on other sites More sharing options...
anim Posted April 11, 2020 Share Posted April 11, 2020 13 minutes ago, Noobini said: and here's one for non-VEXers I'd say Clip SOP is pretty nonvexy, also should be much faster than foreach carve https://forums.odforce.net/topic/45517-carve-line-by-uv-attribute-not-parametric-uvs/?tab=comments#comment-213572 Quote Link to comment Share on other sites More sharing options...
Noobini Posted April 11, 2020 Share Posted April 11, 2020 32 minutes ago, anim said: I'd say Clip SOP is pretty nonvexy, also should be much faster than foreach carve https://forums.odforce.net/topic/45517-carve-line-by-uv-attribute-not-parametric-uvs/?tab=comments#comment-213572 yeah but yours still requires a bit of brain power to understand tho...while mine is a NO brainer Quote Link to comment Share on other sites More sharing options...
Aizatulin Posted April 11, 2020 Share Posted April 11, 2020 The clip SOP method is nice. I've tried to rebuild something similar using prim wrangles comparing attributes values (only for points), but I'm not sure if this will work for every case (the prim/point numbers are different, but the result looks similar). It is hard to get faster than clip sop. carve_attribute_.hipnc 1 Quote Link to comment Share on other sites More sharing options...
Librarian Posted April 11, 2020 Share Posted April 11, 2020 @Aizatulin thanx for claver "again" a solution ...endless possibility for mine curves. 1 Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted April 11, 2020 Share Posted April 11, 2020 I guess most tds have created their own solutions and its a shame that the carve doesnt support per prim attributes for carving, and when i first started using houdini i remember that was frustrating. I guess thats also why it became one of my first otl/hda aswell. I first started using the primuv function, but as stated here, when curves have uneven segment-lengths the result doesnt look that great. So uvsample is the way to go in my opinion. Havent tried the clip approach, so its hard to compare speeds in a good way. So i put up a test with default clip, no other magic and compared. In my test i had two clip nodes, i guess you can get away with one and get some speed there. Clip wins if i delete points and transfer attributes. If i dont delete points or transfer attributes i get a good increase in speed. But i guess clip would be faster with only one clipnode instead of two. So if somebody have created a good clip carve, it would be nice to compare speed. Clip_vs_Carve_01.hiplc Quote Link to comment Share on other sites More sharing options...
Aizatulin Posted April 11, 2020 Share Posted April 11, 2020 And why not just using @curveu from resample for the clip method (similar to anims examples)? clip_carve.hipnc 1 Quote Link to comment Share on other sites More sharing options...
Librarian Posted April 11, 2020 Share Posted April 11, 2020 Clip_vs_Carve_01_vs_Librarien.hipnc 1 Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted April 11, 2020 Share Posted April 11, 2020 3 hours ago, Aizatulin said: And why not just using @curveu from resample for the clip method (similar to anims examples)? clip_carve.hipnc Because curveu doesnt give a precise value when created by a resample sop. It works best when all the points have an even distribution, but still then it would be "incorrect" in the ends because of the even last segment. You dont have to resample with the resample node, you can just generate curveu if you want. So if you try with a curve that have uneven length between the points, you would see that your carving is "jumping" up and down in speed. This would be solved by making a curveu value that has the correct length between the points. Even in Anims case that would fix the uneven carve. But that example doesnt include carving a curve from both ends, and i guess its just pushing the other end of the curve down into the clip plane. Here i compare it to the carve-sop that use parametric-uvs. The same problem will occure with the @curveu attribute created by the resample-sop. Top is carve-sop, the bottom is carveing with uvsample. Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted April 11, 2020 Share Posted April 11, 2020 4 hours ago, Librarian said: Clip_vs_Carve_01_vs_Librarien.hipnc I guess you won the performace editor, you came up on the top Quote Link to comment Share on other sites More sharing options...
Aizatulin Posted April 11, 2020 Share Posted April 11, 2020 @ThomasPara To make the speed constant you can resample again and get the u-value with xyzdist() or you accumulate over distances between each neighbours. clip_carve_const_speed.hipnc Quote Link to comment Share on other sites More sharing options...
anim Posted April 11, 2020 Share Posted April 11, 2020 or just use Edge Transport SOP to get the distance along curve 1 Quote Link to comment Share on other sites More sharing options...
petz Posted April 11, 2020 Share Posted April 11, 2020 (edited) On 10.4.2020 at 6:32 PM, konstantin magnus said: I too was fiddling around with primuvconvert() a bit. But how would you do the actual cutting? please take a look at the attached file. one example is using primuvconvert() to cut by distance the other is using an attribute. i didn’t do much testing but it should be relatively fast. hth. petz cut_curve.hipnc Edited April 11, 2020 by petz 2 1 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.