# how to make round chamfer at 2D object?

14 messages
Open this post in threaded view
|

## how to make round chamfer at 2D object?

 This post has NOT been accepted by the mailing list yet. round_chamfer=1; translate([s,-s/2,0]) slot(); translate([s,0,0]) offset(round_chamfer)slot(); translate([s,s/2,0]) color("green")offset(-round_chamfer)offset(round_chamfer)slot(); slot is an 2D object. I want offset twice to make the round chamfer, but seems fail. how understand this? "When negative, the polygon is offset inwards." in wiki.
Open this post in threaded view
|

## Re: how to make round chamfer at 2D object?

 Next time please give a full code example. If you do a negative and a positive offset() with the same parameter the result will be identity. I guess you want to have your slot object with rounded edges at the "original" size. Using offset() this is only possible, if you construct the square part smaller and the hole part larger by the chamfer value. \$fn = 30; s = 40; round_chamfer=1; translate([0,-s/2,0]) slot(); translate([0,0,0])  offset(round_chamfer)    slot(offs=round_chamfer); module slot(a = 12, b = 16, r = 4, offs = 0) {   difference()   {     square([a-2*offs, b-2*offs] , center = true);     hull()     {       circle(r+offs, center = true);       translate([a, 0])       circle(r+offs, center = true);     }   } }
Open this post in threaded view
|

## Re: how to make round chamfer at 2D object?

Open this post in threaded view
|

## Re: how to make round chamfer at 2D object?

 If either of you (nop head, Parkinbot) could provide a small example, I would appreciate it. On 12/24/2016 7:15 AM, nop head wrote: >If you do a negative and a positive offset() with the same parameter the result will be identity. No it will round the convex or concave corners (depending on the order) with a radius equal to the offset. I use it regularly. On 24 December 2016 at 12:08, Parkinbot wrote: Next time please give a full code example. If you do a negative and a positive offset() with the same parameter the result will be identity. _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: how to make round chamfer at 2D object?

 In reply to this post by Parkinbot On 24. des. 2016 13:08, Parkinbot wrote: > I guess you want to have your slot object with rounded edges at the > "original" size. Using offset() this is only possible, if you construct the > square part smaller and the hole part larger by the chamfer value. Using your slot() you can do the following to get rounded corners of the original object, with original size and given radius: \$fn = 30; rad = 1; offset(r=rad) offset(delta=-rad) slot(); Carsten Arnholm _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: how to make round chamfer at 2D object?

Open this post in threaded view
|

## Re: how to make round chamfer at 2D object?

 This post has NOT been accepted by the mailing list yet. good example. thanks. I catch it now.
Open this post in threaded view
|

## Re: how to make round chamfer at 2D object?

 This post has NOT been accepted by the mailing list yet. In reply to this post by Parkinbot I hate manually calculate. so not agree this method. I usually use "include" and "use", so it hard to paste entire code. Next time I will paste full code. thanks.
Open this post in threaded view
|

## Re: how to make round chamfer at 2D object?

 In reply to this post by nophead runsun, you are right. It is obviously not identity (only the initial example). So what do you do, if you want to have inner and outer edges rounded?
Open this post in threaded view
|

## Re: how to make round chamfer at 2D object?

 On 25. des. 2016 00:19, Parkinbot wrote: > So what do you do, if you want to have inner and outer edges > rounded? You apply both techniques at once. module rectangle_with_hole(a = 12, b = 16, th = 4) {    difference()    {      square([a,b],center=true);      square([a-2*th,b-2*th],center=true);    } } \$fn = 30; rad = 1.5; // causes outer loop rounding offset(r=rad) offset(r=-rad) // causes inner loop rounding offset(r=-rad) offset(r=rad) rectangle_with_hole(); Carsten Arnholm _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: how to make round chamfer at 2D object?

 Cool
Open this post in threaded view
|

## Re: how to make round chamfer at 2D object?

 This post has NOT been accepted by the mailing list yet. In reply to this post by cacb interesting. maybe next version offset could add one parameter "both-direction=true",  so only one offset(5, true) can do it. lol