Creating a Procedural Brick Wall Generator
local graph
Chapter 11 — Creating a Procedural Brick Wall Generator
Section titled “Chapter 11 — Creating a Procedural Brick Wall Generator”In the previous chapter, you learned how to create a procedural plant using Geometry Nodes. In this chapter, we will take a look at how to make a procedural brick wall generator using Geometry Nodes. We will be able to give a Curve object as our base input, and based on that, we’ll be able to change various parameters such as the wall height, brick size, brick randomness, and the gap between our bricks.

Figure 11.1: The final result
We will start this chapter off by creating a Curve object in the Viewport. We will resample this curve using the Resample Curve node to instance some bricks on our Curve. After that, we will find various ways to calculate how to offset, duplicate, and randomize these bricks to create a realistic brick wall.
We will cover the following topics in the chapter:
- Creating a curve in our Viewport
- Instancing bricks onto our curve
- Creating our Group Input nodes
- Creating the second layer
- Duplicating our layers
- Randomizing our bricks
Let’s get right into the exercise.
Technical requirements
Section titled “Technical requirements”Some figures in this chapter show the full Blender setup, including node trees, outcomes, and parameter settings. For easier viewing and readability, these figures are also available in the book’s GitHub repository.
You can find the exercise from this chapter in the common .blend file in the book’s GitHub repository.
Creating a Curve in our Viewport
Section titled “Creating a Curve in our Viewport”Let’s start this exercise by adding a Curve object to our Viewport. It doesn’t matter what the shape of this curve is. To add Curve objects to your Viewport, you can press Shift + A and choose any object from the Curve section.
For the purpose of this demonstration, we went with a Curve Circle primitive. In Figure 11.2, you see a curve added to the Blender Viewport.

Figure 11.2: Adding a curve to your project
Once you have added your Curve object, let’s head to the Geometry Nodes workspace and add a new node tree to this Curve object (see Figure 11.3).

Figure 11.3: The Geometry Nodes workspace
Now that we have set up our workspace, it’s time to start building our node tree! The first step is to start instancing bricks onto our curve.
Instancing bricks onto our curve
Section titled “Instancing bricks onto our curve”Let’s get started by adding in a Resample Curve node, which will add points for our bricks to be instanced onto. To do this, let’s add a Resample Curve node between the Group Input and Group Output nodes. Let’s give it a value of 30 for now. This value is not important yet because it is just a placeholder.
You will see that nothing happens; that is because points aren’t directly visible on curves.
Follow this node directly with an Instance on Points node, which will be responsible for placing instances on the points we resampled in the previous node.
After that, you’ll see that your curve disappears. This is because our curve is now being converted into a mesh. The problem is that we have not inputted an Instance yet. Let’s get started with that!
Add a Cube node into your Geometry Nodes workspace and give it the following parameters:

Figure 11.4: Cube node parameters
This will be our base for a brick. The values don’t need to be super accurate for now, as these are just placeholder values. Once you have connected this Cube node to the Instance input of the Instance On Points node, you’ll see 30 bricks appear in the Viewport.

Figure 11.5: The current node tree

There’s an issue though; the bricks aren’t aligned to the curve. To achieve this, we’ll need to make the necessary calculations for this to happen.
Let’s add in a Curve Tangent node, which is responsible for telling us the orientation or tangent of a curve based on the point it’s requesting. Let’s connect this node to the Rotation input of our Instance on Points node.
You’ll see that our bricks do rotate, but it’s not correct at all. This is normal behavior. We still need to align the rotation to the vector of this tangent. Thankfully, Blender makes this very easy with the Align Rotation to Vector node, allowing us to skip the boring math lessons. Let’s put the mode to X because X is our brick’s longest side, and drop this node in between the Curve Tangent node and the Instance On Points node.
By default, it will connect this node wrongly. It will connect the Curve Tangent node to the Rotation input. We do not want this. Let’s slide the connection to the Vector input instead.
Once you do that, you’ll see that our bricks are following the curve correctly. You can change the Count value on the Resample Curve node to play around with the number of bricks we’re adding to the curve. The following figure resembles how your project should look by now.

