Introduction: Loft in OpenSCAD

You probably want to watch the video first.

Step 1: What Is 'loft'?

In many CAD programs, a loft is a 3d object that is stretched out between two (or more) 2d-objects (sketches), that are located in 3d space. In the pictures you see a loft between a star and a triangle in FreeCAD, and in green circles the two sketches and the loft tool.

But there are no sketches in OpenSCAD, so what to do now?

Step 2: Hull in OpenSCAD

If both of your shapes are entirely convex, you can make a hull. I've included an example, the documentation is there: https://en.wikibooks.org/wiki/OpenSCAD_User_Manua...

Note though that both of your shapes are three dimensional (but only 0.1 mm thick).

Step 3: The Loft Module

The problem with the hull method though is that is it limited to convex shapes, the star and triangle model from FreeCAD is not going to work here. And that is why I made a loft module. Technically it is a polyhedron that is defined by code and you 'only' need to express your two shapes in points. The number of the points of the upper and lower shapes have to be identical. It works defining your points by code, for instance if you want a circle use sin and cos.

The last number in the loft module is the number of layers, adjust it to your liking (natural number).

Step 4: Troubleshooting

That's it. But for the case that something doesn't work, I added this 'debugging' file. If something is funny with your loft, add your points here and look at the colorful dots and the error messages.

If you have ideas how to make even better lofts in OpenSCAD, I'd be happy to hear from you.