Rounding a sharp corner?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Rounding a sharp corner?

marhar
Here's an X shape formed by cutting some ellipses out of a cube.
I would like to smooth the sharp corners on the sides by subtracting
a shape that will be tangent to the side ellipsis and the side of
the cube, as per the red markup in the attached image.

How can I calculate that shape, or otherwise smooth the sharp edge?



$fn=30;

ZZ=5;
WW=42;
HH=100;

difference() {
     cube([WW,HH,ZZ]);
     // top and bottom
     translate([WW/2,0,0])  scale([1,2.5 ,1]) cylinder(ZZ,d=WW-(10));
     translate([WW/2,HH,0]) scale([1,2.5,1]) cylinder(ZZ,d=WW-(10));
     // sides
     translate([0,HH/2,0]) scale([1,1.8,1]) cylinder(ZZ,r=WW/4);
     translate([WW,HH/2,0]) scale([1,1.8,1]) cylinder(ZZ,r=WW/4);
     // smooth the arms
     // ???
}

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

snapz003.png (36K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Rounding a sharp corner?

Parkinbot
Hm, better start in 2D and then try to use offset() for things like this.

ZZ=5;
WW=42;
HH=100;
os = 15;

linear_extrude(ZZ)
intersection()
{
  square([WW,HH]);
  difference()
  {
    offset(-os)offset(os)
    {
        translate([WW/2,0])  scale([1,2.5]) circle(d=WW);
        translate([WW/2,HH,0]) scale([1,2.5,1]) circle(d=WW);
    }
      translate([WW/2,0])  scale([1,2.5]) circle(d=WW-(10));
      translate([WW/2,HH,0]) scale([1,2.5,1]) circle(d=WW-(10));
  }
}




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Rounding a sharp corner?

marhar
On 8/12/18 5:21 PM, Parkinbot wrote:
> Hm, better start in 2D and then try to use offset() for things like this.

This is perfect, thanks very much!

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Rounding a sharp corner?

frankv
Minkowski is also good for rounding edges and corners.  

On Mon, 13 Aug 2018, 2:00 PM Mark Harrison, <[hidden email]> wrote:
On 8/12/18 5:21 PM, Parkinbot wrote:
> Hm, better start in 2D and then try to use offset() for things like this.

This is perfect, thanks very much!

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Rounding a sharp corner?

Troberg
In reply to this post by Parkinbot
I use this handy little snippet for rounding corners in 2d:

module polyround(radius){
        //Inside corners
        offset(r=-radius)
        offset(delta=radius)
        //Outside corners
        offset(r=radius)
        offset(delta=-radius)
        children();
}

//Sample code
//One sample shape
module poly(outer,inner){

polygon([[-outer,0],[-inner,inner],[0,outer],[inner,inner],[outer,0],[inner,-inner],[0,-outer],[-inner,-inner]]);
}

//Another sample shape
module poly2(){
        translate([220,0,0])
        difference(){
                square([200,200], center=true);
                square([100,100], center=true);
        }
}

//First shape with rounded corners
polyround(10)
poly(100,30);

//Shape without rounded corners, for reference
translate([0,0,-1])
color("red")
poly(100,30);

//Second shape with rounded corners
polyround(10)
poly2();

//Shape without rounded corners, for reference
translate([0,0,-1])
color("red")
poly2();



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org