Skip to content
ImagineWorld

Creating and Modifying Text in the Geometry Node Editor

node_idnode-book_procedural-3d-modeling-using-geometry-nodes-in-blender_chapter-07-creating-and-modifying-text-in-the-geometry-node-editor
node_typechapter-node
schema_profileworld.chapter_node.v1
statusactive
entropyhigh
manifoldworld
domainimagineworld.net
authorityinforms
layercorpus
chapter_num7
chapter_titleCreating and Modifying Text in the Geometry Node Editor
governed_byCORPUS
constitutional_citationCONSTITUTION
local graph

Chapter 7 — Creating and Modifying Text in the Geometry Node Editor

Section titled “Chapter 7 — Creating and Modifying Text in the Geometry Node Editor”

In the previous chapter, we introduced you to the spreadsheet. In this chapter, we will introduce you to another important part of the Geometry Nodes world, the String system. This is also referred to as the Text system of the Geometry Node editor. You will learn about how strings work and function in the Geometry Node editor. You will also learn how to modify and create strings on your own.

Using strings along with Geometry Nodes is a great skill to have if you want to visualize anything text-related procedurally.

In this chapter, we’ll cover the following topics:

  • Introducing strings
  • Exploring the nodes we will use in this chapter
  • Converting strings into a usable mesh
  • Exercise – creating a procedural 3D ambigram

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 and demo from this chapter in the common .blend file in the GitHub repository.

In this section, we will give you an introduction to the String system of the Geometry Node editor inside Blender.

In the Geometry Node editor, we have various nodes at our disposal to modify and create text procedurally.

As we discussed in Chapter 1, string node connections can be found using a blue -colored socket. This socket works as an input/output and will carry over string data types.

The following figure shows what the string node connection looks like:

Figure 7.1: The string node connection

The strings in the Geometry Node editor work via underlying curves. This is also the case when adding a normal text object to your Blender project. The upside of this is that we can modify these curves like any other Curve object in the Geometry Node editor, such as modifying the shape of the curve, adding noise to a curve, or instancing points on a curve.

Just like the other parts of the Geometry Node editor, we can also procedurally generate strings using the various string nodes we have in Blender, which we will demonstrate in the exercise at the end of this chapter.

In this section, we’ve learned how the String system works in the Geometry Node editor and how we can recognize its node connection. In the next section, we’ll learn about the nodes we’ll use in this chapter.

Exploring the nodes we will use in this chapter

Section titled “Exploring the nodes we will use in this chapter”

In this section, we will be introducing you to the various nodes that we can use to create, manipulate, and convert strings in the Geometry Node editor. But first, let’s talk about where to find string nodes.

Like any other node in the Geometry Node editor, string nodes can be found by pressing the Add button in the Geometry Node editor or by pressing Shift + A. Pressing either of those will bring up the menu you can see in Figure 7.2:

Figure 7.2: The Add menu

In this menu, you can hover your mouse over the Utilities entry. In the next list, you can hover your mouse over the Text entry. This is where all the Text- and String-related nodes will reside.

Figure 7.3: Text entry

The nodes you see in Figure 7.3 are the string nodes we’ll cover in this chapter.

Now, we will introduce you to all the different nodes that we will be familiarizing you with in this chapter. These can be divided into three categories:

  • Nodes that are used to create strings
  • Nodes that are used to modify strings
  • Nodes that are used to convert strings into geometry

Let’s go over each of these categories.

The nodes that will be introduced to you next are nodes that are designed to help you create and procedurally generate strings.

The String node is used to convert an input box into a string node connection.

Figure 7.4: The String node

This node allows you to put any text into the textbox, and it will output the text as a string node connection; it’s pretty straightforward.

In the following screenshot, you can see the Value to String node. As the title of this node suggests, this node converts a value into a string.

Figure 7.5: The Value to String node

As you can see in Figure 7.5, we can provide a Value input and a Decimals input. The Decimals input allows you to change the location of the decimal point in your value. If the decimal point is at the lower end, your value might be rounded to the floor or ceiling.

This node will output the values you’ve provided in a string format.

