# Is there an easy way to add rounded edges to semicircle in OpenSCAD?

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 and this is what it looks like:

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 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:

If you're modeling as a 2D object and extruding with linear_extrude, you can use the offset tranformation with positive r on the (initially undersized) 2D object to smooth corners.

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)


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]) {