sully8391 Posted April 7, 2020 Share Posted April 7, 2020 I'd like to use Marionette to make an array of rectangles over some distance with the distance between each rectangle increasing by phi. If I use this network to control the rectangle's width and height, it works perfectly, but when I try to use the output of the range as an input to the y value of the point, it doesn't work, the rectangles are just spaced out evenly. Quote Link to comment
Grzegorz Krzemien Posted April 7, 2020 Share Posted April 7, 2020 @sully8391 I think that you need to rethink what you would like to do. Your network works like this: 1. create a range of numbers 2. Multiply these numbers by phi 3. Use this list of numbers as Y coordinate. This network returns a range of evenly multiplied numbers (each base number is multiplied by phi separately) so distances between rectangles are constant. E.g. 1st. point (0,0) 2nd. point (0, 161) where Y = 100*1,61 3rd. point (0, 322) where Y = 200*1,61 4th. point (0, 483) where Y = 300*1,61 and so on... You can see that distance between points is constant and is equal to step*phi As I understand you want to make a network that distributes rectangles at different distances using phi, yes? This will require different approach. You need to multiply a previous distance. E.g. 1st. point (0,0) 2nd. point (0,161) where Y = 100x1,61 3rd. point (0, 259) where Y = 161x1,61 4th. point (0, 417) where Y = 259x1,61 and so on... You can spot the difference. Hope you'll make it. If you have any questions just ask. Quote Link to comment
sully8391 Posted April 7, 2020 Author Share Posted April 7, 2020 Oh dear, this is what happens when I try to program at 4am. Okay, I see what's going wrong, but I'm having a hard time thinking of how to pull this off in Marionette. I know how I'd do this in Python: x = 0 y = 2 for item in range(10): z = 1.68 * (abs(x-y)) x = y y+= z But Marionette seems tricky when it comes to loops. Any tips or hints would be appreciated. Thank you! Quote Link to comment
MRoth Posted April 7, 2020 Share Posted April 7, 2020 I don't quite understand how your function calculates. That's why I couldn't recreate it with Marionette. But you can easily integrate the function into a node. Below are a few more examples of how you can create rows with ever increasing distances using Marionette. Rows.vwx Quote Link to comment
Grzegorz Krzemien Posted April 7, 2020 Share Posted April 7, 2020 I think MRoth has given you a nice hint. You can try to use some functions to create non-linear values. Quote Link to comment
sully8391 Posted April 8, 2020 Author Share Posted April 8, 2020 (edited) This is fantastic! I was wondering if you could just wrap up some Python in a Marionette node. What's the correct way to do so? Thanks so much! Edited April 8, 2020 by sully8391 Quote Link to comment
Grzegorz Krzemien Posted April 8, 2020 Share Posted April 8, 2020 @sully8391 The easiest way to create custom node is to modify existing one. You can double click on any node to check what is inside and change it. Keep in mind that you should delete the first line and change name of the new node in order to save your changes. Here is my example of what I think you have tried to do. SimpleLoopNode.vwx Quote Link to comment
MRoth Posted April 8, 2020 Share Posted April 8, 2020 13 hours ago, GRZEGORZ said: The easiest way to create custom node is to modify existing one. Thats what i actually did. For the node above I used the Int-Node as base.This, because it was already on the drawing and (whats more important) the input and output ports are correct. The Int-Node and your node both have an integer OIP input and a single output. This means no new ports need had to be created. It is always an effort to create new ports and therefore much easier to reuse existing structures. For the same reason, the node is not completely rewritten. I always try to copy and reuse as much as possible. It's a lot easier. After deciding which node to use as a basis (A decision on life and death😂), I deletet the first codeline. Without this step it isn't possible to change the code. Then i copied your code into the node and made some changes to create the output list. Next step was to integrate the Integer-Input and replace 1.68 through the code into the phi-node. Last but not least the inputs got new names and descriptions. Between these steps there was always a test whether the node still worked correctly. All in all, the creation of the node took about 5 minutes. This also explains the bad descriptions. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.