# Absolute newbie - looking for advice on how to apply a chamfer

10 messages
Open this post in threaded view
|

## Absolute newbie - looking for advice on how to apply a chamfer

 Hi All, I'm trying to design a display for some Poker Chips. Due to the manufacturing tolerances of the chips and of my printer, some chips fit snugly and some are loose. To get round this I'd like a chamfer on the edge where the chip is inserted to make it easier to insert the chip into a tight recess, but am clueless as to how to achieve this My current code is ; \$fn=64; ChipBase=44; x=3 ; y=3; module Chip() { difference() { cube([ChipBase,ChipBase,5]); translate ([ChipBase/2,ChipBase/2,1.7])cylinder (r=20.30,h=4); translate([ChipBase/2, ChipBase/2, -0.5]) cylinder (r=10, h=3);   } } for(i = [0:ChipBase:(x*ChipBase)-1]){     for(j = [0:ChipBase:(y*ChipBase)-1]){         translate([i,j,0]) Chip();         } } Hope this makes sense and any suggestions gratefully received -- Sent from: http://forum.openscad.org/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Absolute newbie - looking for advice on how to apply a chamfer

Open this post in threaded view
|

## Re: Absolute newbie - looking for advice on how to apply a chamfer

 In reply to this post by SUggy62 Being reluctant to dig out and learn chamfers in BOSL2, I just did a bit of a brute force thing, \$fn=64; ChipBase=44; x=3 ; y=3; module Chip() {         difference() {                 cube([ChipBase,ChipBase,5]);                 translate ([ChipBase/2,ChipBase/2,1.7])                         cylinder (r=20.30,h=4);                 translate([ChipBase/2, ChipBase/2, -0.5])                         cylinder (r=10, h=3);                   translate ([22,22,1.5])                         chamfer();         } } module chamfer() {         rotate_extrude(convexity = 10)                 translate([20,4, 0])                         circle(r = 2,\$fn=3); } for(i = [0:ChipBase:(x*ChipBase)-1]){     for(j = [0:ChipBase:(y*ChipBase)-1]){         translate([i,j,0]) Chip();         } } -- Sent from: http://forum.openscad.org/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Absolute newbie - looking for advice on how to apply a chamfer

 On 2/7/2020 8:50 PM, lar3ry wrote: ```Being reluctant to dig out and learn chamfers in BOSL2, I just did a bit of a brute force thing, ``` Yep, though I thought in terms of a cone rather than a rotate_extrude of a triangle. Also I couldn't resist factoring the translate-to-center out.  Nor could I resist extracting all of the variables out.  Note that we don't need separate variables for the thickness of the negative cylinders, because they only have to reach above the base; the thickness of the base (+2 for the through hole) is plenty. ```\$fn=64; ChipBase=44; x=3; y=3; thickness = 5; // Base thickness thickness2 = 1.7; // thickness inside chip hole chip_r = 20.3; // Outer hole hole_r = 10; // Inner hole cham_h = 1; // Height of the chamfer cham_r = 1; // Radius (in addition to the hole) of the chamfer module Chip() { difference() { cube([ChipBase, ChipBase, thickness]); translate([ChipBase/2, ChipBase/2, 0]) { translate ([0, 0, thickness2]) cylinder (r=chip_r,h=thickness); // -1 and +2 are to avoid Z-fighting. translate([0, 0, -1]) cylinder (r=hole_r, h=thickness+2); translate ([0, 0, thickness]) chamfer(); } } } // z=0 is at the top of the hole, so we generate a chamfer down from that. // Note that this module controls all of the geometry of the chamfer. module chamfer() { translate([0,0,-cham_h]) { // cham_h*2 gets us out of Z-fighting. cham_r*2 keeps the // angles the same. cylinder(h=cham_h*2, r1=chip_r, r2=chip_r + cham_r*2); } } for(i = [0:ChipBase:(x*ChipBase)-1]){ for(j = [0:ChipBase:(y*ChipBase)-1]){ translate([i,j,0]) Chip(); } } ``` _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Absolute newbie - looking for advice on how to apply a chamfer

 In reply to this post by SUggy62 Fantastic, That's been really helpful and informative. I'm going to have a play with all three methods TY -- Sent from: http://forum.openscad.org/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Absolute newbie - looking for advice on how to apply a chamfer

 In reply to this post by JordanBrown On 08.02.20 06:20, Jordan Brown wrote: >             // -1 and +2 are to avoid Z-fighting. >             translate([0, 0, -1]) >                 cylinder (r=hole_r, h=thickness+2); I usually don't bother with the adjustments by making the cylinder big enough:   cylinder(r = hole_r, h = thickness * 3, center = true); ciao,   Torsten. _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org -- Torsten
Open this post in threaded view
|

## Re: Absolute newbie - looking for advice on how to apply a chamfer

 In reply to this post by lar3ry Chamfers in BOSL2 are actually fairly convenient in this case.  A cyl() with a negative chamfer2= value makes an external top chamfer mask. include \$fn=64; x=3; y=3; ChipBase=44; thickness = 5;      // Base thickness thickness2 = 1.7;   // thickness inside chip hole chip_r = 20.3;      // Outer hole hole_r = 10;        // Inner hole cham_h = 1;         // Height of the chamfer grid2d(spacing=ChipBase, cols=x, rows=y) {         difference() {                 cube([ChipBase+0.01,ChipBase+0.01,thickness], anchor=BOT);                 up(thickness2) cyl(r=chip_r, h=thickness-thickness2+0.01, chamfer2=-cham_h, anchor=BOT);                 cyl(r=hole_r, h=thickness*3);         } } > On Feb 7, 2020, at 8:50 PM, lar3ry <[hidden email]> wrote: > > Being reluctant to dig out and learn chamfers in BOSL2, I just did a bit of a > brute force thing, > > \$fn=64; > > ChipBase=44; > x=3 ; > y=3; > > module Chip() { > difference() { > cube([ChipBase,ChipBase,5]); > translate ([ChipBase/2,ChipBase/2,1.7]) > cylinder (r=20.30,h=4); > translate([ChipBase/2, ChipBase/2, -0.5]) > cylinder (r=10, h=3);   > translate ([22,22,1.5]) > chamfer(); > } > } > > module chamfer() { > rotate_extrude(convexity = 10) > translate([20,4, 0]) > circle(r = 2,\$fn=3); > } > > for(i = [0:ChipBase:(x*ChipBase)-1]){ >    for(j = [0:ChipBase:(y*ChipBase)-1]){ >        translate([i,j,0]) Chip();     >    } > } > > > > > > -- > Sent from: http://forum.openscad.org/> > _______________________________________________ > 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
Open this post in threaded view
|