Progress bar-like visualization

hi,
looking for a way to visually represent the cumulative areas of separate geometries using a progress bar-like visualization. Think of it like transferring water from multiple cups into another cup, where each cup represents a different area, and as you transfer water from each cup, you fill up the target cup until it’s full.
In other words, calculate the total area of several individual geometries and then represent that total area as a filled shape or pattern within another geometry, like a progress bar filling up.

and it goes from the closest to the farthest or the opposite the farthest to the closest to the surface i want to fill

id appreciate it alot if anyone can help ^^

area_progress_bar.gh (22.7 KB)

Hi,
If you have the overall rectangle, the empty rectangle to be filled out progressively, what you need to do is:

  1. Get the base width of this overall rectangle
  2. That base width will be the base width of the current progress fill rectangle.
  3. But we know the area of that progress rectangle (from the summed areas) and we have the width (base width), so what we need to do is divide the two (area / width), to get the height of the progress rectangle.
  4. Then we draw the progress fill rectangle in the same position
    See attached script.
1 Like

thank you alot for replaying!
this is a nice solution.

ive been wondering , let imagine we have some unconventional geometries,

how can we do something similar to what you did , but to these geometries , in this case we cant figure out the area the way you did.

once again , thank you for replaying ^^

I am assuming we want to fill in that large irregular area right, my guess is it is still very doable.
I think the specific solution will depend of the shape. For the example you sent for instance,
I would divide it into narrow horizontal strips (using contour),
get the area of each strip,
and progressively colour the strips, as the shape areas increase

Let’s see if that is practical…

area_progress_bar_irregular.gh (33.5 KB)

Okay, so:

we get the area of all the shapes whose progress we want to show (measure area)
we divide the main volume (to fill up with progress), by a grid into rectangular panels
we start progressively add the sums of the panels one by one (progress sum)
as we add the sums, we check if this progressive sum is less or equal to our measure area
if the progress sum is less or equal to the measure area, we colour the the panel we just added.
once the progress sum is greater than measure area we ignore those panels

1 Like

amazing!!! thank you!
yes this will do great
thank you so so much
very much appreciated ^^

1 Like

Welcome, glad it works.

area_progress_bar trial.gh (19.1 KB)
i had a different approch but it didnt work as i wanted, i used the grasshopper code i found on the internet by someone named djordje, he showed how he can divide a surface into parts with area of a given percentage** this link : Divide surface in subsurfaces with a given percentage - Grasshopper
but i couldnt achieve the calculation to do it a surface at a time , it does all the surfaces as a collective.

img1:
image

img2:
image

i wanted to achieve that the surface starts to fill by taking the calculation of each surface as individuals but keeps on adding until it fills up the overall surface needed

The area component you are using is a custom component which I do not have. Are you able to replace it with the native grasshopper area component and reload that updated script?

yeah i see you have for some reason the old “area” component
i changed them to the one you used
let me know if this works now
area_progress_bar trial.gh (17.1 KB)

Yes, it works now, thanks.

area_progress_bar_progressive.gh (32.4 KB)

I think with more time the solution can be scripted much more simpler and elegant. About the area component, I must be on a very old version of the software.

My script is not very neat, and the comments not so great either, I apologise for that. However I hope it is intelligible enough.

  1. We want to consider the summed areas of the shapes as one value starting from 0 to a 100 percent
  2. As we scroll through 0 to 100 with a slider, we want the areas to fill up starting with the first shape up to however much of the total it contributes, then the next shape fills and so on, filling up one by one until the last one
  3. So, we associate each shape with its cumulative sum (as a percentage) say first shape is 0to7%, second is 7to30%, and so on, until last one which is up to a 100%
  4. So based on the position of the slider we pick the current shape, (under which the slider falls)
  5. And for that shape alone, we fill it from start to finish within its cumulative sum, so for example, if the second shape is 7to30% as the slider moves from 7 to 30, the shape fills from 0 to 100
  6. But, as implemented, this only colours the current shape.
  7. So, we have a side logic, that only does the following
  8. checks if the current slider value is larger than or equal to the cumulative sums for each of the shapes
  9. If it is larger it fills the shape solid, if not it does nothing.

The logic employed would be very simple to implement with coding, say python.

1 Like

this is exactly what i had in mind!
thank you! its extremely helpful . very much appreciated
and thanks for the very detailed explanation , it def helps me in the future to solve similar things

appreciated so much ^^

1 Like

image

ive been checking if it works on geometries that are inconvientional

i guess we gotta do it the way you divided the shape into little squares and then you checked the area one by one

unless you have another way to do it :smiley: that would be interesting

You are welcome. My first guess would be to subdivide the shape into little squares as well.