The following nodes are used to modify existing strings by performing word processing on your inputted string. The output of these nodes will be the processed string.

Here, you see the Join Strings node. This node allows you to combine multiple strings together into one string.

Figure 7.6: The Join Strings node

This node presents two inputs; the first input is the Delimiter input. This input allows you to put characters between the different strings you process in this node.

The second value, the multi-connection Strings input, allows you to connect as many strings as you want to join into one big string.

Now, we’ll talk about the String Length node. This allows you to output the length of your inputted string as an integer value.

Figure 7.7: The String Length node

This node presents us with a String input node connection, but we can also make use of the convenient input box right next to it.

The length of the inputted string will be outputted as an integer value called Length.

Next, we have the Replace String node. This node performs search and replace operations within your string according to your inputs.

Figure 7.8: The Replace String node

The first input in this node is the String input, which is your base string or text. The next input, the Find input, allows you to input a string to search for, and after that, you can use the Replace input to replace the string you searched for in the Find input.

In Figure 7.9, you see the Slice String node. This node allows you to cut off certain parts of your inputted string.

Figure 7.9: The Slice String node

The first input, the String input, requires your base string. The Position integer value then defines at what character from the left the string should be cut off. After that, the Length integer value defines how long the final string should be after being cut off from the right side.

The following nodes are the nodes used to convert the string node connection to a Geometry node connection, in other words, curves and mesh.

The String to Curves node is very important when working with strings in the Geometry Node editor.

Figure 7.10: The String to Curves node

This node allows you to output your strings to a viewable format; in other words, it converts your string to curve instances, which can be viewed in the Viewport.

As you can see from Figure 7.10, many of these options resemble the text properties we see when we add a Text object in Blender. The difference is that these values are controllable via the Geometry Node editor, which gives lots of flexibility to your projects.

It is notable to mention that the curve this node outputs won’t be filled in. So, it will just output an outline of the string. To fix that, let’s take a look at the next node.

As the title of this node suggests, the Fill Curve node allows you to fill Curves, including the outlines of string Curves. We can use this after the String to Curves node to fill in our text.

Figure 7.11: The Fill Curve node

We are only presented with two buttons on this node: the Triangles button and the N-gons button. In Figure 7.12, you can see the difference in topology for each of the two options.

Figure 7.12: Difference in topology

Using the Triangles mode, the top faces of the string will be filled in using triangles. You should use this method most of the time since Blender is not optimized to work with N-gons. You should only use N-gons if you specifically need them. Some examples of this are if you want to do special kinds of operations after this node, such as extruding, triangulating, or shading to smooth your object.

In this section, you’ve learned about the various nodes we will be using in this chapter, along with the functions of the nodes. In the following section, we will demonstrate how to convert strings to usable mesh.

In this section, you’ll learn a step-by-step approach to how to make your strings visible in the Geometry Node editor. Learning how to do this is crucial for using strings in the Geometry Node editor because, without these nodes, you won’t be able to visualize the text you’re generating. Let’s get started with the most important node, the String to Curves node.

As explained in the previous section, we will use the String to Curves node to convert your string into a series of curves to make the string visible in the Viewport.

Let’s demonstrate this by adding a String node and a Group Output node. You can write something in the String node; I have used the input Siemen Lens for the example.

Drop in the String to Curves node between these two nodes, connect the String node connections to each other, and connect the Geometry node connections to each other, as shown in Figure 7.13. Once you do this, you’ll see that a curve with your string appears!

Figure 7.13: String to Curves demonstration

You will notice that the text is now visible, but the text is not filled. To fix that, let’s take a look at the next step.

To make the filling of the text visible, we will make use of the Fill Curve node. Let’s drop in this node between the String to Curves node and the Group Output node, as shown in Figure 7.14:

Figure 7.14: Fill Curve demonstration

We can see that the string we’ve written is now easy to read in the Viewport. As noted in the preceding screenshot, we can also see that this has now become a Mesh object, rather than a Curve object.

This last step is completely up to you. If you want to extrude your text after doing all these steps, we can use an Extrude Mesh node to extrude the current geometry.

