This patch introduces an extrude node with three modes. The vertex mode is quite simple,
and just attaches new edges to the selected vertices. The edge mode attaches new faces
to the selected edges. The faces mode extrudes patches of selected faces, or each selected
face individually, depending on the "Individual" boolean input.
Attribute Propagation
Attributes are transferred to the new elements with specific rules.
Attributes will never change domains for interpolations. Generally boolean attributes are
propagated with "or", meaning any connected "true" value that is mixed in for other types
will cause the new value to be "true" as well. The "id" attribute does not have any special
handling currently.
- Vertex Mode
- Vertex: Copied values of selected vertices.
- Edge: Averaged values of selected edges. For booleans, the edge is selected if any of the connected edges are selected.
- Edge Mode
- Vertex: Copied values of extruded vertices.
- Connecting edges (vertical): Average values of connected extruded edges. For booleans, the edge is selected if any of the connected extruded edges are selected.
- Duplicate edges: Copied values of selected edges.
- Face: Averaged values of all faces connected to the selected edge. For booleans, the face is selected if any of the connected faces are selected.
- Corner: Averaged values of corresponding corners in all faces connected to the selected edge. For booleans, the corner is selected if one of those corners are selected.
- Face Mode
- Vertex: Copied values of extruded vertices.
- Connecting edges (vertical): Average values of connected selected edges, not including the edges "on top" of extruded regions. For booleans, the edge is selected when any of those connected extruded edges were selected.
- Duplicate edges: Copied values of extruded edges.
- Face: Copied values of the corresponding selected faces.
- Corner: Copied values of the corresponding corner in the selected faces.
- Individual Face Mode
- Vertex: Copied values of extruded vertices.
- Connecting edges (vertical): Average values of the two neighboring edges on each extruded polygon. For booleans, the edge is selected when at least one of the neighbors on the extruded face were selected.
- Duplicate edges: Copied values of extruded edges.
- Face: Copied values of the corresponding selected faces.
- Corner: Copied values of the corresponding corner in the selected faces.
Differences from edit mode
In face mode (non-individual), the behavior can be different than the extrude tools
in edit mode-- this node doesn't handle keeping the back-faces around in some cases.
The planned "Solidify" will handle that use case instead, and keeping this node simpler
is preferable at this point, especially because that sort of "smart" behavior is not that
predictable and makes less sense in a procedural context.
In the future, an "Even Offset" option could be added to this node hopefully fairly
simply. For now it is left out in order to keep the patch simpler.
Implementation
For the implementation, the Mesh data structure is used directly rather than converting
to BMesh and back like D12224. This optimizes for large extrusion operations rather than
many sequential extrusions. While this can be slightly more verbose, it has a few important
benefits: First, there is no inefficient conversion to and from BMesh. The code only has
to fill arrays and it can do that all at once, rather than working as a combination of
many smaller operations. This makes each component of the algorithm much easier to
optimize. It also makes the attribute interpolation more explicit, and likely
faster. Only limited topology maps must be created in most cases.
While there are some necessary loops and allocations for the entire mesh, I tried to keep
everything I could on the order of the size of the selection rather than the size of the mesh.
In that respect, the individual faces mode is probably the best, since there is no topology
information necessary from the input mesh, and the amount of work just depends on
the size of the selection.
These are the test files I used during development. When this is committed I will turn them
into a bunch of regression tests. For reviewers, I suggest looking through the file to
make sure the behavior in the various cases is expected.




