0
$\begingroup$

I would like to use geometry nodes to create the Weaire Phelan structure (Wikipedia) such that I can independently transform (and in particular scale) every single cell.

To that end, I so far have:

  1. Built the two necessary pieces, one with 14 sides (left) and the other with 12

The two pieces of the Weaire Phelan structure

  1. using Geometry nodes, arranged them into a unit cell pattern. Eight pieces in total. I also gave them different materials mostly for debug purposes.

Weaire Phelan unit cell

  1. I generated a grid of points to instance this construction on. Here a 5x5x5 grid. This is entirely procedural.

The output of "3D grid" for a 5x5x5 grid

  1. and finally I instanced the cells and scaled them accordingly.

Weaire Phelan structure with scaling noise (incorrect)

The problem now is, that the scaling happens on the full cell, rather than on each individual piece. What would be the best way to accomplish this same thing but per piece?

I have found that something like this is possible with Pick Instance and Instance Index:

separate indices

However, this is not good enough: While that lets me scale the pieces individually, the transformations are still centered on the points in the grid rather than the pieces. In effect, the pattern ends up being the exact same if driven by a texture. The scale is sampled from the grid positions and the locations to scale towards are also on the grid. I need both of those things to happen at the positions of each piece instead.

I think maybe it's possible by also feeding in the noise texture eight separate times and carefully shifting it around but I can't quite get the shifting right and it seems like a very brittle, error-prone method. I am hoping for something more efficient

$\endgroup$

2 Answers 2

2
$\begingroup$

Now I've understood the problem better and here is the solution.

So transform instances moves object while keeping object center in place, this is not suitable behavior for our task. So instead, I will create additional points for each separate piece.

This is a plan - add 8 copies for each point, shift them, rotate instances. Unfortunately, blender doesn't allow rotating points, so we have to mark them using IDs and later rotate them as instances. So this is my result for 3 pieces out of 8:

enter image description here

Some repeating actions I've putted into node groups. First one assigns an ID and offset points:

enter image description here

Second one uses IDs to rotate instances:

enter image description here

I've put the system on test using this setup:

enter image description here

And have good results:

enter image description here

$\endgroup$
5
  • $\begingroup$ You can't scale nested objects separately, because root objects share the same data $\endgroup$
    – Crantisz
    Apr 27, 2022 at 14:27
  • $\begingroup$ This is the walkaround:) you can group repeating actions in a group to make nodes simpler, though $\endgroup$
    – Crantisz
    Apr 27, 2022 at 14:30
  • $\begingroup$ That make sense, I'll think about this $\endgroup$
    – Crantisz
    Apr 27, 2022 at 14:34
  • $\begingroup$ @kram1032 I've updated the answer $\endgroup$
    – Crantisz
    Apr 27, 2022 at 19:40
  • $\begingroup$ This works perfectly, thank you $\endgroup$
    – kram1032
    Apr 27, 2022 at 22:30
1
$\begingroup$

The solution is, to prevent subinstances. In my example I used a cube, an icosphere, a cone and a cylinder. These represent your elements. I arranged them in a grid 2x2. This represents your cell. And I arranged 5 of these grids on a meshline, which represents your 5x5x5 grid.

result

node net

But instead of instantiating the elements directly on the 2x2 grid, we mark every point of it using the Capture Attribute node. Then we only instantiate the grid on the meshline and realize the instances:

setting up the grid

Now, that we have our complete grid, we can instantiate the single elements based on the marker and scale them individually relative to their instantiation point, which is the same as their origin.

instantiating

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .