Running multisegments on a matrix's edges

The multisegment pattern is really built for 1D strips. But of course, there are ways around that! If I had to build something fast, in 2D for a reasonable number of pixels (up to 1000 or so), here’s what I’d do:

  • allocate an array with pixelCount elements: segmentData = array(pixelCount)
  • store a segment number for each pixel in the array
  • get rid of all multisegment’s segment calculation logic and, at render time just get the pixel’s segment ID from segmentData[index]
  • to get all the patterns to work properly, you’d still have to keep track of how many pixels were in each segment, and how far into the segment you were. This requires a little per-segment data tracking – I think most of it already exists, but it might have to be modified a bit.

This would let you define segments in any shape, in 2D or 3D. The only downside is you’d have to figure out how to enter or generate the per-pixel segment data you wanted. But making the edges of a matrix into a single segment would be fairly easy this way.

If that won’t do the job, for a true 2D multi pattern solution, @scruffynerf built this amazing tool: