Spline Cam
Spline Cam
The Spline and Cam Tutorial on YouTube

The spline and cam features are working in the Linkage software. Above is a video with my first attempt at a tutorial. Since I haven’t used the software to create splines and cams much, I stutter and pause a bit while thinking about what to do next. It’s interesting how much easier it is to create a tutorial video for features that I’ve used dozens or hundreds of times versus features I’ve only been using during debugging for the last two or three days.

I had some choices to make when adding this feature and I even wrote and threw away some code while making what I realized later were not the best way to do things. I don’t know if I ever found the absolute best way to make the splines work as cams but at least they are usable. The problem was that I wanted to have splines be usable as link shapes for decoration and as cams. I also needed to allow for multiple cams on a single rotating input. The first thought I had a long time ago was to simply let the user check a box for “use a spline as the link shape” and then they could use that as the decorative shape and/or as a cam. That would have worked and I could have had multiple of these links all share an input connector. Dang, maybe I should have picked that solution. In that case, all splines would show up with a single connector. This is how gears work and it seems to work well. But the splines-as-drawing-elements way of doing this also seems to work ok and when a spline is just decorative and a drawing element, it makes a lot of sense. You can see why it’s still a dilemma in my mind.

The splines are themselves interesting but straightforward. A spline is a set of segments all chained together with each segment being either a Bezier curve or a straight line. The points of connection can have properties that affect the shape at that point as well as the way the shapes on either side of the point are edited and rendered. The editor is mostly working with a few small pieces missing. Snapping, for instance, doesn’t take into account the nodes between the segments as it should.

Take a look at the video and keep in mind that this could all change if I decide that the splines should just be links that have a single connector or if maybe I should make them work both ways with there being splines as drawing elements and also splines as links.