Figure 11.6: The current node tree
We want to make our wall fully procedural, though. To do that, let’s begin with adding Group Inputs to our project, which we will use as variables in our node tree.
Creating our Group Input nodes
Section titled “Creating our Group Input nodes”We will need a total of six Group Input nodes in this project. To do this, head to the Group menu by pressing N and search for the Group Sockets panel.
Once you are there, let’s add the following variables to your project:
- Brick Size X of the Float type
- Brick Size Y of the Float type
- Brick Size Z of the Float type
- Height of the Integer type
- Randomization Factor of the Float type
- Gap of the Float type
Once you have done that, this is what the list should look like:

Figure 11.7: The Group Sockets list
Let’s start implementing the variables into our node tree! Let’s start with the Brick Size variables.
To implement this, we’ll first need to split the inputs of the Cube node into its respective X, Y, and Z components. To do this, let’s plug a Combine XYZ node into the Size input of our Cube node.
Once you have done that, you can connect the variables to their respective axis names.
You will see that your bricks have disappeared. This is because they’re now set to 0. To fix this, let’s go to the Modifiers tab and let’s add some values to all the variables. Make sure the variables are set up as in the following figure. These will be important later. You’re free to change these values at any point in the project, but these are the values we’ll be using during the demonstration of this exercise.

Figure 11.8: The Group Input values
If you take a look at your Viewport, you’ll see that your cubes have reappeared! It’s now time to add some mathematical magic to your node tree.
For example, we want our Resample Curve node to add or remove bricks if we change the curve’s length. To do that, we’ll need to make use of the Length mode in our Resample Curve node. Once you change this, you’ll see a Length input appear.
This Length input can be seen as the length per point. In other words, it will be the base length of Brick Size X + Gap. To calculate this, let’s add a Math node set to Add and calculate these two values together. After that, you can plug it into the Resample Curve node.
If you have followed the previous steps correctly, this is what your node tree should look like:

Figure 11.9: The current node tree
If you try modifying your curve in Edit Mode now, you’ll see that more and fewer bricks come in or out of the curve. This is exactly what we want.
This is a good start to the base of our procedural brick wall. The next step is to create the second layer of our wall, where we will be duplicating parts of our code to offset the cubes a certain amount.
Creating the second layer
Section titled “Creating the second layer”Good job on making it so far in this exercise! In this heading, we’ll be duplicating our Instance on Points node to create a second layer in our procedural brick wall.
To duplicate a node, you can press Shift + D.
Slide this node right under the existing node and wire it up exactly like the previous node.
You will see that nothing happens. This is because this node is not being outputted to our Group Output node yet. To do this, we’ll add a Join Geometry node at the end of our node tree, right before the Group Output node.
Let’s plug our second Instance On Points node into this Join Geometry node.
You will see that, yet again, nothing changed. This is because the bricks are inside one another. To fix this, let’s raise the bricks from each other.
To do this, add a Translate Instances node between the Instance on Points node and the Join Geometry node.
We’ll need to raise the Z value by Brick Size Z + Gap, so let’s take a Math node set to Add once again, and connect these variables to the Math node.
We can’t connect this Math node straight into the Translation input; we will first need to separate the Vector input into its respective X, Y, and Z values.
Let’s connect a Combine XYZ node to the Translation input of the Translate Instances node. Once you have done that, you can connect the Math node to the Z value of the Combine XYZ node. If you have done that, this is how your current project should look:

Figure 11.10: The current node tree
We’re making good progress. The next step is to offset the bricks in a way that represents the look of a brick wall.
To do this, we’ll need to offset our Cube node by (Brick Size X)/2. This will ensure that our brick will be in the middle of our previous layer.
Let’s start by adding a Transform Geometry node between the Cube node and the second Instance on Points node.
We will need to access the X Translation value of this Transform Geometry node. To do that, let’s add another Combine XYZ node to separate it into its respective X, Y, and Z values and connect it to the Translation input.
Add in a Math node set to Divide, plug Brick Size X into the first socket, and enter 2 into the second socket.
You’ll now see our curve starts to represent the look of a brick wall! If you have followed the previous steps correctly, this is what your node tree should look like:

