openscad/openscad — pull request #918 by OskarLinde (2014-08-23 13:56:09+00:00)
Title: WIP: sweep()

This pull request serves to document the work in progress on sweep(). The current status is a 2d->2d sweep that seems to work well. 2d->3d sweeping that handles self-intersecting sweep volumes turned out to be a bit tricky so is still being worked on.

The 2d->2d sweep is quite useful by itself. Here is a few examples:

A properly undercut involute pion gear constructed by sweeping a rack profile:

![rack_gear](https://cloud.githubusercontent.com/assets/3725313/4020621/4d86c34e-2ac3-11e4-8ed1-b017943ea801.gif)

Here's what the scad code for the sweep operation looks like:

````
path = [
for (t = [0:0.01:1.01])
rotation(-t*360) * translation([-m*gear_teeth/2,0,0]) * translation([0,-t*m*PI*gear_teeth,0])
];

sweep(path) rack(number_of_teeth = gear_teeth+1, addendum_coefficient=1.25, dedendum_coefficient=1.0);
````

And the sweep operation isolated:

![sweep_gear](https://cloud.githubusercontent.com/assets/3725313/4020624/8d55c042-2ac3-11e4-82d6-48f3c5a8b15b.gif)