This gives the RT querying (kr) the same behaviour than the NRT, when radius=0 returns all up to k, and k=0 returns all in radius.
the size of the output buffer is a hard cap on the number of points returned.
the KR out is the number of valid points in the buffer.
test code:
a = Dictionary.newFrom([\cols, 3, \data, Dictionary.newFrom(4.collect{|i|[i.asSymbol, i.dup(3)]}.flatten)])
d = FluidDataSet(s)
d.load(a)
d.print
b = Buffer.alloc(s,6)
c = Buffer.alloc(s,3)
k = FluidKDTree(s)
k.fit(d)
x= {arg nb = 1, radius = 0; var poke = Impulse.kr(1); k.kr(poke,c,b,nb,radius).poll(poke); FluidBufToKr.kr(b).poll(poke); Silent.ar();}.play
c.sendCollection(1.5.dup(3)) //try on the spot, and without. fun
x.set(\nb, 0)
x.set(\radius, 0.01)
This gives the RT querying (kr) the same behaviour than the NRT, when radius=0 returns all up to k, and k=0 returns all in radius.
the size of the output buffer is a hard cap on the number of points returned.
the KR out is the number of valid points in the buffer.
test code: