<p>I'm far from a wizard with OpenSCAD, but enjoy using the program, learning something new every time. In your case, it's likely that you can use the <a href="https://github.com/Irev-Dev/Round-Anything" rel="nofollow noreferrer">roundanything library</a> to accomplish your objective.</p>
<p>The library will present various implementations in the samples, making it an exercise for the reader to determine which module calls will present the solution.</p>
<p>The image below shows a part which has had the radii applied in a manner similar to your image:</p>
<p><a href="https://i.sstatic.net/DWbgd.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/DWbgd.png" alt="round anything implementation" /></a></p>

CC BY-SA 4.0
2021-02-13T16:39:53.277Z
2021-02-13T16:39:53.277Z
fred_dot_u
<p>If you're modeling as a 2D object and extruding with <code>linear_extrude</code>, you can use the <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset" rel="nofollow noreferrer"><code>offset</code> tranformation</a> with positive <code>r</code> on the (initially undersized) 2D object to smooth corners.</p>

CC BY-SA 4.0
2021-02-13T17:04:13.830Z
2021-02-13T17:04:13.830Z
R.. GitHub STOP HELPING ICE
<p>I ended up taking a third option I suppose.  I decided I was cutting the gap wrong.  I was using <code>difference</code> to take a rectangle out of the ring.</p>
<p>I decided I'd simplify that and take out an extruded triangle.</p>
<pre><code>ringRadius = radius + thickness;
verticalOffset = tan(gapAngle / 2) * ringRadius;

linear_extrude(height = height)
    polygon(points = [[0, 0], [ringRadius, verticalOffset], [ringRadius, -verticalOffset]]);
</code></pre>
<p>That way, the thickness of the plane that needed rounding is uniformely the thickness of the ring.  Then, it was just a matter of adding cylinders, centering them in the ring, and rotating them into position.</p>
<pre><code>for(side = [-1, 1]) {
    cornerRadius = radius + thickness / 2;
      
    rotate([0, 0, gapAngle / 2 * side])
        translate([cornerRadius, 0, 0])
            color(&quot;blue&quot;) cylinder(r = thickness / 2, h = height);
}
</code></pre>
<p>Eventually I'd like to make it a little more complex and help accommodate a light better, but for now it gets me the rounded ends I was looking for.</p>
<p><a href="https://i.sstatic.net/NQll4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/NQll4.png" alt="Rounded ends of ring" /></a></p>
<p>I'm still going to accept the round everything answer because, though I decided it was more complexity than it was worth on this model, it looks like it would solve other rounding issues too.</p>

CC BY-SA 4.0
2021-02-19T19:03:34.477Z
2021-02-19T19:03:34.477Z
D. Patrick
<p>I've put together a flashlight mount for a camera coldshoe in OpenSCAD.  I originally modeled it in FreeCAD and it was easy to round the edges of the clamp with a fillet and that makes it a little easier to get the light in and out of the mount.</p>
<p>I'm not sure how to do it in OpenSCAD.  Naively, I'm sure I could calculate where on my semicircle I would need to add some cylinders in order to round the sharp corners, but it seems like there'd be something a little easier than that.</p>
<p>Am I missing something?</p>
<p>Here's the <a href="https://github.com/tncbbthositg/cold_shoe_light_mount/blob/795489c90f412502a2545536e906ad8971cfd691/cold_shoe_light_mount.scad" rel="nofollow noreferrer">coldshoe light mount SCAD file</a> and this is what it looks like:
<a href="https://i.sstatic.net/StF93.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/StF93.png" alt="coldshoe light mount" /></a></p>

<openscad>
Is there an easy way to add rounded edges to semicircle in OpenSCAD?
D. Patrick
# Is there an easy way to add rounded edges to semicircle in OpenSCAD?

(Asked by: username_0 on 2021-02-13)

I've put together a flashlight mount for a camera coldshoe in OpenSCAD. I originally modeled it in FreeCAD and it was easy to round the edges of the clamp with a fillet and that makes it a little easier to get the light in and out of the mount.

I'm not sure how to do it in OpenSCAD. Naively, I'm sure I could calculate where on my semicircle I would need to add some cylinders in order to round the sharp corners, but it seems like there'd be something a little easier than that.

Am I missing something?

Here's the [coldshoe light mount SCAD file](https://github.com/tncbbthositg/cold_shoe_light_mount/blob/795489c90f412502a2545536e906ad8971cfd691/cold_shoe_light_mount.scad) and this is what it looks like:
[![coldshoe light mount](https://i.sstatic.net/StF93.png)](https://i.sstatic.net/StF93.png)

**Tags:** openscad

---

## 3 answers

### Answer by username_1 on 2021-02-13. Score: 1 | Accepted answer

I'm far from a wizard with OpenSCAD, but enjoy using the program, learning something new every time. In your case, it's likely that you can use the [roundanything library](https://github.com/Irev-Dev/Round-Anything) to accomplish your objective.

The library will present various implementations in the samples, making it an exercise for the reader to determine which module calls will present the solution.

The image below shows a part which has had the radii applied in a manner similar to your image:

[![round anything implementation](https://i.sstatic.net/DWbgd.png)](https://i.sstatic.net/DWbgd.png)


---

### Answer by username_2 on 2021-02-13. Score: 1

If you're modeling as a 2D object and extruding with `linear_extrude`, you can use the [`offset` tranformation](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset) with positive `r` on the (initially undersized) 2D object to smooth corners.


---

### Answer by username_0 on 2021-02-19. Score: 0

I ended up taking a third option I suppose.  I decided I was cutting the gap wrong.  I was using difference to take a rectangle out of the ring.
I decided I'd simplify that and take out an extruded triangle.
ringRadius = radius + thickness;
verticalOffset = tan(gapAngle / 2) * ringRadius;

linear_extrude(height = height)
    polygon(points = [[0, 0], [ringRadius, verticalOffset], [ringRadius, -verticalOffset]]);

That way, the thickness of the plane that needed rounding is uniformely the thickness of the ring.  Then, it was just a matter of adding cylinders, centering them in the ring, and rotating them into position.
for(side = [-1, 1]) {
    cornerRadius = radius + thickness / 2;
      
    rotate([0, 0, gapAngle / 2 * side])
        translate([cornerRadius, 0, 0])
            color("blue") cylinder(r = thickness / 2, h = height);
}

Eventually I'd like to make it a little more complex and help accommodate a light better, but for now it gets me the rounded ends I was looking for.

I'm still going to accept the round everything answer because, though I decided it was more complexity than it was worth on this model, it looks like it would solve other rounding issues too.


---

