pca006132,

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

wolfwood,

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

azdle,
@azdle@news.idlestate.org avatar

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:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">module shape() {
</span><span style="color:#323232;">    square(10, center = true);
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;">hull() {
</span><span style="color:#323232;">    linear_extrude(8)
</span><span style="color:#323232;">    shape();
</span><span style="color:#323232;">
</span><span style="color:#323232;">    linear_extrude(10)
</span><span style="color:#323232;">    offset(delta = -2)
</span><span style="color:#323232;">    shape();
</span><span style="color:#323232;">}
</span>

https://news.idlestate.org/pictrs/image/2aff4c36-1cf6-4b9e-a5ab-3b78a12a1cd5.png

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

azdle,
@azdle@news.idlestate.org avatar

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:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">module shape() {
</span><span style="color:#323232;">    square(80, center = true);
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;">minkowski() {
</span><span style="color:#323232;">    linear_extrude(80)
</span><span style="color:#323232;">    shape();
</span><span style="color:#323232;">
</span><span style="color:#323232;">    sphere(r = 20);
</span><span style="color:#323232;">}
</span>

https://news.idlestate.org/pictrs/image/633e624a-0353-4bae-8aae-62a6a8ef2dee.png

nydas,
@nydas@lemmy.world avatar

Thank you. Yeah, the shape is a mix of convex and concave. I might need to just make do for this prototype. https://i.imgur.com/gtJurrp.png

  • All
  • Subscribed
  • Moderated
  • Favorites
  • ergomechkeyboards@lemmy.world
  • fightinggames
  • All magazines