Grasshopper join surfaces
The Pufferfish is one of few animals which is capable of changing its shape.
This plugin is a set of 280 components which focuses on Tweens, Blends, Morphs, Averages, Transformations, & Interpolations – essentially Shape Changing. Pufferfish mainly uses parameters and factors for inputs for more custom control over operations like tweens and grids as opposed to grasshoppers usual division count inputs. These components are accompanied by support components which are useful methods for tween / blend / moprh operations such as making curves compatible, a custom curve graph mapper, and a multi-threaded morph to twisted box. In addition, there are extra components which simplify some common grasshopper operations such as testing for equality within a tolerance and rounding to nearest numbers. Please email me if you find any bugs to help make this toolset better. Works with Grasshopper for Rhino 5, Rhino 6, and Rhino Mac. Pufferfish is written in C# as a .gha file. Make sure to read the credits below.
Join the Pufferfish Grasshopper forum group here: www.grasshopper3d.com/group/pufferfish
I would like to make a special thanks to David Stasiuk and Mateusz Zwierzycki for their continual support and input on the Pufferfish code and letting me constantly bother them. Check out their plugins: Conduit, Cocoon, Tree Sloth, Owl, Anemone, Starling, & Squid.
- David Rutten for aide in implementing his Twisted Box Library.
- Daniel Piker for his reference definition on Quaternion rotation.
- Daniel Abalde for his reference on optimized corner finding.
- Petras Vestartas for his reference on RTree mesh welding.
- Mahdiyar Esmailbeigi for his reference on mass transformations.
- Andrew Heumann for his reference definition on rectangles by area.
- Aldo Sollazzo for his reference definition on discrete variables.
I would also like to thank Pavlina Vardoulaki for introducing me to shape blending techniques in Autodesk Maya which inspired many of Pufferfish’s components.
- Grasshoppers native “Interpolate Data” component can “Tween” simple data types such as numbers, colors, vectors and points already. Pufferfish’s Tweens of these types differ in 2 ways. The first being that Pufferfish has 3 types of tweens for each: Tween Two, Tween Consecutive, and Tween Through which perform the tweens in different ways with the input lists. The second difference is that Pufferfish uses interpolation types which match nurbs interpolation for simple data types. Those types are Linear, Chord, Square Root, and Uniform. Grasshopper’s “Interpolate Data” component uses Block, Linear, Cubic, and Catmull. Pufferfish also adds the ability to tween Planes, Surfaces, Meshes, and Twisted Boxes as well as average them.
- Grasshopper already has a native “Tween Curve” component however, it gets odd results sometimes, specifically when tweening polylines. Pufferfish corrects this with automatic internal polyline and curve compatibilization so that the results are similar to Rhino’s tweens. Pufferfish tween curve components also have different interpolation types as well as optional refit and sample point methods.
- Meshes must have the same topology to tween. Unlike surfaces, meshes which come from two different sources with different topologies are almost always impossible to rebuild (automatically) to have the same topology and point order for a meaningful looking tween. Please do not ask for this feature unless you can provide some information / documentation about how to do so. As recommended by Autodesk Maya for blending meshes “A common blend shape technique is to create duplicates of a base, deform the duplicates, then use them as targets. For example, you might make several copies of a face, and then alter the copies to create a smiling face, frowning face, a crying face, and so on.”
- Multi-Threaded components don’t always mean it is faster, multi-threading speed will depend directly on how many cores your computer has and how good those cores are.
- A few minor components may exist in some form elseware in other plugins (it’s impossible to check them all). If they are in Pufferfish it is because I felt they are necessary to the workflow or that I required them to have different options and I cannot ensure the user has other plugins installed. For example, Pufferfish has a type of “Rebuild Surface” which varies from but exists also in Lunchbox and Peacock.
July 04, 2019 – Pufferfish V2.5
- Update to add 12 new components, such as Linearize Numbers to use sine graphs for tween factors to have wave like spacing, Tween Two Surfaces Along Curve, new Constrained Area / Volume components, and new Mirror / Combine components. Updates to the multi-threaded Mesh / Polysurface Boolean Twisted Boxes components to now be able to use multiple Meshes / Polysurfaces. Various other component updates, bug fixes, and code optimizations. Please read the installation text file first that comes with this download before installing Pufferfish.
May 17, 2019 – Pufferfish V2.4
- Re-uploaded Pufferfish V2.4 and Pufferfish V2.4 example files to fix the Multi-Threaded “Polysurface Boolean Twisted Boxes” component which was occasionally causing Rhino 5 to crash, inadvertently it is now faster as well.
May 14, 2019 – Pufferfish V2.4
- Update to add 55 new components. 3 new tabs (Transform, Domain, List). New options for Equalized, Weighted, and Degree on Tween and Twisted Box components. Multi-threaded Twisted Box components for morphing and geometry filling / subtracting. Some components renamed and organized in different tab locations. Many component updates, bug fixes, code optimizations, and option additions. Please read the installation text file first that comes with this download before installing Pufferfish.
Oct 24, 2018 – Pufferfish V2.3
- Update to add Normalized(N) input to the 17 Tween Through and Twisted Box Through components which enables the use of normalized factor values from 0 to 1. Also added a Flip Polysurface component. After installing the pufferfish2-3.gha, please close Rhino completely one time to avoid potential assembly reference errors with the “Twisted Box” components. Make sure to first remove any other versions of Pufferfish you may have installed. Pufferfish V2.3 works with Rhino 5, Rhino 6, and Rhino Mac. Some components require at least Rhino 5 SR14. Some versions of Rhino 6 Grasshopper have a mesh display issue not related to Pufferfish, if you see a weird mesh, try Recomputing Grasshopper until it goes away.
Oct 10, 2018 – Pufferfish V2.2
- Re-uploaded Pufferfish V2.2 to fix Offset Mesh component causing Rhino to crash when a null was input, re-uploaded Pufferfish V2.2 Examples as well.
Sep 27, 2018 – Pufferfish V2.2
- Re-uploaded Pufferfish V2.2 to update 5 components and add 1 more, re-uploaded Pufferfish V2.2 Examples as well.
Sep 19, 2018 – Pufferfish V2.2
- Update to add 10 new components for Numbers, Curves, and Surfaces. 40+ components updated, most Tween components rewritten for optimization, accuracy, and bug fixes. After installing the pufferfish2-2.gha, please close Rhino completely one time to avoid potential assembly reference errors with the “Twisted Box” components. Make sure to first remove any other versions of Pufferfish you may have installed. Pufferfish V2.2 works with Rhino 5, Rhino 6, and Rhino Mac. Some components require at least Rhino 5 SR14. Some versions of Rhino 6 Grasshopper have a mesh display issue not related to Pufferfish, if you see a weird mesh, try Recomputing Grasshopper until it goes away.
Aug 05, 2018 – Pufferfish V2.1
- Update to add 13 new components. Mostly utility and helper components. Additional inputs/outputs added to some components. General optimizations and fixes all around.Some components require at least Rhino 5 SR14. After installing the pufferfish2-1.gha, please close Rhino completely one time to avoid potential assembly reference errors with the “Twisted Box” components. Make sure to first remove any other versions of Pufferfish you may have installed.
May 16, 2018 – Pufferfish V2.0
- Update to add 16 new components. Most notably components for Tweening Curves Along Curves, A custom Curve Graph Mapper which accepts any and multiple curves as inputs to graph with, Unsplit Surface components for making polysurface like surfaces which read as one untrimmed surface, Twisted Box components like Sweep, Deform, Thicken, and Subdivide. Additional features and options added to previous components. General optimizations and fixes all around. Some component rearrangements in the tabs. Some components require at least Rhino 5 SR14. After installing the pufferfish2-0.gha, please close Rhino completely one time to avoid potential assembly reference errors with the “Twisted Box” components.
Apr 27, 2018 – Pufferfish V1.9
- Re-uploaded Pufferfish V1.9 examples to add new examples.
Apr 15, 2018 – Pufferfish V1.9
- Re-uploaded Pufferfish V1.9 to add a K (Keep) input on the Mirror Cut components dealing with geometry which gives the option of keeping the input geometry and mirroring them regularly if it is mirror cut into non-existence, or to output them as null/empty in that case. Re-uploaded the V1.9 example files as well.
Apr 13, 2018 – Pufferfish V1.9
- Update to add 26 new components. Most notably Mirror Cut components for all geometry types, Scale To Length, Twisted Box Curve Variable, and Twisted Box Pipe Variable, Parameter Mesh Surface, Trim components and others. Additional features, options, and outputs added to previous components. General optimizations and fixes all around. Some component rearrangements in the tabs and renamed. Some components require at least Rhino 5 SR14. After installing the pufferfish1-9.gha, please close Rhino completely one time to avoid potential assembly reference errors with the “Twisted Box” components.
Mar 02, 2018 – Pufferfish V1.8
- Re-uploaded Pufferfish V1.8 to add edges and faces outputs to the Deconstruct Twisted Box. Also added an Evaluate Twisted Box component and a Twisted Box Centers component. Re-uploaded the V1.8 example files as well.
Feb 16, 2018 – Pufferfish V1.8
- Update to add 13 new components. All Tween Curve and Tween Curve on Surface components have been completely re-written and include interpolation options. New components added, most notably Scale to Area and Scale to Volume components. Many other additions, options, and outputs added to previous components. General optimizations and fixes all around. Some component rearrangements in the tabs. Some components require at least Rhino 5 SR12. After installing the pufferfish1-8.gha, please close Rhino completely one time to avoid potential assembly reference errors with the “Twisted Box” components.
Jan 03, 2018 – Pufferfish V1.7
- Update to add 7 new components. Components from the Discrete Vectors plug-in (http://www.food4rhino.com/app/discrete-vectors) have been updated and are now a part of Pufferfish. Other minor updates and fixes. Some components require at least Rhino 5 SR12. After installing the pufferfish1-7.gha, please close Rhino completely one time to avoid potential assembly reference errors with the “Twisted Box” components.
Dec 29, 2017 – Pufferfish V1.6
- Re-uploaded Pufferfish V1.6 to fix a bug in the corner orders of Twisted Box components that use surfaces.
Dec 22, 2017 – Pufferfish V1.6
- Re-uploaded Pufferfish V1.6 to fix a bug with the Point Divide Curve Target component.
Dec 20, 2017 – Pufferfish V1.6
- Update to add 6 new components like Twisted Box Through Surfaces and Twisted Box Through Meshes with interpolation options. Tween Mesh and Tween Surface components now have interpolation options. Some component name changes, icon changes, updates. Some components require at least Rhino 5 SR12. After installing the pufferfish1-6 gha, please close Rhino completely one time to avoid potential assembly reference errors with the “Twisted Box” components.
Dec 04, 2017 – Pufferfish V1.5
- Re-uploaded Pufferfish V1.5 to fix a bug with the Move2Pt component not moving certain geometry types.
Nov 29, 2017 – Pufferfish V1.5
- Re-uploaded Pufferfish V1.5 and its examples to include 3 forgotten Twisted Box components. Twisted Box Array, Construct Twisted Box, and Deconstruct Twisted Box.
Nov 28, 2017 – Pufferfish V1.5
- Update to add 41 new components. The new components are primarily focused on a new tab for “Twisted Box” components. Additional various components added to the other tabs. Some updates to existing components. Some new components require at least Rhino 5 SR12. After installing the pufferfish1-5.gha, please close Rhino completely one time to avoid potential assembly reference errors with the new “Twisted Box” components.
Nov 08, 2017 – Pufferfish V1.4
- Update to improve algorithm for all “On Curve” components and all components with an “Interpolation Type” input.
Nov 01, 2017 – Pufferfish V1.3
- Update to fix a minor bug in all tween plane components with Quaternion rotation that would result in null planes when input planes X axis’s aligned. Added many new examples.
Oct 28, 2017 – Pufferfish V1.2
- Update to add 9 new components. 3 for tweening planes on curves with Quaternion rotation, 3 for tweening planes on surfaces with Quaternion rotation, 3 for tweening points on curves (like Grasshopper’s evaluate curve component except you can interpolate between user defined points on the curve rather than interpolating the entire curve) . Added tolerance input to “Is Arc/Circle/Ellipse” component.
Oct 22, 2017 – Pufferfish V1.1
- Update to add Quaternion rotation option to the Tween Planes components for smoother tween rotations and prevention of Gimbal lock. Suggested by Andrew Heumann, based on a grasshopper definition by Daniel Piker.
New Grasshopper Course: Surface Modeling in Grasshopper
David LeFevre’s course is going to walk you through a number of ways to create and manipulate surfaces using Grasshopper and Rhino.
We’ll start by showing basic methodologies for creating surfaces. Then, we’ll create a simple Grasshopper definition that will illustrate the basic principles of relationship modeling.
From there we’ll learn how to extract information from surfaces in order to create new geometries, we’ll learn how to sample an image to create parametric inputs, and finally, we’ll learn how to inform the selection of objects within arrays of multiple geometries.
When we’re finished you will have the knowledge you will need to construct your own parametric surfaces using Grasshopper and Rhino. Here’s a link to the course, below is a listing of the videos:
Chapter 1: Basic Surface Modeling Tools
- Loft Surface
- Sum Surface & Network Surface
- 1-Rail Sweep & 2-Rail Sweep
- Planar Surface & Extrude
- Pipe Component
- Offset Surface
Chapter 2: Building Parametric Surfaces
- Image Sampler
- Attractor Point Responsive Surface
- Surface Processing – Dividing the Surface
- Surface Processing – Sweeping Mullions
- Surface Processing – Responsive Mullion Standoffs
- Surface Selection with Lists
- Parametric Roof
Join over people who get free tutorials, articles, interviews & more!
Grasshopper Surface Manipulation
Using Grasshopper as a parametric design tool gives us the ability to study different design solutions. In this tutorial we will create a Grasshopper model that gives us the ability to study the openings in a curved roof. By changing the a sl />
Before we start building the grasshopper model we should determine some of its basic properties. We will start with a single curved surface in Rhino, which represents our roof. Our roof needs several openings to let light through. The openings are created by raising the middle of a line straight up creating a arc from one side to the other through this raised point. The aspects we want to study are how many openings we should have and how large they should be.
So our variables/parameters are:
- number of openings
- height at the middle of the openings
Building the grasshopper model
Step 1 – Preparing the Rhino scene
First of all we need to define our roof in Rhino. We do this by creating a curve and extruding it to get our surface.
It’s probably easiest to draw the curve in “Right”-view.
Now we will extrude this surface in a straight line.
Surface » Extrude Curve » Straight
It’s probably easiest to extrude the curve in “Front”-view.
Our surface should look something like this. This will be our starting point for the Grasshopper model.
Step 2 – Starting the Grasshopper model
First we have to define the surface we created in Rhino. Therefor we create a Surface component.
For users using Rhino 5 instead of 4 use:
Now we have the Surface component we can connect our Rhino surface.
RMB on the surface » select “Set one Surface” (or Brep) and click on the surface we created in Rhino
We need to divide the surface. There are several ways to divide a surface, but in this case dividing the edges is good solution. Thus, we need to identify the edges. We can do that with a BRep Components.
Now we connect the output of the Surface component with the input of the BRep Components.
The surface has four edges and we only need to div > Sets » List » List Item
For the two List Items we need to set which item from the list we want. We need to specify which two items of the list correspond with the two edges we need.
RMB on the i in the List Item » select “Set Integer” and set it to the right value
We might need to double check if we have the right edge. We need the two curved edges. We can check if we specified the correct edges by selecting the List Item and looking in the Rhino viewport to see which edges are selected (colored green).
Now we have the two edges identified we can divide them.
As we want to set the number of divisions for the curve, we create a Number Slider to control this.
We double-click on the number sl />
When we connect them, we will see the division on the edges of the surface in our Rhino view.
We need curves from the division points on one side to the division points on the other side.
Now we connect the two lists of division points.
The only problem is we don’t get the result we wanted. The lines are linked in a crossing pattern.
We need to reverse one of the lists of division points.
We need curves from the division points on one side to the division points on the other side.
Now the curves are correct.
Step 3 – Creating the second set of curves
We want to get the middle of our newly created division curves, so we use another Divide Curve.
We only need to divide the curves in two parts to get a point in the middle of the curve.
RMB on the N in the Divide Curve » select “Set Integer” and set it to 2
The Divide Curve creates three points on the curves, so we need another List Item to identify the correct point.
We need the second point, so we set the integer to 1 (computers usually start counting with 0, 1, 2, etc.).
RMB on the i in the List Item » select “Set Integer” and set it to 1
Now we have identified the second point, we want to be able to move it in the Z-direction to create the openings in the roof. An easy way to get to the Z-value is to decompose the 3d-point into X, Y and Z values.
We just simply connect the List Item to the Decompose.
As we wanted to manipulate the Z-value we are going to do two things. First we create an Addition component.
Secondly, we create a Number Slider to control the size of our openings.
After adding a value to the Z-value we can re-compose our 3d-point. We can do this with the component Point XYZ.
We just pass on the X and Y values from the Decompose component. The Z value will be the result of the Addition comonent.
Now that we have the raised midpoint of the curves, we can create arcs going from one side through the raised midpoint to the other side.
The points on the edges were already define to create the first curves, so we can use them again. We just need to make sure we connect them in the right order. We have now created the second set of curves.
If we connected the points correctly we see arcs being created in a crisscrossed pattern, instead of just one arc being created for every row of points. This has to do with the way data is gathered in Grasshopper. We will explain this in a later stage. For now all we need to know is that we need to flatten the data.
RMB on all the Inputs of the Arc 3Pt » click on “Flatten”
This will flatten our data, making it able to combine the different point data.
Step 4 – Creating the surfaces
We now have two sets of curves, and we want to create a loft from the first arc to the second straight line. We could do this in several ways, but in this tutorial we will clean the list of curves by removing the curves we don’t need. This means we will delete the first straight curve and the last arc.
With the Cull Index we can delete specific items from a list or set of objects.
We need to specify which items from the list we want to delete. Removing the first item of a list isn’t very complicated, because we know the first item always has the index number 0.
RMB on the I of the Cull Index » select “Set Integer” and set it to 0
Removing the last item from a list is a bit more complicated, because we need to know the length of the list. The length of the list is the number of items in the list.
The fact that computers start to count with zero, means that the number of values is always 1 higher than the highest list item. For example, if you have 4 points, the points are indexed as follows: 0, 1, 2 and 3. Therefore we need to subtract 1 from the list length to be able to select the highest list item.
RMB on the I of the Cull Index » select “Expression” and enter x-1
We now have the right items in the two lists, but if we try to loft the outputs of the two lists it won’t give us the desired result. It just makes one loft going through all the arcs and one loft going through all the straight lines. This happens because the two lists are structured in a way that Grasshopper combines all the items in one list to make the loft instead of combining one value of the first list with one value of the second list.
If we look at the data in the list by using a panel, we can clearly see different structures in both lists. Pay special attention to the darker yellow lines. We can see different numbers of zeros between the accolades. To be able to combine two lists, we need to get this structure identical in both lists.
First of all, what we can do is simplify the list structure. We could do this in more than one way, but in this case we will use the “Flatten Tree” component to do this. This component will get rid of any unnecessary layers in the list hierarchy.
The result is an />
We have to somehow tell Grasshopper to divide the lists in separate items, so it will loft them one by one.
We can now use these lists as input for the loft component.