rotate_extrude through angle September 24, 2014 10:32AM Registered: 10 years ago Posts: 376
What I want is the same result as this, but without all the clutter. It seems sensible to me that I would be able to pass an angle through which to extrude in, but there's nothing in the manual. Any ideas?

```difference()
{
rotate_extrude(convexity = 10, \$fn = 100)
translate([5, 0, 0])
circle(r = 2, \$fn = 10);
difference()
{
translate([-10,-10,-4])cube([25,25,8]);
translate([0, 0,-4])cube([10,10,10]);
}
}
```
 Re: rotate_extrude through angle September 24, 2014 10:46AM Registered: 10 years ago Posts: 2,472
The manual (http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion) shows that there is a "twist" variable that governs the amount of rotation.

e.g. linear_extrude(height = fanwidth, center = true, convexity = 10, twist = -fanrot, slices = 20, scale = 1.0) {...}

Dave
 Re: rotate_extrude through angle September 24, 2014 11:26AM Registered: 10 years ago Posts: 376
Ah, no, that uses linear_extrude and the twist isn't what I'm after. With linear_extrude and twist you are extruding in a straight line but twisting it like a drill bit. I really didn't make that any clearer did I

rotate_extrude extrudes along a circular path, so if you have a square and rotate_extrude it, you end up with a ring that has the square as its cross section.
 Re: rotate_extrude through angle September 24, 2014 12:39PM Registered: 10 years ago Posts: 2,472
Sorry, my mistake. No, it seems that rotate_extrude always operates through 360 degrees, though it is a simple matter to cut out the angular section you don't want with one or two cubes as in your example. If you need to do it often in a design you could trivially make a module that takes an angle as one of its arguments to do the cutting (or the entire partial extrude). That's what's great about OpenScad - if it doesn't have a command that does what you need, you effectively create the command you want via a module.

Dave
 Re: rotate_extrude through angle September 24, 2014 04:09PM Registered: 10 years ago Posts: 376
Quote
dmould
Sorry, my mistake. No, it seems that rotate_extrude always operates through 360 degrees, though it is a simple matter to cut out the angular section you don't want with one or two cubes as in your example. If you need to do it often in a design you could trivially make a module that takes an angle as one of its arguments to do the cutting (or the entire partial extrude). That's what's great about OpenScad - if it doesn't have a command that does what you need, you effectively create the command you want via a module.

Dave

That's ok, easy thing to miss I looked around the web and it seems "they" have it on the todo list, but it's not entirely trivial. I'll tweak up mine and parameterise it, although I think it's slightly less easy than it looks because of the way rotate_extrude decides what 0 is. I got that from reading a comment thread, so no idea until I actually try.
Sorry, only registered users may post in this forum.