顶点的边¶
选择顶点的相邻边并输出其索引编号。
该节点具有特殊性,因其在两个不同的域中运行。首先,它会为几何体中的每条边评估一个 权重。随后,对于上下文域中的每个项,它将执行以下操作:
基于 顶点编号 从几何体中选取一个顶点。
找到与该顶点相连的边。
按边的关联权重对其进行排序。
根据 编号排序 从上述排序列表中选取一条边,其中 0 表示权重最低的边,1 表示次低权重的边,依此类推。
输出边的几何体全局编号。
输入¶
- 顶点编号
用于查找边的顶点编号。
Note
若该输入未连接,则会改用上下文项的编号,这意味着该节点必须在点域中进行解算。
- 权重
几何体中边的权重。与其他遵循上下文域的输入不同,该输入始终在边域中进行解算。
边按其关联权重升序排列,若权重相同则按编号排序。
- 编号排序
The 0-based index of the edge to select from the vertex's sorted edges. If this value is outside the range of valid indices, it wraps around.
输出¶
例子¶
The example below creates a cone at each vertex of a "cube," aligned to the neighboring edge that's the most vertical.
First, we calculate a "verticality score" for each of the cube's edges. To do this, we subtract the positions of its vertices to get its direction vector, which we normalize and use to calculate the dot product with the Z axis. The absolute value of that gives us a number between 0 and 1, where 0 means fully horizontal and 1 means fully vertical.
Because the edges will be sorted by ascending weight, we set weight = 1 - verticality. This way, the most vertical connected edge of each vertex will have the lowest weight and come first in the list.
Next, in the point domain, we need to calculate the rotation of each cone. By using the 对齐旋转至矢量, the problem gets simplified and we only need to calculate a direction vector.
The direction vector of each cone is the centerpoint of the most vertical neighboring edge minus the position of the vertex. Finding that most vertical neighboring edge is where the Edges of Vertex node comes in: for each vertex, it sorts the connected edges by their weight and pick the first one (because the Sort Index is 0). Once we have the edge's index, we use the 在编号处评估 to retrieve its centerpoint.
With the rotations of the cones calculated, we use the 实例化于点上 to create them.
Example node setup. (Right-click and choose "Open image in new tab" to see a larger version.)¶
生成的几何体。¶