Possible Bug - Resample Op by Distance
#1
G'Day

I think there is an issue, the help file says resample by distance threshold setting will be the min distance between two particles.  By my maths, you are taking the distance and dividing by the threshold and creating that number of resampled particles between two sibling particles. This always results in 1 extra spacing and thus the particles are not actually spaced by distance but spaced by division.

to me the maths should be:  (distance between two siblings / threshold) - 1, this would result in minimum threshold distance being achieved.

See attached video.

Rob


Attached Files
.mp4   resample question.mp4 (Size: 36.27 MB / Downloads: 14)
  Reply
#2
It's not that the math is wrong...I think you're just misinterpreting the docs.

You are correct, the math is basically:

Code:
numNewParticles = distBetweenParticles / threshold

And as the docs say:

Code:
the minimum distance required between two particle pairs before resampling will occur.

Which doesn't imply that the distance between resampled particles will be equal to the threshold, only that a resampled particle will be added if the distance between two particles is at least as great as the threshold.

So take an example of 2 particles spaced 10 units apart with a resample threshold of 10. A single particle would be created (10/10 = 1) between them (as per the docs), whose distance from either originating particle would be 5 units.

Similarly, 2 particles spaced 60 units apart with a threshold of 20 will generate 3 particles (60/20 = 3), despite the fact that the distance between those resampled particles will be 15 as you pointed out.

So basically the assumption that the threshold is the distance between resampled particles is incorrect - it's instead the minimum distance required between 2 particles before they will generate new resampled particles between them.
  Reply
#3
(10-17-2024, 03:47 AM)tyFlow Wrote: It's not that the math is wrong...I think you're just misinterpreting the docs.

You are correct, the math is basically:

Code:
numNewParticles = distBetweenParticles / threshold

And as the docs say:

Code:
the minimum distance required between two particle pairs before resampling will occur.

Which doesn't imply that the distance between resampled particles will be equal to the threshold, only that a resampled particle will be added if the distance between two particles is at least as great as the threshold.

So take an example of 2 particles spaced 10 units apart with a resample threshold of 10. A single particle would be created (10/10 = 1) between them (as per the docs), whose distance from either originating particle would be 5 units.

Similarly, 2 particles spaced 60 units apart with a threshold of 20 will generate 3 particles (60/20 = 3), despite the fact that the distance between those resampled particles will be 15 as you pointed out.

So basically the assumption that the threshold is the distance between resampled particles is incorrect - it's instead the minimum distance required between 2 particles before they will generate new resampled particles between them.

Thanks for the response, but logically it doesn't make sense.
The help implies that its a distance threshold, and the implication would be if I set 20 in the distance threshold then I would at least get a minimum of 20 between the particles.
I mean if you take the resample - originally my two siblings are 60 apart, when I ask to resample at 20 threshold, the distance between those two siblings is 60, so logic says that if I set a minimum threshold distance of 20 I should get 20 at minimum between the newly created (resampled particles). The sub division happens based on a 60 distance between the originally spawned particle siblings.

in my example
setting threshold to 30 min distance results in 20
setting threshold to 20 min distance results in 15
setting threshold to 10 min distance results in 8.57
Setting threshold to 6 min distance results in 5.45

so if you are planning or expecting a certain distance between the resampled particles, you are not going to get what you expect to happen (at least not by distance), I would have to do the maths and then make adjustments to place the resampled particles at the distance I want, rather than just setting the distance and not have to do maths.

I will leave it at that
Rob
  Reply


Forum Jump: