Creating variable length linestrips from points

Hi there,

I have a set of points with an attribute ‘LineIndex’ that describes which line it belongs to. Now I want to create (copy) linestrips and connect all those points. The linestrips have a variable length however (some have 5 points, some 300). Is there a way to achieve this?
Only way I’m thinking is to create all possible linestrips with the maximum amount of points and only use the ones needed, but this gives quite an overhead.
Any ideas ? :smiley:

Cheers,
tim

Hello @timgerritsen
You could use a Topology POP and feed in the line strips information to create the primitives. You will probably need GLSL POPs to prepare the linestrip information.
In GLSL/GLSLPOPs_Update.toe in the samples, in LineStrips, there’s an example showing how this can be done.

1 Like

There might be an easier way with line break, see attached, let us know if you have any question!

LineStripsByAttrib.toe (6.4 KB)

2 Likes

Here is one more way plus 2 related techniques. Yes we need a new option in Line Break POP to make this easy. And better ways to get attributes of other points when doing math.

LineStripsByAttribFourWays.5.toe (13.0 KB)

2 Likes

Thanks greg! Looks very clear and easy! No need to change anything in my opinion.

@greg

“then in Math Mix compare LineIndex to priorlineindex - 0 or 1.
which is what Line Break POP needs.”

just want to clarify this is exactly what Line Break already does when using “By Distance Threshold” which is the example I shared, no need for math mix
We’re using a 1d integer attribute, so Distance > 0.5 just means a different integer value

Capture

we can make it a bit more straightforward, replace “by Distance Threshold” toggle with a menu, second entry “by attribute”, and disable Distance Threshold in that case.

I’ll log it internally

1 Like