C - U-V PolyGen

NOTE: U-V PolyGen is a standalone Ruby plugin for SketchUp. uv_polygen.rb can be found at https://sites.google.com/site/spirixcode/code

U-V PolyGen allows the user to create parametric surfaces where {x,y,z} = f(u,v). The u and v ranges are specified along with the x, y, and z transformation equations expressed in Ruby math syntax. It can also be used to generate curves as a function of a single variable.

A simple example uses u-v values of -pi/2 <= u <= pi/2, -pi/2 <= v <= pi/2 and x, y, and z values computed by x = u, y = v, and z = Math.sin(u) + Math.cos(v):

This results in the following surface being created:

An offset surface can be created by specifying the distance and the type of surface desired:

This creates a separate surface that is 0.25 units away from the first surface. A negative offset will create the new surface on the opposite side of the primary surface. Using too large of an offset inside a smaller radius will create predictable, but invalid surface geometry (i.e., it will fold or cross back on itself). If an edge degenerates to a single point, then the offset surface creation will fail silently.

In addition to the the offset surface, the four side "skirts" can also be created that "stitch" the two surfaces together. This effectively creates a fully enclosed manifold volume defined by the original surface definition plus an arbitrary thickness:

By short-circuiting one of the variables, you can produce a 2D curve. For example, to plot y = (u3 - 2u2 + 3u - 1) / 20 with -5 <= u <= 5:

Note the use of V Start = 0, V End = 0, and V Steps = 1; this collapses the 3D surface into a 2D curve. The value provided for z will determine the height of the plot. The result is a contiguously ordered chain of edges grouped together with the optional name (if given):

You can use the curve as a path for the Follow Me tool:

You can also use the curve as an input group to the Spirix module: