I am new to the Geometry Nodes and trying to use them for implementing an arithmetic progression.
I want to mimic the behavior of the following script, but I haven't been able to so far since I cannot figure out how to create for-loop-like geometry nodes (if even possible).
import bpy
rows = 5
increment = 2
x_spacing = 4
y_spacing = 4
size = 2
obj = bpy.context.active_object
for i in range(0, rows):
if i == 0: increment = 1
for j in range(0, i+increment):
new_location = (
obj.location.x + i * x_spacing,
obj.location.y + j * y_spacing - (i-j) * x_spacing,
obj.location.z,
)
bpy.ops.mesh.primitive_cube_add(size=size, location=new_location)
I could only come up with a hacky solution, but it is not what I need.
(Both the script and my hacky solution with Geometry Nodes are included in the attached file)
increment
will always be1
in your code. $\endgroup$