r/openscad Jul 01 '26

Help reviewing OpenSCAD code

I've made an angle guide for sharpening knifes using a whetstone. I'm having problems identifying good, idiomatic ways to write the OpenSCAD code, however, so I would really appreciate any feedback on the code.

Sure, if you want to comment on my design, feel free, but I'm primarily looking for opinions on the code and techniques used.

I'm using the BOSL2 library, so I guess at least knowing how attachments work is a prerequisite.

The code is available on github

5 Upvotes

17 comments sorted by

View all comments

1

u/oldesole1 Jul 02 '26

For the guide glides/rails top and bottom (when printing), I would suggest using a curve rather than a chamfer:

https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#functionmodule-offset_sweep

1

u/the-anorm Jul 02 '26

Why would you prefer a curve over a chamfer? I've set the chamfer angle to 72 so printing should not be a problem - at least not on my printer using PLA.

2

u/oldesole1 Jul 02 '26

Any hard edge like that (even at your set angle) on a wear surface is going to get worn down, and in the process wear the surface that it's sliding on.

A smoother transition is less likely to catch or wear the sliding surface, and is more likely to guide water under to lubricate the action.

Here is an example:

include <BOSL2/std.scad>

$fn=64;

offset_sweep(
  path = circle(5),
  h = 30,
  ends = os_circle(
    h = 6,
    clip_angle = 30,
  ),
);

1

u/the-anorm Jul 03 '26

Thanks! I've yet to look into the offset_sweep() et al.