spiral_extrude()

spiral_extrude()

thingiverse

This library function bridges the gap between linear_extrude() and rotate_extrude(). It takes a 2D object and spirals it outward, unlike linear_extrude, which has the 2D object perpendicular to the path of extrusion. If only OpenSCAD allowed access to the points that make up the 2D objects this function operates on, life would be much easier. Leave the example uncommented for Thingiverse to show a picture, but comment it out when using this library. I left it as is so you can see what's going on. Update: A bug was discovered where when the radius was less than 20, nothing got generated. The problem lay in the calculation inside the asin() function, which resulted in 1+1e-14, an invalid value for asin(). I limited the result to a range of -1 to 1 to fix the issue. Update 2: The size of the spiral segments was adjusted so they slightly overlap (removing gaps in the spiral). A render() function was added to each segment because OpenSCAD complained about too many objects, slowing it down. atan() was replaced with atan2() to avoid potential division by zero. I also included a version number for this file (it's 1.2). Update 3: The capability of doing flat spirals was added. I also fixed the Starts variable issue, which was not working as expected. This is now version 2.0. The tapered spirals aren't as smooth as I'd like them to be. I'm thinking of re-implementing this in a more general way. A screen capture video shows how I updated the file: watch it here If you import this library with "use", the test objects (image and STL) won't be included. Update 4: It seems I just can't leave this one alone. The spiral extrusion was re-implemented as extrude_spiral() and a wrapper function called spiral_extrude() was created, which calls extrude_spiral() for backwards compatibility reasons. This is because the previous design didn't handle the equivalent of rotate_extrude(), which uses the Angle parameter instead of the existing function that only does complete circles. I also fixed a bug where the spiral always ended up taller than requested. Update 5: The library was updated to version 3.1. A bug was discovered and fixed where the extruded object would extrude one more step than requested. From now on, extrude_spiral() is the preferred format, while spiral_extrude() remains as a wrapper of extrude_spiral for backwards compatibility. I hope this will soon become obsolete when the next version of OpenSCAD is finally released.

Download Model from thingiverse

With this file you will be able to print spiral_extrude() with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on spiral_extrude().