0
$\begingroup$

The image shows a way to generate $\mathbb{Z}^3$ lattice and a $\mathbb{Z}^2$ lattice.

The coordinates from the cube vertices are

(-2,-2,-2)

(-1,-2,-2)

...

( 2, 2, 2)

and from the plane vertices

(-2,-2,0)

(-1,-2,0)

...

( 2, 2, 0)

However, I need a $\mathbb{Z}^5$ lattice. Is there a possibility to combine every vertex of the plane with every vertex of the cube to obtain something like this:

(-2,-2,-2) (-2,-2,0)

(-1,-2,-2) (-2,-2,0)

...

( 2, 2, 2) (2, 2, 0)

In mathematics this operation is called direct product, but I have no glue how to set this up in geometry nodes. All the following operations would act on the set of all possible five tuples. I hope that this is not too technical.

enter image description here

$\endgroup$
5
  • 1
    $\begingroup$ How would you like to output the result ? Right now, I am thinking of instancing the plane at each vertex of the cube. Choosing a vertex of the cube will give you the first part (i,j,k). Then choosing a vertex of the plane will give you the second part (l,m). But I am in the dark about how you could use this... $\endgroup$ Mar 24 at 17:00
  • 2
    $\begingroup$ Another approach is to create a 5^5=3125 point cloud, then to decode the index n as n=(i+2)+5*{(j+2)+5*[(k+2)+5*{(l+2)+5*(m+2)}]} (more or less...) $\endgroup$ Mar 24 at 17:06
  • $\begingroup$ I'm not in the mood to look up any formulas, but I guess there surely are formulas to calculate this "by hand". So it should be possible to setup Vector Math and Math nodes probably with the help of Separate XYZ and Combine XYZ nodes to recreate this step by step. I mean, people are also recreating fractals and Aizawa strange attractors with Math nodes so I guess it is just a matter of knowing the formulas. $\endgroup$ Mar 24 at 17:13
  • $\begingroup$ I think the point cloud will do the job. This is great! $\endgroup$
    – p6majo
    Mar 24 at 17:35
  • $\begingroup$ If the point-cloud does it.. I'd be intrigued to see the mechanics. I hope one of you writes it up as an answer. $\endgroup$
    – Robin Betts
    Mar 24 at 17:49

2 Answers 2

1
$\begingroup$

(Using Blender 3.6.8)

Let $K \in \mathbb{N}$ such that $i, j, k, l, m \in [-K,K] \cap \mathbb{Z}$.
Let $B$ such that $B=2K+1$.

The tuple $(i,j,k,l,m)$ is encoded in the index $n$ as: $$\begin{array}{rcl} n & = & 1 \times (i+K) \\ & + & B \times (j+K) \\ & + & B^2 \times (k+K) \\ & + & B^3 \times (l+K) \\ & + & B^4 \times (m+K) \end{array}$$

To decode $n$, a recursive process is used. Let $I^t-K$ stands for $i,j,k,l,m$ with $t=0,1,2,3,4$ respectively. Let $N^t$ such that $N^t=I^t+B \times N^{t+1}$, with $N^0=n$. Then:

$$ I^t = N^t \ \mathrm{mod} \ B $$ $$ N^{t+1} = \frac{N^t - I^t}{B} $$

GN graph - Main

1. $K$ is set to $2$.
2. A Point Cloud of $B^5$ points is initialized.
3. $(i,j,k)$ are stored in a first vector.
4. $(l,m)$ are stored in a second vector.

GN graph - Recursive relation

1. NodeGroup computing $I^t$ and updating $N^t$.

Resources:

$\endgroup$
0
$\begingroup$

The hint from

@StefLAncien

with the point cloud helped to solve the problem. The following solution generates $\mathbb{Z}^5$ vectors. The range $r$ determines the maximal absolute value for components of the the vector. It must be smaller than 9. So at most vectors from (-9,-9,-9,-9,-9) to (9,9,9,9,9) can be created.

To achieve this a point cloud of the size $b^5$ with $b=(2r+1)$ is created. The index $i$ is mapped into the vector $(d_1,d_2,d_3,d_4,d_5)$ according to the following rule: $$ i = (d_1-r) \cdot b^4+(d_2-r)\cdot b^4+(d_3-r)\cdot b^2+(d_4-r)\cdot b+(d_5-r) $$

This map is performed in the node "Index2Tuple" which is displayed in a separate image. To make the result visible the 5-tuples are split into a 3-dimensional vector and a 2-dimensional one. This yields two sets of points shown in the images for $r-3$ and $r-5$.

enter image description here

enter image description here

enter image description here

Resource:

$\endgroup$

You must log in to answer this question.

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