Partial rotate_extrude (OpenSCAD) working with 0 radius

by florianlb, published

Partial rotate_extrude (OpenSCAD) working with 0 radius by florianlb Dec 13, 2012


While designing an object for my 3D printer, I used the partial_rotate_extrude provided by CarryTheWhat. However, I realized that his routine did not work with a zero radius. I slightly modified the script to account for a new parameter to permit a partial_rotate_extrude working with a translation radius of zero.

Recent Comments

view all
You're welcome. Happy it helps you! :)
hey awesome!! This is great, thanks for the fix :)

More from 3D Printing

view more

Liked By

view all


Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag. Print Thing Tag


Use (same as rotate_extrude):
partial_rotate_extrude(angle = 90, radius = 3, axial_range= 5, convex = 20) circle(5);

This will extrude the circle for `angle` degrees about the origin at a distance of `radius`. The 'axial_range' is the object's dimension perpendicular to the rotation axis. The convexity parameter is the same as in rotate_extrude, see en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion

More elaborate example, inspired from the 'extruding a polygon' manual section:
partial_rotate_extrude(angle = 255, radius = 0, axial_range = 5, convex = 10) polygon( points=[[0,0],[2,1],[1,2],[1,3],[3,4],[0,5]] );

Copy/Paste access:

module pie_slice(radius, angle, step) {
for(theta = [0:step:angle-step]) {
rotate([0,0,0]) linear_extrude(height = radius*2, center=true)
polygon( points = [[0,0],[radius * cos(theta+step) ,radius * sin(theta+step)],[radius*cos(theta),radius*sin(theta)]]);

module partial_rotate_extrude(angle, radius, axial_range, convex) {
intersection () {
rotate_extrude(convexity=convex) translate([radius,0,0]) child(0);
pie_slice(radius + axial_range, angle, angle/10);
hey awesome!! This is great, thanks for the fix :)
You're welcome. Happy it helps you! :)