Associative modelling 3
Symbolic expressions to epicycles
Last updated
Symbolic expressions to epicycles
Last updated
With the basic visual programming mechanics out of the way, let’s experiment with generating geometry via composite expressions. We will develop a family of curves by composing cyclic motions; often known as epicycles []. The aim this section is to create functionality beyond what is offered by standard CAD drawing commands; to explore concepts pertaining ranges and expressions visualized as point sequences; and to practice on both computing as well as geometry.
The equation [ x, y ] = r * [ cos( 2π * c * t + p ), sin( 2π * c * t + p ) ]
represents the generalized form of a circle, where “r” is the radius, “c” is the angle spanned, and “p” is the start angle. This form is also used for expressing sinusoidal waveforms []; so it may be familiar from physics, but using the names “amplitude”, “period” and “phase”. Geometrically, this allows us to control the circle’s size as well as generating circular arcs instead of complete circles.
We may consider also using the “z” coordinate of the points to create beautiful three dimensional curves. At this point we no longer follow a known formula of a classic mathematical curve but begin to discover or invent our own. By just multiplying the coordinates of two different cycles we can produce enormously complex but always consistent and smooth curves. Of course we may apply any other expression for the “z” coordinate independent of the already computer values.
We may also use the sequence of generated points to replicate, in the sense of copy and paste, geometries that require a centre or pivot point. In the figure below we use a sphere centred about each point and create a “thickened” version of the curve.
An alternative strategy is to produce pairs of points such that we can connect them across using lines, or any geometry that requires two points as inputs. This produces a twisting surface-like geometry instead of single smooth curve. In the demo below we create a second point and use addition to produce a similar sequence of points such that the end results is somewhat regular.
The “custom display” component allow us to override the default red colour used for automatically displaying geometric components’ output parameters. We can supply any geometry as well as a colour for each, to produce a customized colour visualization in the viewport.
In the example below we replicate a hexagonal shape per point generated and link its radius to the normalized range. This causes the polygon’s radius increase along the curve progression. The reason the component is orange is because the first value of the normalized range is zero, which is an invalid radius value.
In this session we practiced with generating and transforming ranges using visual programming expressions. The objective was to build some familiarity with the way component and wire graphs work. We skipped several fine details about how certain operations are performed. Those will be constructively developed over the next few weeks. The import point is to experience hands-on first some of the interesting facets of design computation.
What is to appreciate about this mode of work is the ability to expand computation to potentially incredibly large number of iterations transparently and with ease. There is nothing preventing us from expanding a series to millions of operations by just increasing a “count” parameter. The computer may just slow down a bit as it runs out of resources. The point is that we don’t need to care about “how many” any longer. We are free from the burden of manual calculation.
While the geometric modelling experiments begun with conventional well-known shapes, namely trigonometric functions expressing themselves as regular polygons and circles, we begun departing towards more interesting and unforeseen results by just experimenting with linking parameters; perhaps they were not meant to be linked. The point here is unique outcomes, as opposed to generic or undifferentiated ones, often come through curiosity and experimentation.
Students interested in further exploring a family of curves—roulettes—that are related to epicycles may try out the following optional Spirograph exercise [>]
Replicating the equations once more and adding the output “x” and “y” coordinates produces an amazing variety of epicyclic shapes resembling planetary motion or the familiar spirograph curves []. You can consider this result as progressively rotating about two different size circles simultaneously. It is also possible replicate the same strategy more than two times. Notice how quickly we run out of resolution requiring additional points for the curve to keep being smooth as we increase the number of turns around the secondary cycle.
The final example demonstrates how to apply visual attributes using the “HSL” colour and “custom display” components. Hue, saturation and lightness [] is a useful colour representations. It is similar to “RGB” but rather more intuitive because a colour’s tint is controlled by one parameter instead of three. All “h”, “s” and “l” colour components take values in the “[0, 1]” range. Therefore to span the entire range of all colour tints, we can just use the normalized range.