To extrude this geometry, let’s drop in an Extrude Mesh node between the Fill Curve and Group Output nodes, as shown in Figure 7.15:

Figure 7.15: The Extrude Mesh node demonstration

After we have dropped in this node, we can see that the effect is immediately noticeable. The text is no longer flat, as seen in Figure 7.15.

In this section, you’ve learned how to visualize your text by converting your string to curves, filling your curves, and extruding these curves.

You now know the basics of the String system in the Geometry Node editor, and you are ready to move on to this chapter’s exercise, where you will make a procedural 3D ambigram.

Exercise – creating a procedural 3D ambigram

Section titled “Exercise – creating a procedural 3D ambigram”

In this exercise, it’s time to put your newfound skills to the test in making a 3D ambigram. Let’s start by explaining the basics.

A 3D ambigram is a visual design or word that retains its readability and meaning when viewed from different perspectives or orientations in three-dimensional space.

Unlike a traditional ambigram, which is usually designed for 2D surfaces (such as rotating a word upside down), a 3D ambigram can be interpreted correctly when viewed from various angles, such as when rotated or seen from different sides of a physical object. This requires a creative blend of typography and geometry.

Figure 7.16 shows an example of a 3D ambigram of the words Yes and No:

Figure 7.16: 3D ambigram

In this exercise, we’ll explore how to create this phenomenon procedurally with up to four different angles or phrases. Let’s start by figuring out how we will achieve this procedurally.

We will go through the following steps to procedurally make this 3D ambigram:

  1. Create an extrude of a string we give.
  2. Extrude this string on both sides so our geometry is in the middle.
  3. Create multiple strings to intersect with each other.
  4. Use a Mesh Boolean node to calculate the properties of the 3D ambigram.
  5. Clean up our node tree by the use of Group Inputs.

Now that you know how we will achieve this effect, let’s get started:

  1. Open your Geometry Node editor and add a new node tree to the default cube. Since we won’t need the Group Input node just yet, you can go ahead and delete it from your node tree.
  2. Let’s start this journey with a String to Curves node. This will be the heart of this node tree as it converts any string to a geometry we can use in Blender.
  3. Add a String to Curves node and connect the Curve Instances input to the Group Output node. However, you will see that nothing appears. This is because we will still have to configure this node correctly.
  4. Use the default settings for this node except for Text Horizontal Alignment and Text Vertical Alignment; we’ll center those.

Figure 7.17: Settings for the String to Curves node

This will ensure that our text is centered on all the axes, which is crucial for this exercise.

  1. At our String input, let’s plug in a String node, which will be important later on. In this String node, we will enter PROCEDURAL, but you can enter what you like.

Tip

Keep in mind that you’re going to get the best results when using uppercase letters because they tend to be all the same size.

If you followed the previous steps correctly, this is what your current node tree should look like:

Figure 7.18: Your current node tree

Now, it’s time to start converting this curve into an extruded mesh:

  1. To start this process, we can use a Fill Curve node as we used before. Drop this node between the String to Curves node and the Group Output node.
  2. Let’s select the N-gons option on our Fill Curve node. This will be important for shading our mesh smoothly later on. You will see that your text will now be filled in the Viewport.
  3. The next step is to extrude the mesh we have now. To do this, we just have to drop in an Extrude Mesh node, as we explored in the demo mentioned before.
  4. Choose an offset of 10. As you can see in your Viewport, the text is now extruded vertically, as shown in Figure 7.19:

Figure 7.19: Your current node tree

We need to extrude the text from the other side too to make this text centered to our origin point.

  1. To do that, let’s add a Join Geometry node after our Extrude Mesh node.
  2. Let’s duplicate our Extrude Mesh node and wire it up in the exact same way as the other Extrude Mesh node. The difference is that, this time, we’ll set the offset value negatively (-10).
  3. Due to the fact that Blender does not like negative values on extrusions, we’ll have to flip the normals of the negative extrusion. To do that, let’s put a Flip Faces node between the Extrude Mesh node and the Join Geometry node.

