Created by: portnov
Addressed problem description
Our current "Formula" node has a couple of problems:
- Inconvenient syntax with only variables being available "X" and "n[0]" .. "n[150]"
- weird code with Lenin and some other strange people being involved for some reason >_<
It is also not very convenient to use it to produce curves or surfaces, because you have to write something like "[sin(n[0]), cos(n[0]), 0]".
Solution description
Re-implement Formula node:
- Allow to write arbitrary Python expressions with arbitrary variable names, so that you can just write
R*sin(phi)
. Use the same technique as in "mesh evaluate" node to manage input sockets. - Add possibility to write not only single formula, but up to 4. So to generate an ellipse, you have to write
A*cos(t)
in one input box,B*sin(t)
in another, and that's it, no brackets and so on. By default, show only one input box to save screen space for most cases. - Support a flag to enclose each vector produced by several formulas into separate sub-list. It is usually required when you have more than one formula; it is usually not required if you have only one formula; but there may be other options.
- Support a flag to enclose the whole output into additional pair of brackets, which other nodes may want to see.
Preflight checklist
Put an x letter in each brackets when you're done this item:
-
Code changes complete. -
Code documentation complete. -
Documentation for users complete (or not required, if user never sees these changes). -
Manual testing done. -
Unit-tests implemented. -
Migration from old node supported. -
Ready for merge.