Randomize Resample

   5154   5   1
User Avatar
Member
164 posts
Joined: Feb. 2014
Offline
Is there a way to randomise the Length field in the Resample SOP?
I've got a bunch of curves radiating out and I want to have a random resample distance per point.

What I have done is oversample it and then delete points randomly but this creates loads of extra geo and is still somewhat random.

The length of the curves changes so using Density in Scatter doesn't do the trick. I want to utilise the resample distance so I have a more or less stable number of points per area.

Thanks
Simon
http://simonfarussell.com [simonfarussell.com]
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
How about moving the points after you have created them?
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
164 posts
Joined: Feb. 2014
Offline
Konstantin Magnus
How about moving the points after you have created them?

That would certainly be an option. How would I go about doing that?
They can't just jitter, they'd need to stay on the curve.

I can imagine you could create a UV for the curve, measure where the point is then offset a little but not quite sure technically what this would look like.
Edited by Simon Russell - Feb. 16, 2017 04:46:28
http://simonfarussell.com [simonfarussell.com]
User Avatar
Member
8549 posts
Joined: July 2007
Online
point wrangle
then create needed parms

there is sample geo parm to optionally sample other geo than the first input
so if your curve in first input is already resampled polygon, then the offset points will follow this linear polygonal edges
therefore you can plug smooth NURBS version to second input and set samplegeo to 1 to sample that instead

int samplegeo = chi("samplegeo");
float uoffset = chf("uoffset");
int seed = chi("seed");
int pid; vector puv;
xyzdist(samplegeo, @P, pid, puv);
uoffset *= fit01(random(set(@ptnum, seed,0)), -.5, .5);
puv.x = (puv.x + uoffset) % 1;
v@P = primuv(samplegeo, "P", pid, puv);
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
475 posts
Joined: July 2005
Offline
Hi,
here is another approach. I've tried to generate a uniform distributed random sample between 0 and 1, which can be sorted by size and can be used for mapping onto the curve after that. With the ramp you can have a bit control over the distribution.

Attachments:
Resample.hipnc (93.1 KB)

User Avatar
Member
164 posts
Joined: Feb. 2014
Offline
Thanks very much Aizatulin and Tomas. I've only just had to jump back on this but both approaches work, in the end Tomas' seems to suit my needs the best. But much appreciated.
http://simonfarussell.com [simonfarussell.com]
  • Quick Links