Figure 11.11: The current node tree
The next step is to duplicate both of these layers and link this height to the Height variable we made previously.
Duplicating our layers
Section titled “Duplicating our layers”Let’s get right into duplicating our layers. We will achieve this by using the Duplicate Elements node we saw in Chapter 6.
Go ahead and add the Duplicate Elements node at the end of your node tree, just before the Group Output node. Let’s also set the mode to Instance and give it an Amount value of 5.
Nothing has happened yet; that’s because we’re not actively transforming any of the created duplicates. To fix this, let’s add a Translate Instances node right after the Duplicate Elements node.
Just like before, we’ll need to add a Combine XYZ node to separate the X, Y, and Z values of this node.
We’ll need to modify the Z value by ((Brick Size Z + Gap) * 2) * Duplicate Index). That’s a big calculation; luckily, we already made most of these calculations beforehand. Let’s locate our previously made Brick Size Z + Gap calculation and connect another Math node set to Multiply to it. Let’s enter a value of 2 for the multiplication. We need to multiply by two because we already made two layers to begin with.
The next step in our calculation is to multiply what we have now by the Duplicate Index output of our Duplicate Elements node. To do this, let’s add another Math node set to Multiply and connect both of these outputs together.
The output of this final Math node can be outputted to the Z input of our last Combine XYZ node.
Once you have done that, you’ll see that our brick wall has risen. The final thing that we have to do is connect the Height variable we made previously to the Amount value of the Duplicate Elements node. This will ensure that we can control the height of our wall easily.
If you have followed the previous steps correctly, this is what your node tree should look like:

Figure 11.12: The current node tree
We’re almost there. In the last section, we’ll be randomizing our bricks to add realism to our brick wall.
Randomizing our bricks
Section titled “Randomizing our bricks”In this section, we will add randomization to our brick wall by making use of a Random Value node set to Vector, where we will be rotating the cubes on the Z axis. We will also make use of the Randomization Factor value we added earlier in this chapter. Let’s get right into it!
Start by adding a Rotate Instances node at the end of your node tree, right before the Group Output node.
Let’s add a Random Value node set to Vector into the Rotation input of the Rotate Instances node.
You’ll see that your wall turns into madness; that’s because the values of this Random Value node, by default, are way too high.
Let’s set the Max values to 0 on all axes except the Z axis, which gets a value of 0.150.
We’ll do the same for the Min values; let’s leave all of the axes on 0 except for the Z axis, which gets a value of -0.150. This will ensure our randomization is nicely balanced.
To implement our Randomization Factor variable, let’s multiply the output vector from the Random Value node by our Randomization Factor variable.
To do that, let’s add a Vector Math node set to Multiply and connect our Randomization Factor variable to the second Vector input.
You will see that your brick wall will now be randomly rotated in 0.150-radian intervals!
This is the end of this exercise! Here’s the final node tree of this project.

Figure 11.13: The final node tree
The beauty of proceduralism is that you can still edit your Curve object in Edit Mode after creating your node tree, and your wall will update accordingly!
Tip
Be sure to mostly move on the X and Y axes only. Curves might be unpredictable in this calculation method when moving on the Z axis. You can make sure to only move on the XY axis by pressing G and then Shift + Z.
Play around with the various variables or Group Input nodes we’ve created and have some fun with them!
Summary
Section titled “Summary”In this chapter, you learned how to create a procedural brick wall generator using Geometry Nodes in Blender. Building on the previous chapter’s concepts, you used a Curve object as the base input for the wall. You adjusted parameters such as wall height, brick size, randomness, and the gap between bricks.
The steps included instancing bricks on the curve, creating layers, and adding randomness for realism. First, you created a curve in the Viewport, then used a Resample Curve node and Instance on Points node to place bricks along the curve. You ensured the bricks aligned correctly and added six group inputs to control the brick size, height, and other variables.
By the end of this exercise, you have a fully procedural brick wall that can be adjusted in real time by modifying the curve and input variables.
In the next chapter, we’ll look at how to create a procedural LED panel.