Here is the shortest possible way of generating quick parametric curves in Rhino Python. So, you may change the f, g, and h functions to test any function curve. In this Python code, the list comprehension [(f(t), g(t), h(t)) for t in [t0 + i*dt for i in range(int((t1-t0)/dt)+1)]] works by first generating a list of t values from t0 to t1 with an increment of dt using the inner […]
Posts categorized under Rhino Python
Here is a wave generator code I developed using Grasshopper and Python. While searching for a solution to the realistic water simulations, I came up with the Gerstner Waves. I tried to implement it. However, I came up with this final result, which is not a Gerstner Wave generator, but a much simpler one. It combines many user-fed wave components and calculates the resulting single wave. I played with this […]
Today’s beautiful curve is the spherical cycloid. It is a cycloid, rolling on a 3d circular path rather than a straight and 2d one. There are algebraic explanations of this curve. Therefore, I find it interesting to experiment with them, since it is more interesting than the regular planar cycloids, epicycloids, and hypocycloids. This curve is believed to have been studied first by Jean Bernoulli in 1732. The interesting and […]
Gyroid is a popular triply-periodic minimal surface. Although it is a mathematical entity, designers and architects like its approximations very much. We used an interpretation of Gyroid in the rammed-earth structure: “Common-action Wall” in 2017. In that project, we utilized its spatial quality of dividing the space into two intertwining and symmetrical volumes. By making one of these volumes solid, I left the other void. So, in this tutorial, I […]
In 1986, Craig Reynolds developed an algorithm aiming to model the flocking behavior of birds, which remains a cult method used in flock simulations today. In my initial study, the bird-oids (boids) have no rules or limitations, just chilling randomly on the screen. I call this initial version Wandering Simulator. There are several reasons why this fundamental simulation is difficult in Grasshopper and Python, our parametric design interface. In Grasshopper […]
This work emerged out of necessity. In the design and application process of wooden frame structures, where we put thousands of pieces together like a puzzle, the issue of preparing and updating quantity and measurement lists requires the most effort. Hours spent on this and the possibility of making mistakes are very high. However, with the Quantity Surveyor I developed in Grasshopper, you can generate measurement lists almost in real-time. […]
De Boor’s algorithm, a maestro of basis spline refinement, meticulously navigates through knots, unraveling the intricacies of B-splines with mathematical precision. Meanwhile, De Casteljau, the geometric orchestrator, takes center stage in the Bezier ballet, elegantly guiding control points through a recursive dance. Together, these algorithms fuse art and mathematics, seamlessly sculpting curves and splines with technical finesse, creating a harmonious symphony of numerical intricacies in computational geometry. ChatGPT is so […]
The Hilbert Curve, also referred to as the Hilbert space-filling curve, was initially introduced by the German mathematician David Hilbert in 1891. It is a continuous fractal curve, presenting a variation of the space-filling Peano curves uncovered by Giuseppe Peano in 1890. After a study on the mathematical background of this curve, I implemented a Python code into Grasshopper Python. However, I wanted to explore more variations by playing with […]
The dwg format maps in Turkey are often problematic. You need to clean these for architectural studios. Maps mostly contain height information of buildings. But the contours of the buildings are distorted and polylines are generally exploded. The map of the region where we worked in the studio I conducted in the Fall 2021 term was also problematic. I created a Map Cleaner Script in Rhino Python and converted the […]
The first trial of Discrete Fourier Transform in Grasshopper and Python. The technique is used to decompose a function into its frequency components. There are many uses for this technique in physics and engineering. However, the interesting and intuitive part of this mathematical technique is the way of its visualization and the potential mathematical “magic” it produces. I found several examples on the internet of this beautiful visualization such as […]
In this session, I will add two new methods to the Vector class. I think this will finish the basics for the vectors. In the future, we are going to need several new methods like adding multiple vectors and interpolation. But for now, I think this would be sufficient to further advance into parametric curves and surfaces. These new methods will be based on the dot product method we created […]
This is the continuation of the Vector class we started here, and further advanced here, here, and here. This new Rhino Python implementation is mostly educational and partially a hobby. Before this session, we have developed display, magnitude, add, multiply, reverse, and subtract methods. This time, I am adding the vector normalization and dot product methods and seeing the utilizations of the dot product. Line Explanation 1-26 Already explained in […]
This is the continuation of the previous post on parametric curve equations. In this new version, the script picks a NURBS curve from the user. Then, it analyses the curve’s degree and control points. Unfortunately, only the curves with degree+1 number of control points can be processed. In the future, I hope that I will be able to extend this script to include multi-span curves with more than degree +1 […]
Today, I am going to make only one addition to the Vector class we recently started in Rhino Python. The magnitude of a vector can be easily calculated by assuming that the axes (2 or 3 axes) of it are perpendicular to each other. This gives us an opportunity to assume a right triangle visually, and calculate the magnitude (length) of a vector by using the Pythagorean Theorem. In short, […]
The parametric curve equations are good examples to demonstrate the bridge between computer-aided design and mathematics. Although useless and pointless, it is a good exercise to extract the curve equations. In this Rhino Python code, I present a generalized equation extractor for Rhino. Rhino curves are good examples de Casteljau and Bézier curves. You can see the mathematical underpinnings of Rhino curves with this exercise: This code asks the user […]
This is the continuation of my new project of re-creating the parametric curve and surface methods of Rhino via Python scripting. If you remember, I started with the building block of vector operations, here and here. Then, I defined vector addition and multiplication, before going deeper into the geometric calculations. In fact, they are using the previously defined addition and multiplication methods. New Vector Operations: Subtraction and Reversing In the […]
Today, I am going to advance the Vector class a bit more. Firstly, I will improve the display method I introduced recently. Then, I will add two new methods which handle the fundamental vector arithmetics in Rhino Python. Improving the Display Method In the previous attempt, I displayed vectors on the origin of the Rhino viewport. The coordinates of the tail of a vector are not stored within the object […]
Let’s continue from the Vector class that started yesterday. Previously, I defined this class to store three numbers (coordinates), named as “components”. I defined a method named __init__ for this. Similarly, I am adding a display method to the Vector class today. Note that I am using Rhino 6 in this code, but it should also work in Rhino 5 or 7. The code Below is the line-by-line explanation of […]
In this new series, I will be using Rhino Python to create some of the fundamental mathematical objects in Rhino. We will learn how to code in Python, and also try to get deeper into the intuition behind some of the fundamental concepts we use every day in Rhino and Grasshopper. The Vector class in Rhino Python is the starting point of this journey. Just like vectors, most of the […]
This is a simple inverse kinematics solution developed by Andreas Aristidou and Joan Lasenby in 2011. They call it Forwards and Backwards Reaching Inverse Kinematics (FABRIK in short). It was quite interesting the learn this technique because it is a fast and accurate approximation of a kinematic chain. There are very interesting potentials of this technique in terms of architectural simulations. I tried to develop a Rhino Python script in […]