OpenSCAD Question on bezel

I created a 2d surface that I can perform a linear extrusion on, however the result it obviously a hard edge on the extrusion. I would love to be able to add a bezel - either rounded or at 45 degrees. Is there an easy way?

10 points · 5 comments · view on lemmy.world

5 Comments

azdle@news.idlestate.org · 4 pts · 2y (2 replies)

There's lots of ways to round things or chamfer things. Coming from an extruded shape, a basic chamfer is pretty easy, you can do two different extrusions, one a bit shorter than your final piece and one full height, but offset inward a bit, and then hull them together:

module shape() {
    square(10, center = true);
}


hull() {
    linear_extrude(8)
    shape();

    linear_extrude(10)
    offset(delta = -2)
    shape();
}

Though, because of the hull, this will only really work with fully convex shapes. Doing this for shapes with concave features is harder.

azdle@news.idlestate.org · 4 pts · 2y

For rounding, you can do the extrusion, but with it a bit smaller in every dimension, then minkowski with a sphere (or a different shape if you don't want all the edges rounded), but it's tricky to get right:

module shape() {
    square(80, center = true);
}


minkowski() {
    linear_extrude(80)
    shape();

    sphere(r = 20);
}

nydas@lemmy.world · 1 pts · 2y

Thank you. Yeah, the shape is a mix of convex and concave. I might need to just make do for this prototype.

wolfwood@lemmy.world · 2 pts · 2y

you can also tip over a cube() by 45° and difference it from your object to take off an edge.

pca006132@lemmy.world · 2 pts · 2y

There were efforts trying to do make this simpler, but it was abandoned. See https://github.com/openscad/openscad/issues/4743 and related PR.