1140
612
Views
Published on June 17, 2011

#### Description

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...

#### Instructions

2) Play around with the test_hermite.scad to make pretty pictures
3) Compile and export to .stl
4) Rejoice!

In most cases, it will generate a solid surface which can be turned into a .stl file. The most likely usage here is to generate singular pieces that are stuck together with other pieces. Like my water slide shutes.
##### Tags
This Thing has no tags.
Report as inappropriate

What do you do for a living? Cause you are really good at this...

I dabble in software for a large company in the pacific northwest. I don't actually do graphics for the company though. Furthest thing from it.

Soon enough I expect someone to make a commercial for OpenScad like those "I can't believe it's butter" ones from way back.

I put up a more proper looking playground slide.

I beleive the Derp expression origionated with the swedish chef on the muppet show, though Im not absolutly certain of it.

Before reading the rest of this comment, please understand I hold both you and your work in the highest regard. This is excellent work.

In colloquial north american english there is an expression: "Herp Derp!" often abbreviated to "Derp!" which is often used to mock dialog deemed so stupid as to be nonsensical. Finding a function at this level with that name has inspired enough laughter to improve my day as much as this code is l
ikely to improve my work. Thank you. :-D

Hah! Herp Derp... Sounds kind of like "Ropa Dope". I'll have to find a curve that begins with 'D' so I can create a 'derp' module!