Cannot align geometric shapes in a vertical stack

Hi,

I am attempting to align a gaussian stack of 3-8 polygons in a vertical stack, touching at points of intersection. This intersection could either be as Case A, the lowest vertex of polygon n and the highest edge of polygon n+1, or Case B, the lowest edge of polygon n and the highest vertex of n-1 according to the geometry. I am increasingly stumped as to how to do this. I have attempted multiple methods. I have found x intersections between the geometries and then attempted to align the y value according to where the intersection happens. Unfortunately I have been unable to ascertain how to be clear whether it is Case A or Case B. I have attempted to compare angles between the higher and lower edges but as the geometries are rotated sometimes a plain comparison doesn’t work. Any clues as to how to do this would be gratefully appreciated.

What I am attempting to achieve is on the right, what I am getting is on the left:

GeometryProblem.3dm (4.6 MB)
GeometryProblem.gh (56.5 KB)

I think one quick way would be to just check the delta-x and delta-y of each polygon

then just take advantage of Partial results of Mass Addition:

GeometryProblem_Re.gh (22.5 KB)

[edit] but I think I’m missing something… the above is a vertex-vertex placement, you want a vertex-edge placement? like poly can only move along Y for instance, Tetris-like?

Your code was far too complicated for me so I rewrote it using a MoveD0 cluster from here:


polygon_stack_2025_Feb18a.gh (24.2 KB)

No Rhino file.

Slight simplification by adding two vectors together (one less Move).
MoveD0 cluster is in the yellow group.


polygon_stack_2025_Feb18b.gh (23.5 KB)

Thanks all. Joseph, is there a way of aligning non symmetrical polygons in a vertical stack. My intention is to imitate irregular plant cells of 4-8 sides and for the line lengths to all be random

Correct @inno , I was really looking for random geometrically aligned forms to touch between vertex and edge closest to vertex not vertex to vertex

I replaced the Polygon component with the white group and can imagine code to close the gaps but first… Is this the right direction?


polygon_stack_2025_Feb19b.gh (25.1 KB)

Added Anemone loop (purple group) to close the gaps.


polygon_stack_2025_Feb19c.gh (33.4 KB)

ok, there’s one important thing to mention tho: this works with the assumption stuff has to always move up (direction +Y) in order to stack (which is the situation you presented)

the two main cases, as you have already recognized in your first post, given two random polygons A and B:

either a vertex of A travels to its intersection with an edge of B, or a vertex of B travels to its intersection with an edge of A:

do we weally care to identify which particular case we are on? I don’t think so :slight_smile: because at the end we have to use just the vector that makes the geometry travel the most (which is the longest vector)
why that?
because if we pick “not the longest vector”, it means that there would be another available but non-picked solution which would prevent an intersection to happen, and because we are not using it → then that intersection is indeed taking place :slight_smile:

so we need to pick the longest calculated vector, which will avoid any other intersection and just leave one vertex intersecting to one edge

after that, just Mass Addition everything and use the Partial Results as Y vectors :+1:

GeometryProblem_Re_Re.gh (25.4 KB)

2 Likes

Replaced some code with orange group. Better and slightly more accurate.


polygon_stack_2025_Feb19d.gh (32.5 KB)

NOTE: The white group implements random radii of the irregular polygons.

This is great Joseph. thank you. I guess it will take me some time for me to parse what’s going on but it’s exactly what I was attempting to do

I have one final question. Is there a way of assigning an area weighting to each of the ten boxes so rather than a random size, the size is determined by a list. So for example each box has to hit the area of 100cm2 but if I assign a list of say 1.0, 0.8. 1.0. 0.9 etc, each box will be 100cm2, 80cm2, 100cm2 and 90cm2 respectively?

this is a very logical explanation @inno - thank you as well for your help

You want random length edges and specific areas? :rofl: Go ahead.

haha, yes I thought of that afterwards… too much of a challenge indeed. I guess then if we just maintain simply rotated geometry but instead set area size per shape that may be better. I could potentially work with @inno 's code to change them by weighting

1 Like

If I wanted to create a network of these shapes say going right to left what methods do you think would be possible to lock an edge and the propagate out from there?

please sketch an example of that

Sure. Right now if I try to consider them in a row, I get this:

but ultimately the propagation of the shape is that it shares often 2-3 sides which each other to form a network. Generally the cells maintain one shape, hexagonal in this case like a honeycomb, but in real life these shapes are not perfectly symmetrical, like this:

:question: