### Distribute Random Pscale

6008   5   2
Member
230 posts
Joined: Oct. 2009
Offline
I have a surface where points have been scattered uniformly and I would like to distribute the pscale in a random function but the sum of them will not overcome the area of the surface including a gap between them.

(pscale_sum + gap) <= area_sum

Any ideas?
Member
228 posts
Joined: Dec. 2012
Offline
Hi, the attached example should do this.

The general idea is that you measure the area with a measure SOP, then feed that into a VOPSOP. In the VOPSOP you use (area+gap)/numPoints as a multiplier to set your range on the random number output. Gap is a parameter on the VOPSOP, so you can change the value there.

The result is that you get a combined pscale < area+gap. There is no guarantee that the combined pscale is close to area+gap, but it will always be less than.

Let me know if you have any questions

Attachments:
pscaleDemo.hip (82.3 KB)

Member
230 posts
Joined: Oct. 2009
Offline
I am afraid it wasn't what I had in mind. I want to give a number of points and a gap and the vopsop be able to distribute the pscale the available area to all the points randomly, in order to use the maximun possible space taking in count all the above variables.

In your fhip file the sum of the area is 10000 and the pscale sum of 500 points is 60. The goal is not to only to be 60 < 10000 but also as close as possible to that. The gap was 0.
Member
229 posts
Joined: May 2006
Offline
hm, not sure what you want to do, i see 2 options:

1) you have an area that you want to cover evenly with points, so you have minimum gaps & even distribution of points

is any of this what you're looking for ?

Seb
Member
230 posts
Joined: Oct. 2009
Offline
Infernalspawn is closer to the latter. I have a geometry and i want scatter a number of points and as you said, distribute the best RANDOM pscale on to these points to minimize the gaps. The number of points are not that important, can be few less or more. This is the effect I am after

cheers
Member
112 posts
Joined: Feb. 2010
Offline
Will this help?

Attachments:
random_pscale.hipnc (178.2 KB)