Variable binsize to fixed outputs

Merry Christmas to everyone and how to avoid slice-repeating in spread and enable to output NIL slices?

VariableBinSize_to_Fixed Outputs.v4p (32.3 kB)

Hello, why do you need to output NIL values?
In this patch I simulate empty slices, maybe is useful.

fordimix.v4p (31.5 kB)

Hi DIMIX

Have a look at Occurrence (value) and Sift (value) nodes they are very helpful for those situations.

@h99: I need output of empty slices dealing with as e.g. contour data.
(btw is there a difference between NIL and empty slice?)
i did not know how to generate spread of empty slices, but your spreading stallone make it. thanks alot
@colorsound: I dont think my workaround with comparing equal slices is elegant and will work in all situations, when my output spreadcount must be equal to input spreadcount

There is a difference depending on what you need to do, I guess.
Data analysis is one thing, instead if you need to return any data, is another scenario.
If you need to send something to a renderer, then you simply send empty string -no space, no text, simply nothing - or alpha = zero color or…

happy new year everybody!
hi dimix!

i guess we never introduced the term empty slice, however it is something that can be expressed with those things called spreads of spreads, where the inner spreads are also named bins at times…

so take some random operation that operates on such a spread of bins.

let’s have a look at + (Spectral).
it adds up all values within one bin.

lets’s textually write down an example of such a spread of bin structure:
( (1,2), (), (1) )
this is spread of 3 bins. the middle bin is an empty spread and from the perspective of the outer spread can also be called empty slice as you did.

so looking at the + spectral again, the second pin (BinSize) is just there to help out with creating that Input structure on the fly.
so when thinking about all these spreads of spreads (being able to cointain “empty slices”) we always have both the creation of such a structure at very same point in our patch as the usage of that just created data. But sometimes it is helpful to think of these two things (creation and usage) as two diffferent things.

now in your example you want to have an unzip that is able to output empty spreads. and you want to have some spread as input that can contain emtype slices. well then, just have a look at bin versions of unzip and create your empty slices, which are basically just bins with size 0.

one way of feeding both input and binsize pins is illustrated in the attached patch, but this probably is already one certain usage. basically the answer to our intial question should be: just use the bin version of unzip.

sngreg

VariableBinSize_to_Fixed Outputs.v4p (15.0 kB)

another way of saying the above short:

you already figured that your empty spreads on the output side of unzip somehow imply empty slices on the input side of unzip.

so you need to encode that emtpy slice info. i guess using the bin feature is a way of doing that encoding which will work for all datatypes in the same way. if have a value take binsize 1, if you dont take binsize 0.

for textual coders: with being able to express the absence of a value, this is pretty much comparable to Nullable, Maybe or reference types in general …

hi gregsn,
thanks for explanation.
i thought there is a simple way, making logic what i need:
i have three fixed “slots” - first value is going to 1st slot (and nowhere else),
IF 2nd value appears, it’s going to 2nd slot (and nowhere else), etc.
but of course binsize 0 will do the trick and output empty slice
P.S. i never used the bin version of unzip before 2014 :)