5

When making a cylinder, sometimes I need to only take a pie slice. I'm currently using this neat trick to make pie slices for angles under 90 degrees. However, I have need of a few angles over 90 but under 180 degrees. Is there a way to generalize/extend this to work for these bigger angles?

```
module pie_slice(r=3.0,a=30) {
intersection() {
circle(r=r);
square(r);
rotate(a-90) square(r);
}
}
pie_slice(r=10,a=15);
```

I think the easiest would be to use

`difference`

. Circle minus two cubes with sides 2R. (Or one of size 2R and one of size R.) – Tomas By – 2019-07-20T22:19:45.440IIUC, this is similar to my current workaround (I've posted below for reference). I use

`union`

instead of`intersection`

. Unfortunately, you have to examine how many degrees the caller wants and use one or the other - I have yet to find a universal method – Hamy – 2019-07-20T22:33:44.647Think of it this way: you have two rectangles that cover each half of the circle. Then you open a gap between them of the angle. That should work for any angle between 0 and 180. – Tomas By – 2019-07-20T22:38:41.743

Oh snap, that sounds perfect. I'll give it a try, thanks – Hamy – 2019-07-20T22:46:07.570

Or use a module that can make pie slices, e.g. Chamfers-for-OpenSCAD.

– 0scar – 2019-07-21T06:58:41.580