If you followed these steps correctly, this is what your current node tree should look like:

Figure 7.20: Your current node tree

Now that we have our extruded text how we want it, it’s time to transform this text into the position we need it in.

  1. To do that, let’s rotate this text 90 degrees. Along with that, we will also need an extra Z rotation value, which will be important later on to decide the angle of the 3D ambigram.
  2. Drop in a Transform Geometry node between the Join Geometry node and the Group Output node.
  3. We want to control the rotation, so let’s connect a Combine XYZ node to the Rotation input of our Transform Geometry node. This will ensure we can edit the X, Y, and Z values separately.
  4. By default, the values on the Combine XYZ node will be in radians, so we will need to convert these over using a Math node set to To Radians. Let’s connect two of these nodes, one to the X value and one to the Z value.
  5. In the first To Radians Math node (the one responsible for the X value), let’s enter a value of 90. This will twist our text 90 degrees.
  6. At the second To Radians Math node (the one responsible for the Z value), let’s connect a Value node. This value will ensure we can spin the text around to determine the angle of the 3D ambigram.
  7. The last step is to add a Realize Instances node at the end of our node tree, between the Transform Geometry node and the Group Output node. This will ensure our mesh is recognized as a real mesh instead of as an instance. This will be important at the step where we use this mesh to perform a Boolean operation.

We now need to copy all of these nodes again for the other text field. But that would be too much work. We can simplify this by creating our own node to do all these steps for us.

To do that, select all the nodes except the String, Value, and Group Output nodes and press Ctrl + G. This will open up a new branch in the Geometry Node editor, called a group.

If you have followed all of the previous steps correctly, this is what this group should look like:

Figure 7.21: Your node group

This node group is now finished. You can get out of this node group by pressing Tab. Once you return to your main node tree, you can see that the group has now become a simple NodeGroup node, as shown in Figure 7.22:

Figure 7.22: Your main node tree

This is exactly what we need to easily duplicate our node tree to add another text. It’s also notable to mention that we now do not need the String and Value nodes anymore. You can delete them.

Now, it’s time to perform our Boolean operations:

  1. After NodeGroup, let’s add a Mesh Boolean node set to Intersect. Let’s also set the solver algorithm to Exact. This will ensure we get fewer visual glitches in our 3D ambigram.

Note

Keep in mind that the Mesh Boolean node is an extremely power-hungry node and requires a lot of processing power. Make sure you have saved your project before continuing!

We will be learning more about the Mesh Boolean node and its inner workings in Chapter 9.

  1. Let’s also check the Self Intersection option to improve our end results.
  2. Once you have connected NodeGroup to the Mesh Boolean node, you will see that nothing happens. This is because we need another NodeGroup node to add two texts.
  3. Duplicate NodeGroup and change the String value to something else. In this exercise, we’re going with the word GEOMETRY.

Remember the value we spoke about that we will use to rotate the angle of the ambigram? That’s what the second input of NodeGroup does.

  1. On the second NodeGroup, let’s set this value to 90, which will indicate 90 degrees.
  2. Once you have done that, let’s connect this NodeGroup node to the Mesh Boolean node as well.

This might slow down your computer significantly as it’s calculating the 3D ambigram, but after it’s finished, your Viewport should look something like this:

Figure 7.23: Your current node tree

Right now, we’re using three text values, but what’s stopping you from adding up to four values? Be sure to append the Rotation value accordingly. As a demonstration, let’s set another NodeGroup node with the word MODELING at 45 degrees, and let’s connect it to the Mesh Boolean node as well.

If you finished all of this, this is your final result. Keep in mind that this effect is best viewed in Orthographic View in Blender:

Figure 7.24: Your final result

And that brings us to the end of this exercise!

In this chapter, you learned about the various nodes we can use to create, manipulate, and convert strings. We also explained the important string nodes in detail.

Lastly, you learned how to make a procedural 3D ambigram using the nodes you learned about in this chapter, combining your skills using strings and Mesh Boolean nodes in the Geometry Node editor.

In the next chapter, we will teach you how to edit curves with nodes.