In this post i will go back in time a little bit and talk about Dynamo 0.6.3. This is a script that I have wrote when I was asked by one of my fellow bloggers for help with Nathan Miller’s Attractor Wave node. It was evident that his node was lacking some functionality and that there were a few better ones already out there. Since my favorite was David Man’s Ripples Component for Grasshopper I decided to re-write it for Python/Dynamo and in the process create a better, more versatile solution.
Before I even get started this was the project that became the inspiration for this node, or at least that is the image that i was shown by my friend and and asked: “Can we make it like this?”
I thought that with the new geometry engine it would actually be easier to achieve this in the new Dynamo 0.7.1, but then i realized that you cannot use Python nodes and pass them as functions. That basic lack of functionality pushed me back to 0.6.3 where i could still do that. This solution is still possible in 0.7.1 but i would specifically iterate through all of the inputs. It’s not super hard, just more on the annoying side of things.
1. In a family mode (i am using a mass), create a surface and divide it into a grid of points.
2. I am also using Lunchbox’s Quads from Rectangular Grid node to create sets of 4 point quads in order to apply an Adaptive Component family to my grid.
3. Next up is creating a custom node for the Ripples effect. This one here is based on David Man’s Ripples component for Grasshopper. You can download it here. The idea is to create waves originating from specified points and then for each origin points create couple of basic properties like radius or diminishing rate. There is also a Boolean Toggle that controls whether the definition is additive or multiplicative. If you play around with it you will see how it works and what effects you can get from it. This node will need 5 inputs:
- Grid of points, but i am leaving it empty since I will use this node as a function and combine it with Map node.
- Boolean Toggle that specifies whether its an Additive or Multiplicative function.
- Origin points as a list.
- Radius for each origin point. List should match the number of origin points.
- Ripple Diminish rate from 0-1 where 1 is no diminishing and 0.1 is max diminishing.
Here’s code that goes into Python node:
4. Output of this node will be a series of numbers than can be used for example to specify panel opening size. In this case my panel is built in a way that i need to remap my numbers to something between 0.1 and 0.5 where 0.1 is closed and 0.5 is open. At the same time I want to limit the amount of panel types that I am specifying by creating ranges. If a number falls within one of these ranges it will be assigned an integer and this way i will create groups of the same panel types. Here’s what the definition looks like that accomplishes that:
Here’s the code that is in the Python node:
5. This gets then re-mapped using Remap component, and those values are used to drive the panel opening size.
Here’s what the panels look like:
Obviously you can also apply this transformation to an XYZ point and move it in a Z axis for example:
The effect could be a field of points:
Feel free to test it out and let me know if there is anything i can do to make it better.
Again, this is provided as is so I cannot guarantee that it will work on your project nor that i will be able to provide support. Also, please do not forget to give credit when you do use it.