The new NodeBox forum is live! Everything from support.nodebox.net moved here: sign in with the same email to pick up your old posts. Something not working? Write to forum-support@nodebox.net.

NodeBox 3From the old forum

List or tuple output in a new node for superformula

3 replies Last reply

  1. Hi all,

    this is my first post regarding the fabulous NodeBox3.

    I wanted to implement the code for superformula and [supershape] (http://nodebox.net/code/index.php/Supershape) that was already a part of the NodeBox 1 library in NodeBox 3. I transfer the Python code easily for the single point along the supershape curve, but for path drawing it uses _ctx. start and end points. The output of the basic supershape function is a point, but in NodeBox3 I don`t know how to transfer it to a real point coordinate since it is a tuple and when I try to connect to i.e. point node I get the error that PyTuple cannot be cast to java.lang.Double.

    Also, when I use function that returns a list, it works normally in Python code, but in NodeBox 3 I see the output is horizontal, i.e. all list nodes recognize it as a single line and not a list. How to fix this, or is it even necessary?

    Copy link
  2. Sorry for replying to my own topic but I wanted to attach one possible solution for the problem at hand.

    It has a simple .py file I have used in new nodes. This file has single-output functions, of which one (superformula) has a sine and the other (superformula1) has a cosine output that could be transfered to a point.

    Still I dont think this is the right solution since I cant reconstruct exact supershapes.

    Copy link
  3. Here is one solution I managed to pull out but still it is not proper I think. It uses python code (part of the old nodebox library) and it splits the output of basic function to two separate nodes (supershape and supershape1 one returning the sine and other returning cosine). Some shapes arise but I don`t think they are supershapes sensu supershape formula.

    Copy link

Know something that helps?

Sign in with your email address to reply. No password needed.

Sign in to reply