you are exactly right
x slider
you can interpret as the radius of the circle
y slider
il the size of the edge of a single square cell
A
takes two times x
(2 * radius = diameter of the circle) and divides it by y
(length of the side of a single cell) then rounds that number to closest bigger integer
this way you get the number of squares that are needed to fill the entire side of the bounding box of the circle with squared cells
as the only geometrical reference we have to create this whole array of cells is the center of the hypotetical circle, point C
while the array of cells is created using the bottom left corner as reference, we move the circle center to the bottom left corner through B
which just creates a vector of amplitude x = y = “minus_half_total_grid_size”
so actually the Move component just moves the point C from the center of the circle to the bottom left corner P
using vector B
after that, you measure the distance between:
- the center of each cell (using bounding box that I guess is faster than Area)
and
- the center of the circle: if that distance is smaller than the radius of the circle, then your box is contained… and the Cull Pattern takes care of that
now that I think about it after a fresh sleep, I believe instead of capping the extrusions to make meshes out of those, using the extrusions to create a mesh box directly will trim some more time:
with the slider S you decide how many “levels” your bars will have, in the case shown in the picture as a ratio of their height
but maybe you want to show something like 20 steps for each bar (in case you can remove the Divide component and just plug a slider indicating how many divisions along Z each bar should have) and will look like this:
the point of this is still the same as in the other topic: the less divisions, the less color distributions, the more “in between” colors are lost as there are no points to be sampled so your final choice
in this particular case, you gradient has 5 colors equally distributed along the 0-1 domain, so if you have 5 vertical divisions on you mesh it looks like you are good to go, because those are equally distributed and color -I guess- is already linearly interpolated between closest vertexes…
but when your data will -maybe- become more complex and the gradients will vary, maybe you want to increase also those?
you can show/hide mesh edges with CTRL+M while focus is on the GH window
I’m on a laptop from a few years ago, but with the mesh change I can play with this definition “almost in real time”… meaning it doesn’t lock the Gh screen for seconds, but it reacts to the data sliders pretty instantly
another stupid thig I just realized
using point to number to read just the Z values of the points will trim another bit:
updated file: Diagram Script V3 (1)_inno_inno.gh (163.6 KB)
not real time, but pretty fast!