# Geometry Nodes - Extrude edge by ID

I want to be able to extrude edges of a mesh by ID number - e.g. extrude edge 2 and 3. Is this possible? I see the selection input socket of the node requires a boolean input, and I saw the post linked below where they create a 'mask' to feed into the socket. How would I build this mask using integers? Presumably, a list containing boolean values like 0,1,1,0 would work. But I can't see a way to build this list.

How can i extrude specific edges in geometry nodes?

Any suggestions?

I figured out a way to parse a string into a list of booleans:

Custom Group (hidden text settings don't matter, as long as they're in sync)

• This looks good... How did you input the list? I can't figure that much out :-/
– G.H.
Oct 24, 2022 at 11:17
• @G.H. when you press N key to open numbers panel in the geonodes tree editor, you will see a tab to specify inputs, you can add a string input here. Alternatively, if you connect an "empty" Group Input socket to a socket of type string, a new input will automatically be created of that type. Oct 24, 2022 at 12:56
• Ahh! I didn't see that tab. Thanks.
– G.H.
Oct 24, 2022 at 22:17

The concept of using a string to control the individual edges is strictly speaking an abuse of Geometry Nodes, but I'll let it stand anyway ;-)

Anyway, the idea can be refined and improved a bit:

Here I simply replace the number $$0$$ with a space (Note: Unfortunately you can't see it on the screenshot, but here it is important that you insert a space () in the Replace field!).

The node String to Curves creates an instance, but the output Pivot Point has then the value $$(0,0,0)$$. After that it is easy to derive a boolean value from it, which can be used directly as a selection.

• I was thinking about optimizing my setup for booleans... You probably noticed I set txt box width because it's a simplification of multi-digit numbers Oct 24, 2022 at 12:30
• Where does that "Lenght" node come from? I can't find it...
– G.H.
Nov 3, 2022 at 4:23
• @G.H. This is a vector math node. Here you can find more information if you are looking for a specific node: Can't find the node! Which node is available in which Blender version? Nov 3, 2022 at 7:44
• @quellenform, Thanks - the colour threw me off. In that case, this doesn't work for me. I've tried the same setup, but I find that if ANY value of the string is a 1, then ALL edges are extruded. If ALL values are 0, then no edges are extruded - but there is no individual control. I'm using Blender 3.3.0.
– G.H.
Nov 3, 2022 at 7:53
• @G.H. You did everything right, but unfortunately it was not clear in the screenshot (I added a note to the answer): You would have to enter a space in the Replace field for the second Replace String node. This will replace the number $0$ with a character that has no geometry and thus has the length $0$. Nov 3, 2022 at 11:35

You need to pass this list of integers to the geometry nodes setup somehow… You can combine simple comparisons with Boolean ORs:

You can more easily control more points (up to 31) using a ColorRamp node like in these answers:

How can I rotate individual curve points in geometry nodes?

Cycling /looping through a set of index values using geometry nodes to create animation

However, in your case it seems you want to input a list from outside… You can take a look here:

How to instantiate objects on individual/selected points in geometry nodes?

Here's a solution using a binary bitflag integer input.

It can be extended to an arbitrary number of indices up to 10, since it's elevated to 10^input it produces very high numbers. Higher values will produce negative numbers and fail.

Note if there would exist a "String to Value" node and if "Slice String" were to accept a field, this limitation could be lifted and a string input could be used.

• Very nice solution! ...but isn't it limited to a maximum of 10 digits? Oct 25, 2022 at 14:33
• Yup, it is, unfortunately ! :) If we could slice a string into a field and have a "String to Value" field node I think we could get past this limit, since strings are (theoretically) not limited in size. Oct 25, 2022 at 14:55
• This is what I'm doing here except you're smart enough to do it the easier way, you calculate the power and compare, rather than doing a logarithm. BTW, like I mention under the link, you can't start with a 0... Oct 25, 2022 at 14:58
• I updated that answer and argue there the maximum number of booleans stored in an integer is actually $7$, not 10! At least unless you're willing to make the first zeroes invisible, in such case it would be 8. np.float32(111111111) == 111111110.0 Oct 25, 2022 at 15:25
• Indeed, interesting ! Thanks for doing the computation. Oct 25, 2022 at 15:31