Shuffling Panels

Two GH definitions presented below are aimed at shuffling panels by replacing their indices randomly. “Shuffling Panels Ver.1” is without probability distribution and “Shuffling Panels Ver.2” is the one with.

The common set up of our targeted space for both definitions is a 4 x 4 grid along which mesh panels are arranged and color-coded according to the indices of each grid cell.  For the random component, we use one of GH components, Jitter, which allows us to shuffle those list indices of the grid cells with its parameter, shuffling strength and seed. In the version 2, in order for us to set frequency of all outcomes as random distribution before shuffling panels, we incorporated GH Graph Mapper and our custom python script component Get Distributions.

Parameters (Input)Required: Base rectangle or square, A list of ratios
Optional: Seed, Strength
Return (Output)Rectangle divisions based on ratios
GH Key ComponentsC# Script Bake Most Attributes, Gradient, Graph Mapper, Jitter, Python Script Get Distributions

Version 1

without Probability Distribution

There is no random distribution set on this version of “Shuffling Panels” but we could say that it is uniformly distributed because every index occurs only one time. The occurrence on the left is with a shuffling strength of 0 which represents the initial grid condition and the one on the right is with a shuffling strength of 10, which is randomly shuffled by its max strength.

100-100:
Variations of the GH definition “Shuffling Panels Ver.1” with different shuffling strength 0 to 1.
100-05:
With the use of the modulus, it can now have indices ranging from 0 only to 5 but still uniformly distributed.


Version 2

Use Case Random Areas in Multiple Domains

Unlike “Shuffling Panels Ver.1” without distribution, in this example, the frequency of the random variables is controlled by the distribution generated by Graph Mapper component’s value as ratio factors. This example used the “Gaussian” type of graph. The occurrence on the left is with a shuffling strength of 0 which represents the initial grid condition and the one on right is with a shuffling strength of 10, which is randomly shuffled by its max strength.

Those figures present the variation of random patterns through a shuffling strength 0 to 1 and the various types of distribution (frequency distribution) available in GH Graph Mapper.  “Linear”, “Gaussian”, and “Parabola” types of graphs were used.


GH Definition


Flowchart


Now with “Shuffling Panels Ver.2”, it is possible that frequencies of each index set by the distribution and the location of indices are shuffled randomly. Those two algorithms presented above are meant to be an introduction to the basic usage of the stochastic system and now we can analyze it and discuss what could be the next in completing this article.     For example, the first row of the diagram above describes the process of “Shuffling Panels Ver. 2”, and we can observe that its outcome is largely affected by the initial order of indices. This can be clearly seen when the shuffling strength is low, for example, at 0.2. This happens because of the order of steps in the algorithm such that 1. Set the distribution by factors, 2. Arrange panels with the distributed indices along the grid, and 3. shuffle them using Jitter. The performance of our code is limited by the use of GH random component Jitter thus the location of shuffled panels is largely bounded by its original position created at Step 2. To change its original position, have a look at the algorithms like those: In “Random Subdivisionpost type” for example, the factors which generated random distribution on the “Shuffling Panels Ver. 2” can be directly used as the ratios of subdivided areas on a given area and the code can divide the area recursively according to those ratios in randomized order. This enables the initial arrangement of panels with the distributed indices to be as many as you could adjust with parameters like seed and shuffling strength is almost freely chosen.  It is not limited by the order of rendered panels that are actually provided by the software.  (The second row of the diagram above shows this process.)

No Comments

Leave a comment