diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-28 22:38:27 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-28 22:38:27 +0300 |
commit | 482d431bb6735e8206961bd1115d2be7e63572b1 (patch) | |
tree | f47f10616f1f943def2bff975a6a869534feccc1 /source/blender/blenkernel/BKE_node.h | |
parent | 25533dbe219f8bbcb3f04ffe2ff1e57599addf3f (diff) |
Geometry Nodes: Curve and mesh topology access nodes
This patch contains an initial set of nodes to access basic
mesh topology information, as explored in T100020.
The nodes allow six direct topology mappings for meshes:
- **Corner -> Face** The face a corner is in, the index in the face
- **Vertex -> Edge** Choose an edge attached to the vertex
- **Vertex -> Corner** Choose a corner attached to the vertex
- **Corner -> Edge** The next and previous edge at each face corner
- **Corner -> Vertex** The vertex associated with a corner
- **Corner -> Corner** Offset a corner index within a face
And two new topology mappings for curves:
- **Curve -> Points** Choose a point within a curve
- **Point -> Curve** The curve a point is in, the index in the curve
The idea is that some of the 16 possible mesh mappings are more
important, and that this is a useful set of nodes to start exploring
this area. For mappings with an arbitrary number of connections, we
must sort them and use an index to choose a single element, because
geometry nodes does not support list fields. Note that the sort
index has repeating behavior as it goes over the "Total" number of
connections, and negative sort indices choose from the end.
Currently which of the "start" elements is used is determined by the
field context, so the "Field at Index" and "Interpolate Domain" nodes
will be quite important. Also, currently the "Sort Index" inputs are
clamped to the number of connections.
One important feature that isn't implemented here is using the winding
order for the output elements. This can be a separate mode for some
of these nodes. It will be optional because of the performance impact.
There are several todos for separate commits after this:
- Rename "Control Point Neighbors" to be consistent with this naming
- Version away the "Vertex Neighbors" node which is fully redundant now
- Implement a special case for when no weights are used for performance
- De-duplicating some of the sorting logic between the nodes
- Improve performance and memory use of topology mappings
- Look into caching some of the mappings on meshes
Differential Revision: https://developer.blender.org/D16029
Diffstat (limited to 'source/blender/blenkernel/BKE_node.h')
-rw-r--r-- | source/blender/blenkernel/BKE_node.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 625c4d87bcd..f79fefcae24 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -1532,6 +1532,15 @@ struct TexResult; #define GEO_NODE_SAMPLE_NEAREST 1175 #define GEO_NODE_SAMPLE_NEAREST_SURFACE 1176 #define GEO_NODE_INPUT_CONTROL_POINT_NEIGHBORS 1177 +#define GEO_NODE_CURVE_TOPOLOGY_CURVE_OF_POINT 1178 +#define GEO_NODE_CURVE_TOPOLOGY_POINTS_OF_CURVE 1179 +#define GEO_NODE_MESH_TOPOLOGY_OFFSET_CORNER_IN_FACE 1180 +#define GEO_NODE_MESH_TOPOLOGY_CORNERS_OF_FACE 1181 +#define GEO_NODE_MESH_TOPOLOGY_CORNERS_OF_VERTEX 1182 +#define GEO_NODE_MESH_TOPOLOGY_EDGES_OF_CORNER 1183 +#define GEO_NODE_MESH_TOPOLOGY_EDGES_OF_VERTEX 1184 +#define GEO_NODE_MESH_TOPOLOGY_FACE_OF_CORNER 1185 +#define GEO_NODE_MESH_TOPOLOGY_VERTEX_OF_CORNER 1186 /** \} */ |