New nodes?
Created by: portnov
Hi all. After playig with Sverchok a bit, it seems to me it lack some number of higher-level nodes. I wonder why? Is it like in contradiction with Sverchok's philosophy or just because no one managed to implement them yet? In last case, i beleive i can help :) Most of these can be implemented via combination of existing nodes. But such implementation will cause maintainability problems (it's harder to work with a 100-nodes tree than with a 20-nodes), and, potentially, performance problems. Moreover, i beleive such nodes could become sort of higher-level building blocks, and used several times even in one tree. So here a propose a list of such nodes. Let's discuss, maybe some of this functionality will be better to have in some of existing nodes, or split one item into two to have more orthogonal set of nodes. Order is random, i put numbers only for futher reference.
- "N-Gon". Generate a regular polygon with N sides. This is, in my mind, a generalization of Circle node. Added features: 1) optional randomization of vertices location, with separate control over randomization amplitude in R (radius) and Phi (angle) directions; 2) option to connect n'th vertex not with (n+1), but with (n+k) — this will create star-shaped polygons. The last option, in most cases, will be usable only in combination with existing "Intersect Edges" node. I have an implementation of this — i'll do a pull request if you wish.
- "Zip vertices". Given two lists of vertices, produce a list of edges, which connects n'th vertex from first list with n'th vertex from second (obviously, it will need to re-enumerate vertices first). Now it can be implemented with "Range Int" + "List Length" + "List shift" + "List match" + "List Zip". Probably, it will be enough to add new output slot to List Match node, which will output pairs of indicies of matched items (not items themselve, but their indicies).
- "Shuckhov". Given two lists of vertices, produce a list of edges, which connects n'th vertex from first list with (n+k)'th and with (n-k)'th vertex from second list (do `wrap' if needed). For example, for two circles of 10 vertices each and with k=3 or 4 this will produce some part of one-sheet hyperboloid (smth like Shukhov's tower http://dic.academic.ru/pictures/wiki/files/83/Shukhov_tower_by_Sergei_Arsenyev.jpg)
. Useful mostly in comibnation with "Intersect Edges". I have an implementation of this as a ScriptNode.
- "Fibonacci". Produce Fibonacci's sequence. Inputs: number of items to produce, first and second items (default 1.0). Maybe also Maximum (to rescale whole created sequence so that last number will be equal to given maximum)? Output: N float numbers. I have an implementation of this as a ScriptNode.
- Exponential sequence. Given x_0 and alpha, produce sequence with x_n = x_0 * exp(alpha*n) for given range of n (from .. to). Or maybe better specify exponent's base explicitly (x_n = x_0 * base^n) ? (this can be implemented with Range Float + Math, but why do we need two nodes instead of one?...). Maybe better add this as an option to Range Float node.
- "Cartesian product". Given two sets of vertices (V1 of M vertices and V2 of N vertices), produce a (concatenated) set of copies of V1, each of which is translated (moved) to location of one of vertices from V2. So that will produce M*N vertices. For example, given V1 = output from Line node, and V2 = 90-degrees rotated output from the same Line node, this will produce output like of Plane node. Given V1 = output from Plane and V2 = (rotated) output from Line, this will produce 3-dimensional cartesian grid. And so on. (currently this can be implemented with ~4 nodes).
- "Randomize". Given set of vertices, a random seed and range (3 ranges for 3 dimensions), produce the same set with each vertex moved randomly in 3 dimensions. Currently can be implemeted with Random vector + Vector out + (3* Math or Formula) + Vector In + Move.
- "Iterate". In the ideal world, this would take a set of vertices V and an arbitary transformation F, and produce set of vertices as V + F(V) + F(F(V)) + F(F(F(V))) + ... (N times). In terms of Sverchok, let's begin with affine transformations only — in this case F can be represented with Matrix input slot.
- Re-implementation of Blender's usual primitive meshes as Generators: IcoSphere, Cone, Torus. By the way, what about Susanne? :) It would be nice to have it, or a "traditional" teapot, or another "mascot" - may be, low-poly 3d model of cricket? :)