how to use attribute randomize with length(dist) from curves

   401   5   1
User Avatar
Member
30 posts
Joined: 1月 2012
Offline
hello
i am using the copy to points to scatter some curves on my grid.
the problem is id like them to have random sizes. i can easily do this if i place a attribrandomize pscale into the grid points, but id actually prefer to use the length parameter instead(as im giving it thickness later i want all my curves tgo have same thickness)

sadly for some reason doesnt look like (dist) is working...

another question i have related to this is i also want to multiply my number of points from each curve by the length(so to ensure id get an even ammount of points even if the curves are way longer than others

please help!

thanks

Attachments:
help.JPG (35.8 KB)

User Avatar
Member
31 posts
Joined: 8月 2012
Online
For the first problem, you can always reset pscale after the copy to make sure they all have the same value.
Alternatively you can simply cache pscale value in another attribute, then rename that back to pscale when you need it.
e.g. in a point wrangle, f@thickness = @pscale;
Use a resample SOP for the second problem - Maximum Segments will force all lines to have the same number of segments
User Avatar
Member
30 posts
Joined: 1月 2012
Offline
thanks this works great. but for learning purposes, if i actually wanted to override something as "dist" or some of the other parameters, it should be possible using the att randomize, right?
User Avatar
Member
555 posts
Joined: 2月 2017
Offline
so why not upload your file so ppl can help you ?

Attachments:
length.jpg (139.2 KB)

User Avatar
Member
31 posts
Joined: 8月 2012
Online
mulafraga
thanks this works great. but for learning purposes, if i actually wanted to override something as "dist" or some of the other parameters, it should be possible using the att randomize, right?

You can override pretty much any attribute you want. However, "pscale" is a special (scalar) attribute used by Houdini to apply scale on points. If you wanted your lines to use the "dist" attribute for length instead, I would suggest using a small for loop running over points, as in the example attached.

Other methods like using wrangle or VOP to build geometry are also possible, but in the simple case this should be sufficient.
Edited by Jikian - 2021年6月15日 22:41:52

Attachments:
copy_to_points_example.hiplc (166.9 KB)

User Avatar
Member
30 posts
Joined: 1月 2012
Offline
Jikian
op running over points, as in the example attached.
thank you so much!
  • Quick Links