I was sitting around the kitchen table wondering how I could model a playground slide, or those water slide tubes.
This thing adds hermite curve/surface support to the OpenScad Surface Solids library.
The basic Hermite interpolation calculation has actually been lurking for a while, but now it's put to good usage. With this, there is now a lerp (linear interpolation), berp (bezier interpolation), and herp (hermite interpolation) in the library.
A Hermite curve is defined by two endpoints, and the tangent vectors to those points. It is somewhat related to a Bezier curve. In fact, I use the same Bernstein basis functions to express it. Some people may find it easier to deal with, some harder, but it's just another tool in the box to help you create surfaces.
In this particular case, I've added a 'sweep_hermite()' module to the renderer. This is really easy to work with. You define one curve to be your 'profile', and you define another curve to be the path along which you'll sweep that profile. The module will take care of creating the appropriate polyhedra to fill in the solid. You can give a thickness, and it will extrude in that direction. This is similar to the linear_extrude.
This also shows a general mechanism for doing sweeps with curves. To make it fully generalized, and to reduce the amount of code needed to support different curves, I'll be further developing the matrix representation of curves. That will essentially be the same as having function pointers for surface creation, if you catch my drift.
I've added some visual debugging support. If you decide to show the control frame, you'll get a nice rendering of the profile and sweeep curves, complete with their tangent vectors.
Using tangent vectors is interesting. You need to be mindful that a vector has a length and direction. The length influences the strength of pull in the particular direction. It's best if you think of them centered at [0,0,0] and point them in the direction you want them to go. You'll have to play around with setting them to get the gist of it.
It occurs to me that this might be a good tool to use while learning about different types of curves and surfaces. Particularly with the visual debugging, and the added bonus that you get to print out a physical thing after you've done all your hard playing around.
I made the license public domain, as this is well trod ground.
Are Splines in the offing?
At any rate...