Experimenting with configurable lathe primitives. Hours of fun! :)

Star on Github

According to Wikipedia, a lathe "is a machine tool that rotates the workpiece on its axis to perform various operations such as cutting, sanding, knurling, drilling, or deformation, facing, turning, with tools that are applied to the workpiece to create an object with symmetry about an axis of rotation."

Phew. Around here, it's a new addition to FCShapes that lets you define a set of points, or a function that generates points in a range, and then rotates those points around the Y axis to make all kinds of nifty shapes. You could think of it as a carveable cylinder. 

I'll be adding some more UI to this to make it easy to play with, but in the meantime you can make your own like so:

  1. Imagine a shape you'd like to lathe up and how to represent that mathematically, either as a set of numbers or a function
  2. Open your developer console
  3. If you've got a series of numbers in mind, type in: S().addLatheWithPoints(H, [r1, r2, r3..]) - where H is the height of the object (in metres) and r1, r2... are the radiuses of your control points (also in metres). Enter as many as you like, they will be distributed evenly along the height of your object.
  4. If you want to use a function, do: S().addLatheWithFunction(H, fn) - where fn = function(I, N) with I being the index of the current point and N being the total number of points which will be queried. The function should return the radius you want at that control point. With the default settings, 120 control points will be queried in this way.

Check out the source code for examples, and if you come up with anything cool, let me know! @ajrowr on Twitter and alan at codex dot cx by email.

By the way, you can teleport around by pointing the green controller at a point on the ground and pressing the grip button. Enjoy!

Updates in September 2016:

Source Code
Website and content ©2016 Alan Rowarth except as explicitly stated. See code repositories for license grants.