Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formula node mk3 #2379

Merged
merged 7 commits into from
Mar 8, 2019
Merged

Formula node mk3 #2379

merged 7 commits into from
Mar 8, 2019

Conversation

portnov
Copy link
Collaborator

@portnov portnov commented Mar 6, 2019

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.

@portnov
Copy link
Collaborator Author

portnov commented Mar 6, 2019

screenshot_20190306_235158

@portnov
Copy link
Collaborator Author

portnov commented Mar 7, 2019

screenshot_20190307_190530

@portnov
Copy link
Collaborator Author

portnov commented Mar 7, 2019

screenshot_20190307_200145

@portnov
Copy link
Collaborator Author

portnov commented Mar 7, 2019

screenshot_20190307_202842

@portnov portnov changed the title Formula node mk3 (WIP) Formula node mk3 Mar 8, 2019
@portnov portnov merged commit 6a094ce into master Mar 8, 2019
@nortikin
Copy link
Owner

спасибо, Илья.

@zeffii zeffii added this to the 2.8 milestone Jun 19, 2019
@zeffii zeffii deleted the formula3 branch February 24, 2021 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants