Reuse the VOLUME of a brep to become an INPUT

First of all, thank to you all for your help in advance. It is my first time posting here and I was hesitating to do it and a bit scared!

I have this brep:

It actually comes from this 3 surfaces.

First of all I generate the lower trapezium… Once the length of the larger side of the lower trapezium is longer than 125 it appears the ramp and the upper trapezium starts to increase. Finally both of them, upper and lower trapezium increase at the same time.

  1. Is it possible to make that the output of the volume of the final BREP becomes an input, so with an slider and depending on the volume I can get diferent sizes of the brep?

  2. Probably the way that I created the BREP is not the right one, but I was running out of time and I guess it is beyond of my knowledge.

You can check it with the file attached. I have used pufferfish to create the brep.

grasshopper_problem.gh (44.5 KB)

Hi Jesus!

All your geometries depends on the lower trapezium volume so, at first sight, I do not think it is possible to convert the final volume output as an input for next calculations. To do so you will need to redo all your script, making it dependent on the total volume, adding more mathematical operations an complexity.

But! There’s a workaround if you’re up for it. You could try using Galapagos. Basically, we’d make the volume of the lower trapezium the thing that changes each time, and our goal would be to make the actual volume of the shape as close as possible to the volume you’re aiming for.

Hope that helps!

1 Like

Thanks for the warning about Pufferfish, I don’t have it but looked anyway.

This is a tremendous amount of code to create a simple shape :exclamation: I can see many ways to make the same shape with less code. I created this white group to replace Pufferfish, split the brep and cap holes:


grasshopper_shape.gh (52.2 KB)

Don’t use hidden wires, especially short ones. There are rare occasions when I use “Faint” long wires but generally GH code is easier to read without hidden wires.

There is much more that could be done to simplify this code and perhaps achieve your goal in a different way, but I’m not interested in wading through it.

Welcome!

In your case, yes, probably, depends on the effort you put. …
And as you are here, it depends on the effort you put into explaining properly what you want to do , as other can try to help you.


Please give further details about this.
Do the upper trapezium must always exist?
Is the height of the trapezium and the other above a fixed value?
Does it have to increase? If yes, how? When?

Is the angle of the left/right side of the trapezium a fixed angle? If no, how it change, when, how?

Imagine explaining the whole problem to another person that have to do it manually, pencil on paper.
If there are too many degrees of freedom, there is not a unique solution.
Please be accurate.

The BEST way to solve this, is that you also explain what is this. What are those trapeziums? What is happening here?

Uau, @bbalbastre It totally worked with your solution. It’s true that the way that I solved the problem was not the right one. But your shortcut helps and it is very useful.

image

Thank you very much!!

2 Likes

Hey Riccardo, thank you for your reply. And sorry for my lack of experience posting here. I will try to explain it better.

The final volume is actually (I don’t know the right name in english) a earthmoving gathering place. So, a place to fill with earth progressively.

So, the first trapezium is the lower layer, and once it is 125m long it is necessary to have a ramp in order to put earth at the second layer. And then the upper layer starts increasing until both increase at the same time more or less… It will be over once the total lenght is around 270m and it has 120.000m3.
Furthermore, the slope at every side has to be 1/1 and both layers are 5m high.
There is not any restriction for the ramp, not to steep, not too long at the beggining when it is created.

I would like to be able to do it introducing the final volume, but as @bbalbastre said before the way that I have programmed is wrong.

I really appreciate your interest!
Thank you very much.