While Loop in Grasshopper

Hi everyone,

I have a Brep that I’m putting in a particular position, thanks to three number sliders that I can choose (trim, heel and enfoncement). This position gives me a Volume.
My goal is to always obtain the same volume (for example 5e+10) by choosing Trim and Heel, but I want Grasshopper to give me the required enfoncement.

I’ve tried to do a While Loop with the Python Script, but I’m struggling to do so.

Does someone have an idea maybe ?

Thanks a lot,

Juliette

Hello
you could use an Evolutionary tool like Galapagos in Grasshopper.

But now there are also others tools Opossum Goat …
https://www.food4rhino.com/en/browse?searchText=opossum&sort_by=score&items_per_page=10

Thanks for your answer. That’s very helpful!
However, it seems like I can only minimize or maximize the value, not reach a chosen value.
Any idea on how to do so ?

Best regards

You can do the both, this is just classical Math you have to measure a distance (always positive) and not a difference (positive or negative)
So the goal must be
Abs(Goal Volume - Measured Volume)
And you need to minimize it.

If you can read C# (NOTE: there’s NO auto conversion to P) I could provide an entry level take on that matter (using a classic bounce solver approach) that does what you want.

Thanks a lot for your help.

Now, I would like to give an excel file as input parameters. Thus, I would have multiple objectives.

I think that’s quite hard but do you think this would be possible to do ?

(Sorry, I’m new to grasshopper so quite struggling with everything !)

Have a good day

Juliette

image