Fit connected variables to get specific volumes

Hello everyone.

I have been facing a problem in grasshooper for a long time. My algorithm, creates a trabeculae structure, divided in half. I can operate on the thickness and the number of these beams in each half. The thickness is preset and fixed. Only the number of beams (or rather, the points on which these beams are created) is variable. The result is volume of each half. Is it possible to automatically adjust the numbers of beams/points in such a way as to get specific two different volumes in each half. I tried using galapagos, while there seems to be no way to set two different target values. The problem is that these variables are dependent and by changing the number of beads in the right half, the volume in the left half also changes (they are connected). Is there any way to make this automatically working, or am I out of luck. Thank you in advance for your help!

is there a chance to post your gh definition?

Or ask Copilot

Btw I fixed the typo in your topic title

Of course. apologies in advance for how this file looks. It can certainly be optimized and greatly simplified, while for now it is in draft form. I marked as a group the part that interests me. On one panel I give the number of points in different segments of the structure. These numbers change the volumes of the beams in the sections. I would like to set target volumes or porosities, and then I would like the program to arrive at the optimal point/beam numbers on its own.

box_sub.gh (26.1 KB)

the multipipe node can not work with a domain it does need a list of numbers

Oh :confused: So it is not possible to solve this problem?

I’m not using dendro but I don’t think it is relevant for your request.

You can use an attractor point and remap the values to a domain. In my example I’m remapping the x-coordinates to a domain from 0.01 to 0.05

box_sub_remap_domain.gh (28.0 KB)

For cleanup of the voronoi network, look here:

You can also check out a 3D model on my server by clicking on the screenshot below.

image

Good point. However, my problem is something else. Thickness of the beams is actually not problem. It can be even fixed on one value. The problem is gradient of porosity. I am dividing my structure to X smaller volumes. In these volumes I set up some number of points, and these point is Voronoi Diagram’s base. My aim is to set up structure with for example porosity (Beams_volume / Whole volume): 20% in first area, 40% in second area and 60% in third. The problem is, that I have to check multiple scenarious, I mean check a lot of point number versions like: set number of points in areas: 20, 30, 40 and check porosity, then set another value and check porosity..etc..etc. To get what I want to get it takes a lot of time. So the question is: is it possible to run an algorithm, where I set thickness (for example) 0.2mm and porosity from 20 to 60% and grasshooper find optimal number of points in each divided area or Should I do it mannualy by checking multiple values and try to fit it. I know that this is pretty complicated, but this forum is my last hope :smiley:

So then how to set this up with Dendro is your current trouble?

Actually it not have to be done by dendro. It could be done by anything, that works, but I am not sure if there is something in grasshopper, that is able to manage it.

if you can find a way to solve porosity for one cube -not even divided into different areas- then you have probably solved it for a cube where porosity is defined in different zones

BUT

it doesn’t look like an easy problem :slight_smile:

if porosity is achieved by giving volume to 3D voronoi cell edges, then the number of points defining the 3D Voronoi should be proportional to the length of the tunnels (which will represent empty volume) so they contribute to increase porosity (more edges = more tunnel = less material = more porosity)

but what happens when you introduce a new point into a voronoi diagram that has already some points? the new point creates a new cell (and so it introduces new edges) around which a circular cavity will be created: depending on the diameter of those cavities (that can be fixed or variable) only a % of the toal length of the new edges is creating empty volume, because some (or most?) of that is compenetrating with cavities that already exist

for this reason -I guess- you can’t just forecast the degree of porosity a given number of points will give you, and at the same time I also believe playing with the seed while keeping the very same number of points will also yield different porosity results

porosity increses with the number of points and the diameter of the tunnels, but I think you can’t really forecast a porosity value without modeling the 3D geometry

you can for sure put down a definition with a loop that tries a given number of points per area and calculates the porosity: if that porosity value is under a certain threshold, the loop restarts with n+1 points and so on (Populate3D Seed stays the same)

this allows you to get a volume with the smalles porosity equal or higher to a certain amount you set

the transition between areas with porosity_a and porosity_b, that’s interesting, probably I would try one of those probabilistic thingies but based on coordinate, for instance, for decreasing probability from left to right (along X axis) something like:

Point_cull_probability.gh (13.6 KB)

but this would change the rules of the game, as you’re not playing with a number of points in a volume anymore, but you’re playing with a graph… (for this reason I wouldn’t use a graph mapper, but maybe draw curve control points on the Rhino canvas and play with those, like referencing a Curve that is indeed itself a graph mapper)

starting to look like sphere packing?