discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

rounding all edges of a box?

K
Ken
Tue, Dec 27, 2022 9:43 AM

The recent discussion of minkowski prompted me to have a go at rounding
all the edges of some boxes I make for putting my (thread-cutting) taps in.

I managed to round the outer edges of the box, but after repeated
attempts have failed miserably with rounding the edges of the cutouts.

Is it even possible to round the internal corners using minkowski?

This is the code so far-


$fn = 128;
//X axis
Length  =   110;//[5:1:200]
//Y
Width   =   50;//[10:1:100]
//Z
Height  =   10;//[10:1:100]
//Wall thickness
Wall    =   3;//[1:0.5:10]
//Width for label text
Label = 10;//[5:1:15]

text=" 5mm x 0.8";
text_font="Fontdiner Swanky";
text_z_height=0.35;//[1:0.1:5]
text_size=5;//[2:1:20]

module rounded(){
   $fn=128;
     minkowski(){
        box();
        sphere(r=Wall/3);
    }
}

module box()
{
cube([Length,Width+Label,Height]);
}

// Divider 1
module Divider_1()
{
rotate ([0,90,0])
    translate([-Height,Height2+Wall2,Wall])
    cylinder(Length-(2*Wall),(Height/2)+1,Height/2);
}

module Divider_2()
{
rotate ([0,90,0])
    translate([-Height,Height2+Wall8,Wall])
    cylinder(Length-(2*Wall),(Height/2)+1,Height/2);
}

module Divider_3()
{
rotate ([0,90,0])
    translate([-Height,Height,Wall])
    cylinder(Length-(2*Wall),(Height/2)+1,Height/2);
}

module Finger_cutout()
{
   translate([Length0.3,Width0.06,Wall/2])
   cube([20,Width-((Label-(Wall*3.3))),Height]);
}

module Text()
{
  translate([Wall-1, Width+3.5, Height+0.65]){
  linear_extrude(text_z_height){
  text(text,halign = "left", font=  text_font, size=text_size,
direction="ltr");
}
}
}

difference()
{
rounded()
 box();
 Divider_1();
 Divider_2();
 Divider_3();
 Finger_cutout();
 Text();
}

--
Cheers, Ken
bats059@gmail.com
https://vk7krj.com/running.html
https://sstv.vk7krj.com/all_bands.html

A baby can be defined as an ego with a noise at one end and a smell at the other.
Our job as parents is to teach them to control all three.

The recent discussion of minkowski prompted me to have a go at rounding all the edges of some boxes I make for putting my (thread-cutting) taps in. I managed to round the outer edges of the box, but after repeated attempts have failed miserably with rounding the edges of the cutouts. Is it even possible to round the internal corners using minkowski? This is the code so far- ****************************************** $fn = 128; //X axis Length  =   110;//[5:1:200] //Y Width   =   50;//[10:1:100] //Z Height  =   10;//[10:1:100] //Wall thickness Wall    =   3;//[1:0.5:10] //Width for label text Label = 10;//[5:1:15] text=" 5mm x 0.8"; text_font="Fontdiner Swanky"; text_z_height=0.35;//[1:0.1:5] text_size=5;//[2:1:20] module rounded(){    $fn=128;      minkowski(){         box();         sphere(r=Wall/3);     } } module box() { cube([Length,Width+Label,Height]); } // Divider 1 module Divider_1() { rotate ([0,90,0])     translate([-Height,Height*2+Wall*2,Wall])     cylinder(Length-(2*Wall),(Height/2)+1,Height/2); } module Divider_2() { rotate ([0,90,0])     translate([-Height,Height*2+Wall*8,Wall])     cylinder(Length-(2*Wall),(Height/2)+1,Height/2); } module Divider_3() { rotate ([0,90,0])     translate([-Height,Height,Wall])     cylinder(Length-(2*Wall),(Height/2)+1,Height/2); } module Finger_cutout() {    translate([Length*0.3,Width*0.06,Wall/2])    cube([20,Width-((Label-(Wall*3.3))),Height]); } module Text() {   translate([Wall-1, Width+3.5, Height+0.65]){   linear_extrude(text_z_height){   text(text,halign = "left", font=  text_font, size=text_size, direction="ltr"); } } } difference() { rounded()  box();  Divider_1();  Divider_2();  Divider_3();  Finger_cutout();  Text(); } -- Cheers, Ken bats059@gmail.com https://vk7krj.com/running.html https://sstv.vk7krj.com/all_bands.html ---------------------------------------- A baby can be defined as an ego with a noise at one end and a smell at the other. Our job as parents is to teach them to control all three.
CA
Carsten Arnholm
Tue, Dec 27, 2022 12:41 PM

On 27.12.2022 10:43, Ken wrote:

Is it even possible to round the internal corners using minkowski?

Minkowski operates on a convex object. If you mean filetting concave
edges, the answer is no, but you can do it in a round-about way

  1. create a cube enclosing the object completely

  2. Subtract your model from the cube, creating an internal void where
    the original model concave edges becoming convex.

  3. Run Minkowski with a sphere on the difference

  4. Subtract the result of Minkowski from the original object.

The result is rounded concave (internal)  edges

Carsten Arnholm

On 27.12.2022 10:43, Ken wrote: > Is it even possible to round the internal corners using minkowski? Minkowski operates on a convex object. If you mean filetting concave edges, the answer is no, but you can do it in a round-about way 1. create a cube enclosing the object completely 2. Subtract your model from the cube, creating an internal void where the original model concave edges becoming convex. 3. Run Minkowski with a sphere on the difference 4. Subtract the result of Minkowski from the original object. The result is rounded concave (internal)  edges Carsten Arnholm
GH
gene heskett
Tue, Dec 27, 2022 5:52 PM

On 12/27/22 07:42, Carsten Arnholm wrote:

On 27.12.2022 10:43, Ken wrote:

Is it even possible to round the internal corners using minkowski?

Minkowski operates on a convex object. If you mean filetting concave
edges, the answer is no, but you can do it in a round-about way

  1. create a cube enclosing the object completely

  2. Subtract your model from the cube, creating an internal void where
    the original model concave edges becoming convex.

  3. Run Minkowski with a sphere on the difference

  4. Subtract the result of Minkowski from the original object.

The result is rounded concave (internal)  edges

Carsten Arnholm

Most ingenious. Thank you for posting the recipe, Carsten Arnholm.

Cheers, Gene Heskett.

"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.

On 12/27/22 07:42, Carsten Arnholm wrote: > On 27.12.2022 10:43, Ken wrote: >> Is it even possible to round the internal corners using minkowski? > > Minkowski operates on a convex object. If you mean filetting concave > edges, the answer is no, but you can do it in a round-about way > > 1. create a cube enclosing the object completely > > 2. Subtract your model from the cube, creating an internal void where > the original model concave edges becoming convex. > > 3. Run Minkowski with a sphere on the difference > > 4. Subtract the result of Minkowski from the original object. > > The result is rounded concave (internal)  edges > > Carsten Arnholm > Most ingenious. Thank you for posting the recipe, Carsten Arnholm. Cheers, Gene Heskett. -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author, 1940) If we desire respect for the law, we must first make the law respectable. - Louis D. Brandeis Genes Web page <http://geneslinuxbox.net:6309/>