Oloid strip

example
oloid%20diagram

Hi i am trying to create an Oloid via grasshopper. I found theses functions but do not fully understand them or know how to convert into grasshopper. .

The functions are:
function f(x) = [Radius * cos(x360),
Radius * sin(x
360 ) ,
0];

function g(x) = [Radius * cos(x360),
0,
Radius * sin(x
360 )
]
+[Radius,0,0];

thanks for any help or consideration.

I’m assuming your functions are supposed to look like this:

f(x) = \left[ Radius \cdot cos(x \cdot 360), Radius \cdot sin(x \cdot 360), 0 \right];
g(x) = \left[ Radius \cdot cos(x \cdot 360), 0, Radius \cdot sin(x \cdot 360) \right] + \left[ Radius, 0, 0 \right];

The square brackets probably indicate coordinates, which tend to be written using parenthesis in Rhino and Grasshopper. Also the 360 implies this is done in degrees, which will not work in GH. The trigonometric functions all use radians, so 360 becomes 2\pi.

The g function has a vector addition, which seems simple enough to combine into a single statement. Let’s also rename Radius to just r to clean things up. This leaves us with:

f(x) = \left( \hspace{7.5mm} r \cdot cos(2\pi \cdot x), r \cdot sin(2\pi \cdot x), 0 \right)
g(x) = \left( r + r \cdot cos(2\pi \cdot x), 0, r \cdot sin(2\pi \cdot x) \right)

These are just two circle functions. The f function yields in a horizontal circle centred on (0,0,0) with radius r, while the g function yields a vertical circle centred on (r,0,0). Basically, they are just the boundary edges of your shape. You don’t need equations for this, it’s much simpler just generating these circles using circle components.

Oloid.gh (6.9 KB)

Incidentally you can convert those two circle equations to a single surface equations pretty easily since the interpolation between the boundary circles is just linear: Oloid uv.gh (16.3 KB)

So if you treat your x parameter as the surface u direction you’ll need to add a v parameter (from zero to one as well) which interpolates between these two. Linear interpolation between two values looks like:

i(u) = f(u) + v \cdot (g(u) - f(u))

To avoid having to evaluate f twice and also to get slightly better accuracy you can rewrite that as:

i(u) = (1-v) \cdot f(u) + v \cdot g(u)

Since the y and z coordinates of your g and f functions respectively are always zero, you can throw out half of that interpolation equation, simplifying it even further.