discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

How best to apply offset on 2D square?

T
Terry
Wed, Jul 28, 2021 3:43 PM

Decades ago I bought plastic rain guttering as one of many sources
for making electronics project cases.

Attached or here:
https://www.dropbox.com/s/itbg6n7mh58d2fe/Guttering.jpg?raw=1

I've got some guttering left but no end caps (which are no longer
available). To 3D print a simple push-on replacement my first
approach is to linearly extrude the difference between two
rectangles to make the push-on 'lip'. (I'll then add a 2mm thick
cube for the back.) But I find it hard going using offset,
difference and translate on squares to see exactly what's
happening to the dimensions. I'm about to try 'center = true' on
the squares to see if that helps.

Attached or here:

https://www.dropbox.com/s/lmtrwvtct0aclia/OffsetChangesThickness.jpg?raw=1

Specifically, after adding offset (r=3) to get the corners
rounded, thickness is also increased by 3mm and I'm not clear how
to avoid that? Is it possible for offset to add rounding without
changing the other dimensions?

Or should I go straight to 3D and use hull or minkowski? Or some
other method?

Terry

Decades ago I bought plastic rain guttering as one of many sources for making electronics project cases. Attached or here: https://www.dropbox.com/s/itbg6n7mh58d2fe/Guttering.jpg?raw=1 I've got some guttering left but no end caps (which are no longer available). To 3D print a simple push-on replacement my first approach is to linearly extrude the difference between two rectangles to make the push-on 'lip'. (I'll then add a 2mm thick cube for the back.) But I find it hard going using offset, difference and translate on squares to see exactly what's happening to the dimensions. I'm about to try 'center = true' on the squares to see if that helps. Attached or here: https://www.dropbox.com/s/lmtrwvtct0aclia/OffsetChangesThickness.jpg?raw=1 Specifically, after adding offset (r=3) to get the corners rounded, thickness is also increased by 3mm and I'm not clear how to avoid that? Is it possible for offset to add rounding without changing the other dimensions? Or should I go straight to 3D and use hull or minkowski? Or some other method? Terry
MM
Michael Möller
Wed, Jul 28, 2021 4:08 PM

I can not repeat your problem.
$fn=16;
linear_extrude(height=4) {
difference() {
offset(r=3) square([69,56]) ;  // or delta=2
square([69,56]);
}
}

Show us your code.

On Wed, 28 Jul 2021 at 17:44, Terry terrypingm@gmail.com wrote:

Decades ago I bought plastic rain guttering as one of many sources
for making electronics project cases.

Attached or here:
https://www.dropbox.com/s/itbg6n7mh58d2fe/Guttering.jpg?raw=1

I've got some guttering left but no end caps (which are no longer
available). To 3D print a simple push-on replacement my first
approach is to linearly extrude the difference between two
rectangles to make the push-on 'lip'. (I'll then add a 2mm thick
cube for the back.) But I find it hard going using offset,
difference and translate on squares to see exactly what's
happening to the dimensions. I'm about to try 'center = true' on
the squares to see if that helps.

Attached or here:

https://www.dropbox.com/s/lmtrwvtct0aclia/OffsetChangesThickness.jpg?raw=1

Specifically, after adding offset (r=3) to get the corners
rounded, thickness is also increased by 3mm and I'm not clear how
to avoid that? Is it possible for offset to add rounding without
changing the other dimensions?

Or should I go straight to 3D and use hull or minkowski? Or some
other method?

Terry


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I can not repeat your problem. $fn=16; linear_extrude(height=4) { difference() { offset(r=3) square([69,56]) ; // or delta=2 square([69,56]); } } Show us your code. On Wed, 28 Jul 2021 at 17:44, Terry <terrypingm@gmail.com> wrote: > Decades ago I bought plastic rain guttering as one of many sources > for making electronics project cases. > > Attached or here: > https://www.dropbox.com/s/itbg6n7mh58d2fe/Guttering.jpg?raw=1 > > I've got some guttering left but no end caps (which are no longer > available). To 3D print a simple push-on replacement my first > approach is to linearly extrude the difference between two > rectangles to make the push-on 'lip'. (I'll then add a 2mm thick > cube for the back.) But I find it hard going using offset, > difference and translate on squares to see exactly what's > happening to the dimensions. I'm about to try 'center = true' on > the squares to see if that helps. > > Attached or here: > > https://www.dropbox.com/s/lmtrwvtct0aclia/OffsetChangesThickness.jpg?raw=1 > > > Specifically, after adding offset (r=3) to get the corners > rounded, thickness is also increased by 3mm and I'm not clear how > to avoid that? Is it possible for offset to add rounding without > changing the other dimensions? > > Or should I go straight to 3D and use hull or minkowski? Or some > other method? > > Terry > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
T
Terry
Wed, Jul 28, 2021 4:43 PM

Thanks Michael. Here's the current state of my code. But I'm
obviously making heavy weather of it compared to yours.

// Push fit end cover for grey guttering
// Outer of guttering is 68.5 x 56mm rectangle
// That may be a fraction too large, but if first
// print is loose then fix with two M3 screws

$fn=40;
linear_extrude(8)

difference() {
offset(3)
// Before applying offset r, reduce dimensions
// of outer square by 2*r to compensate
//  square([72.5, 60], center = true);
square([66.5, 54], center = true);
// Required inner square has same inner
// dimensions as exterior of guttering
// and thickness of 2mm
square([68.5, 56], center = true);
}
// Add back cover, slightly smaller to avoid
// corner rounding
#cube([70.0, 57.5, 2.0], center = true);

On Wed, 28 Jul 2021 18:08:19 +0200, you wrote:

I can not repeat your problem.
$fn=16;
linear_extrude(height=4) {
difference() {
offset(r=3) square([69,56]) ;  // or delta=2
square([69,56]);
}
}

Show us your code.

On Wed, 28 Jul 2021 at 17:44, Terry terrypingm@gmail.com wrote:

Decades ago I bought plastic rain guttering as one of many sources
for making electronics project cases.

Attached or here:
https://www.dropbox.com/s/itbg6n7mh58d2fe/Guttering.jpg?raw=1

I've got some guttering left but no end caps (which are no longer
available). To 3D print a simple push-on replacement my first
approach is to linearly extrude the difference between two
rectangles to make the push-on 'lip'. (I'll then add a 2mm thick
cube for the back.) But I find it hard going using offset,
difference and translate on squares to see exactly what's
happening to the dimensions. I'm about to try 'center = true' on
the squares to see if that helps.

Attached or here:

https://www.dropbox.com/s/lmtrwvtct0aclia/OffsetChangesThickness.jpg?raw=1

Specifically, after adding offset (r=3) to get the corners
rounded, thickness is also increased by 3mm and I'm not clear how
to avoid that? Is it possible for offset to add rounding without
changing the other dimensions?

Or should I go straight to 3D and use hull or minkowski? Or some
other method?

Terry


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Thanks Michael. Here's the current state of my code. But I'm obviously making heavy weather of it compared to yours. // Push fit end cover for grey guttering // Outer of guttering is 68.5 x 56mm rectangle // That may be a fraction too large, but if first // print is loose then fix with two M3 screws $fn=40; linear_extrude(8) difference() { offset(3) // Before applying offset r, reduce dimensions // of outer square by 2*r to compensate // square([72.5, 60], center = true); square([66.5, 54], center = true); // Required inner square has same inner // dimensions as exterior of guttering // and thickness of 2mm square([68.5, 56], center = true); } // Add back cover, slightly smaller to avoid // corner rounding #cube([70.0, 57.5, 2.0], center = true); On Wed, 28 Jul 2021 18:08:19 +0200, you wrote: >I can not repeat your problem. >$fn=16; >linear_extrude(height=4) { > difference() { > offset(r=3) square([69,56]) ; // or delta=2 > square([69,56]); > } >} > >Show us your code. > > >On Wed, 28 Jul 2021 at 17:44, Terry <terrypingm@gmail.com> wrote: > >> Decades ago I bought plastic rain guttering as one of many sources >> for making electronics project cases. >> >> Attached or here: >> https://www.dropbox.com/s/itbg6n7mh58d2fe/Guttering.jpg?raw=1 >> >> I've got some guttering left but no end caps (which are no longer >> available). To 3D print a simple push-on replacement my first >> approach is to linearly extrude the difference between two >> rectangles to make the push-on 'lip'. (I'll then add a 2mm thick >> cube for the back.) But I find it hard going using offset, >> difference and translate on squares to see exactly what's >> happening to the dimensions. I'm about to try 'center = true' on >> the squares to see if that helps. >> >> Attached or here: >> >> https://www.dropbox.com/s/lmtrwvtct0aclia/OffsetChangesThickness.jpg?raw=1 >> >> >> Specifically, after adding offset (r=3) to get the corners >> rounded, thickness is also increased by 3mm and I'm not clear how >> to avoid that? Is it possible for offset to add rounding without >> changing the other dimensions? >> >> Or should I go straight to 3D and use hull or minkowski? Or some >> other method? >> >> Terry >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >>
MM
Michael Möller
Wed, Jul 28, 2021 5:55 PM

well, you've made the outer square different in size to the inner square
... this adds with the increase in the outer square you apply with the
offset. You say something to that effect in the comment, but you do not
subtract 2*r, and that wouldn't work.

OK... hmmm.... if you want the corners rounded in 3 dimensions, instead of
just cylindrical (which is what you get when you extrude), then you need to
define the 8 corners with spheres, and hull them; suibtract an inner cube
for your critical inner dimension, and optionally a slab to make it square
on the top.

I am so sure someone has made a "parameterized" box with rounded corners on
thingiverse. - why reinvent the wheel?

ons. 28. jul. 2021 18.43 skrev Terry terrypingm@gmail.com:

Thanks Michael. Here's the current state of my code. But I'm
obviously making heavy weather of it compared to yours.

// Push fit end cover for grey guttering
// Outer of guttering is 68.5 x 56mm rectangle
// That may be a fraction too large, but if first
// print is loose then fix with two M3 screws

$fn=40;
linear_extrude(8)

difference() {
offset(3)
// Before applying offset r, reduce dimensions
// of outer square by 2*r to compensate
//  square([72.5, 60], center = true);
square([66.5, 54], center = true);
// Required inner square has same inner
// dimensions as exterior of guttering
// and thickness of 2mm
square([68.5, 56], center = true);
}
// Add back cover, slightly smaller to avoid
// corner rounding
#cube([70.0, 57.5, 2.0], center = true);

On Wed, 28 Jul 2021 18:08:19 +0200, you wrote:

I can not repeat your problem.
$fn=16;
linear_extrude(height=4) {
difference() {
offset(r=3) square([69,56]) ;  // or delta=2
square([69,56]);
}
}

Show us your code.

On Wed, 28 Jul 2021 at 17:44, Terry terrypingm@gmail.com wrote:

Decades ago I bought plastic rain guttering as one of many sources
for making electronics project cases.

Attached or here:
https://www.dropbox.com/s/itbg6n7mh58d2fe/Guttering.jpg?raw=1

I've got some guttering left but no end caps (which are no longer
available). To 3D print a simple push-on replacement my first
approach is to linearly extrude the difference between two
rectangles to make the push-on 'lip'. (I'll then add a 2mm thick
cube for the back.) But I find it hard going using offset,
difference and translate on squares to see exactly what's
happening to the dimensions. I'm about to try 'center = true' on
the squares to see if that helps.

Attached or here:

Specifically, after adding offset (r=3) to get the corners
rounded, thickness is also increased by 3mm and I'm not clear how
to avoid that? Is it possible for offset to add rounding without
changing the other dimensions?

Or should I go straight to 3D and use hull or minkowski? Or some
other method?

Terry


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

well, you've made the outer square different in size to the inner square ... this adds with the increase in the outer square you apply with the offset. You say something to that effect in the comment, but you do not subtract 2*r, and that wouldn't work. OK... hmmm.... if you want the corners rounded in 3 dimensions, instead of just cylindrical (which is what you get when you extrude), then you need to define the 8 corners with spheres, and hull them; suibtract an inner cube for your critical inner dimension, and optionally a slab to make it square on the top. I am so sure someone has made a "parameterized" box with rounded corners on thingiverse. - why reinvent the wheel? ons. 28. jul. 2021 18.43 skrev Terry <terrypingm@gmail.com>: > Thanks Michael. Here's the current state of my code. But I'm > obviously making heavy weather of it compared to yours. > > // Push fit end cover for grey guttering > // Outer of guttering is 68.5 x 56mm rectangle > // That may be a fraction too large, but if first > // print is loose then fix with two M3 screws > > $fn=40; > linear_extrude(8) > > difference() { > offset(3) > // Before applying offset r, reduce dimensions > // of outer square by 2*r to compensate > // square([72.5, 60], center = true); > square([66.5, 54], center = true); > // Required inner square has same inner > // dimensions as exterior of guttering > // and thickness of 2mm > square([68.5, 56], center = true); > } > // Add back cover, slightly smaller to avoid > // corner rounding > #cube([70.0, 57.5, 2.0], center = true); > > > > On Wed, 28 Jul 2021 18:08:19 +0200, you wrote: > >I can not repeat your problem. > >$fn=16; > >linear_extrude(height=4) { > > difference() { > > offset(r=3) square([69,56]) ; // or delta=2 > > square([69,56]); > > } > >} > > > >Show us your code. > > > > > >On Wed, 28 Jul 2021 at 17:44, Terry <terrypingm@gmail.com> wrote: > > > >> Decades ago I bought plastic rain guttering as one of many sources > >> for making electronics project cases. > >> > >> Attached or here: > >> https://www.dropbox.com/s/itbg6n7mh58d2fe/Guttering.jpg?raw=1 > >> > >> I've got some guttering left but no end caps (which are no longer > >> available). To 3D print a simple push-on replacement my first > >> approach is to linearly extrude the difference between two > >> rectangles to make the push-on 'lip'. (I'll then add a 2mm thick > >> cube for the back.) But I find it hard going using offset, > >> difference and translate on squares to see exactly what's > >> happening to the dimensions. I'm about to try 'center = true' on > >> the squares to see if that helps. > >> > >> Attached or here: > >> > >> > https://www.dropbox.com/s/lmtrwvtct0aclia/OffsetChangesThickness.jpg?raw=1 > >> > >> > >> Specifically, after adding offset (r=3) to get the corners > >> rounded, thickness is also increased by 3mm and I'm not clear how > >> to avoid that? Is it possible for offset to add rounding without > >> changing the other dimensions? > >> > >> Or should I go straight to 3D and use hull or minkowski? Or some > >> other method? > >> > >> Terry > >> _______________________________________________ > >> OpenSCAD mailing list > >> To unsubscribe send an email to discuss-leave@lists.openscad.org > >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
L
larry
Wed, Jul 28, 2021 7:26 PM

On Wed, 2021-07-28 at 17:43 +0100, Terry wrote:

Thanks Michael. Here's the current state of my code. But I'm
obviously making heavy weather of it compared to yours.

Modifying your code...

$fn=40;
linear_extrude(8)

difference() {
offset(3)
square([66.5, 54]);
square([66.5, 54]);
}
#cube([66.5, 54, 2.0]);

Nice idea for electronic cases, BTW!

On Wed, 2021-07-28 at 17:43 +0100, Terry wrote: > Thanks Michael. Here's the current state of my code. But I'm > obviously making heavy weather of it compared to yours. Modifying your code... $fn=40; linear_extrude(8) difference() { offset(3) square([66.5, 54]); square([66.5, 54]); } #cube([66.5, 54, 2.0]); Nice idea for electronic cases, BTW!
T
terrypingm@gmail.com
Wed, Jul 28, 2021 9:26 PM

Thanks Larry. First print looked good. Snug fit, although not a really tight fit like the original waterproof versions! I’ll add a couple of M2 or M3 screws.

One flaw that’s apparent when I look closely is that the INNER radius of the rounded corners is, of course, not 3mm. Looks closer to 1, if that. Just curious how that could be coded?

--
Terry

On 28 Jul 2021, at 20:27, larry lar3ry@sasktel.net wrote:

On Wed, 2021-07-28 at 17:43 +0100, Terry wrote:

Thanks Michael. Here's the current state of my code. But I'm
obviously making heavy weather of it compared to yours.

Modifying your code...

$fn=40;
linear_extrude(8)

difference() {
offset(3)
square([66.5, 54]);
square([66.5, 54]);
}
#cube([66.5, 54, 2.0]);

Nice idea for electronic cases, BTW!


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Thanks Larry. First print looked good. Snug fit, although not a really tight fit like the original waterproof versions! I’ll add a couple of M2 or M3 screws. One flaw that’s apparent when I look closely is that the INNER radius of the rounded corners is, of course, not 3mm. Looks closer to 1, if that. Just curious how that could be coded? -- Terry > On 28 Jul 2021, at 20:27, larry <lar3ry@sasktel.net> wrote: > > On Wed, 2021-07-28 at 17:43 +0100, Terry wrote: >> Thanks Michael. Here's the current state of my code. But I'm >> obviously making heavy weather of it compared to yours. > > Modifying your code... > > $fn=40; > linear_extrude(8) > > difference() { > offset(3) > square([66.5, 54]); > square([66.5, 54]); > } > #cube([66.5, 54, 2.0]); > > Nice idea for electronic cases, BTW! > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
L
larry
Wed, Jul 28, 2021 10:20 PM

On Wed, 2021-07-28 at 22:26 +0100, terrypingm@gmail.com wrote:

Thanks Larry. First print looked good. Snug fit, although not a
really tight fit like the original waterproof versions! I’ll add a
couple of M2 or M3 screws.
One flaw that’s apparent when I look closely is that the INNER radius
of the rounded corners is, of course, not 3mm. Looks closer to 1, if
that. Just curious how that could be coded?

You'd have to adjust the actual dimensions, but here's one way:

$fn=40;
linear_extrude(8)

difference() {
offset(6)
square([66.5, 54]);
offset (3)
square([66.5, 54]);
}
#cube([66.5, 54, 2.0]);

On Wed, 2021-07-28 at 22:26 +0100, terrypingm@gmail.com wrote: > Thanks Larry. First print looked good. Snug fit, although not a > really tight fit like the original waterproof versions! I’ll add a > couple of M2 or M3 screws. > One flaw that’s apparent when I look closely is that the INNER radius > of the rounded corners is, of course, not 3mm. Looks closer to 1, if > that. Just curious how that could be coded? You'd have to adjust the actual dimensions, but here's one way: $fn=40; linear_extrude(8) difference() { offset(6) square([66.5, 54]); offset (3) square([66.5, 54]); } #cube([66.5, 54, 2.0]);
RW
Ray West
Wed, Jul 28, 2021 11:52 PM

If I want to round off square corners I do this (or a 3d version.)

//corner rounder
module round(r){
    difference(){
       square(r*2,true);
          translate([r,r]) circle(r);
          translate([-r,r]) circle(r);
          translate([r,-r]) circle(r);
          translate([-r,-r]) circle(r);
    }
}

//example to round a couple of corners of a 30 by 20 rectangle
difference(){
     square([30,20]);
         translate([30,20]) round(6);
         translate ([0,20]) round(2);
}

On 28/07/2021 16:43, Terry wrote:

Decades ago I bought plastic rain guttering as one of many sources
for making electronics project cases.

Attached or here:
https://www.dropbox.com/s/itbg6n7mh58d2fe/Guttering.jpg?raw=1

I've got some guttering left but no end caps (which are no longer
available). To 3D print a simple push-on replacement my first
approach is to linearly extrude the difference between two
rectangles to make the push-on 'lip'. (I'll then add a 2mm thick
cube for the back.) But I find it hard going using offset,
difference and translate on squares to see exactly what's
happening to the dimensions. I'm about to try 'center = true' on
the squares to see if that helps.

Attached or here:

https://www.dropbox.com/s/lmtrwvtct0aclia/OffsetChangesThickness.jpg?raw=1

Specifically, after adding offset (r=3) to get the corners
rounded, thickness is also increased by 3mm and I'm not clear how
to avoid that? Is it possible for offset to add rounding without
changing the other dimensions?

Or should I go straight to 3D and use hull or minkowski? Or some
other method?

Terry


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

If I want to round off square corners I do this (or a 3d version.) //corner rounder module round(r){     difference(){        square(r*2,true);           translate([r,r]) circle(r);           translate([-r,r]) circle(r);           translate([r,-r]) circle(r);           translate([-r,-r]) circle(r);     } } //example to round a couple of corners of a 30 by 20 rectangle difference(){      square([30,20]);          translate([30,20]) round(6);          translate ([0,20]) round(2); } On 28/07/2021 16:43, Terry wrote: > Decades ago I bought plastic rain guttering as one of many sources > for making electronics project cases. > > Attached or here: > https://www.dropbox.com/s/itbg6n7mh58d2fe/Guttering.jpg?raw=1 > > I've got some guttering left but no end caps (which are no longer > available). To 3D print a simple push-on replacement my first > approach is to linearly extrude the difference between two > rectangles to make the push-on 'lip'. (I'll then add a 2mm thick > cube for the back.) But I find it hard going using offset, > difference and translate on squares to see exactly what's > happening to the dimensions. I'm about to try 'center = true' on > the squares to see if that helps. > > Attached or here: > > https://www.dropbox.com/s/lmtrwvtct0aclia/OffsetChangesThickness.jpg?raw=1 > > > Specifically, after adding offset (r=3) to get the corners > rounded, thickness is also increased by 3mm and I'm not clear how > to avoid that? Is it possible for offset to add rounding without > changing the other dimensions? > > Or should I go straight to 3D and use hull or minkowski? Or some > other method? > > Terry > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
T
Terry
Thu, Jul 29, 2021 8:30 AM

Thanks Ray, that should prove handy. Heading out so yet to study
it properly. But something odd about one of the corners that's
more obvious when viewed from the top. Attached or here:
https://www.dropbox.com/s/q18jwxjvs2r6y15/Rounding-Ray-1.jpg?raw=1

Presumably dependent on $fn?


I'm surprised there's no OpenSCAD command that emulates scissors,
or Tipp-Ex, or pasting a bit of white paper over your mistakes. It
would just make a quadrant of specified radius and let you move
(translate) it to a precise position. That's what I intuitively
wanted to do with my square corners ;-)

Terry

====================

On Thu, 29 Jul 2021 00:52:48 +0100, you wrote:

If I want to round off square corners I do this (or a 3d version.)

//corner rounder
module round(r){
    difference(){
       square(r*2,true);
          translate([r,r]) circle(r);
          translate([-r,r]) circle(r);
          translate([r,-r]) circle(r);
          translate([-r,-r]) circle(r);
    }
}

//example to round a couple of corners of a 30 by 20 rectangle
difference(){
     square([30,20]);
         translate([30,20]) round(6);
         translate ([0,20]) round(2);
}

On 28/07/2021 16:43, Terry wrote:

Decades ago I bought plastic rain guttering as one of many sources
for making electronics project cases.

Attached or here:
https://www.dropbox.com/s/itbg6n7mh58d2fe/Guttering.jpg?raw=1

I've got some guttering left but no end caps (which are no longer
available). To 3D print a simple push-on replacement my first
approach is to linearly extrude the difference between two
rectangles to make the push-on 'lip'. (I'll then add a 2mm thick
cube for the back.) But I find it hard going using offset,
difference and translate on squares to see exactly what's
happening to the dimensions. I'm about to try 'center = true' on
the squares to see if that helps.

Attached or here:

https://www.dropbox.com/s/lmtrwvtct0aclia/OffsetChangesThickness.jpg?raw=1

Specifically, after adding offset (r=3) to get the corners
rounded, thickness is also increased by 3mm and I'm not clear how
to avoid that? Is it possible for offset to add rounding without
changing the other dimensions?

Or should I go straight to 3D and use hull or minkowski? Or some
other method?

Terry


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Thanks Ray, that should prove handy. Heading out so yet to study it properly. But something odd about one of the corners that's more obvious when viewed from the top. Attached or here: https://www.dropbox.com/s/q18jwxjvs2r6y15/Rounding-Ray-1.jpg?raw=1 Presumably dependent on $fn? -------------------- I'm surprised there's no OpenSCAD command that emulates scissors, or Tipp-Ex, or pasting a bit of white paper over your mistakes. It would just make a quadrant of specified radius and let you move (translate) it to a precise position. That's what I intuitively wanted to do with my square corners ;-) Terry ==================== On Thu, 29 Jul 2021 00:52:48 +0100, you wrote: >If I want to round off square corners I do this (or a 3d version.) > >//corner rounder >module round(r){ >     difference(){ >        square(r*2,true); >           translate([r,r]) circle(r); >           translate([-r,r]) circle(r); >           translate([r,-r]) circle(r); >           translate([-r,-r]) circle(r); >     } >} > >//example to round a couple of corners of a 30 by 20 rectangle >difference(){ >      square([30,20]); >          translate([30,20]) round(6); >          translate ([0,20]) round(2); >} > >On 28/07/2021 16:43, Terry wrote: >> Decades ago I bought plastic rain guttering as one of many sources >> for making electronics project cases. >> >> Attached or here: >> https://www.dropbox.com/s/itbg6n7mh58d2fe/Guttering.jpg?raw=1 >> >> I've got some guttering left but no end caps (which are no longer >> available). To 3D print a simple push-on replacement my first >> approach is to linearly extrude the difference between two >> rectangles to make the push-on 'lip'. (I'll then add a 2mm thick >> cube for the back.) But I find it hard going using offset, >> difference and translate on squares to see exactly what's >> happening to the dimensions. I'm about to try 'center = true' on >> the squares to see if that helps. >> >> Attached or here: >> >> https://www.dropbox.com/s/lmtrwvtct0aclia/OffsetChangesThickness.jpg?raw=1 >> >> >> Specifically, after adding offset (r=3) to get the corners >> rounded, thickness is also increased by 3mm and I'm not clear how >> to avoid that? Is it possible for offset to add rounding without >> changing the other dimensions? >> >> Or should I go straight to 3D and use hull or minkowski? Or some >> other method? >> >> Terry >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org
T
Terry
Thu, Jul 29, 2021 8:33 AM

Thanks Larry. Will study later, but as you say it needs further
adjustment. The back slab clearly is now much too small.

Terry

====================

On Wed, 28 Jul 2021 16:20:16 -0600, you wrote:

On Wed, 2021-07-28 at 22:26 +0100, terrypingm@gmail.com wrote:

Thanks Larry. First print looked good. Snug fit, although not a
really tight fit like the original waterproof versions! I’ll add a
couple of M2 or M3 screws.
One flaw that’s apparent when I look closely is that the INNER radius
of the rounded corners is, of course, not 3mm. Looks closer to 1, if
that. Just curious how that could be coded?

You'd have to adjust the actual dimensions, but here's one way:

$fn=40;
linear_extrude(8)

difference() {
offset(6)
square([66.5, 54]);
offset (3)
square([66.5, 54]);
}
#cube([66.5, 54, 2.0]);


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Thanks Larry. Will study later, but as you say it needs further adjustment. The back slab clearly is now much too small. Terry ==================== On Wed, 28 Jul 2021 16:20:16 -0600, you wrote: >On Wed, 2021-07-28 at 22:26 +0100, terrypingm@gmail.com wrote: >> Thanks Larry. First print looked good. Snug fit, although not a >> really tight fit like the original waterproof versions! I’ll add a >> couple of M2 or M3 screws. >> One flaw that’s apparent when I look closely is that the INNER radius >> of the rounded corners is, of course, not 3mm. Looks closer to 1, if >> that. Just curious how that could be coded? > >You'd have to adjust the actual dimensions, but here's one way: > >$fn=40; >linear_extrude(8) > >difference() { > offset(6) > square([66.5, 54]); > offset (3) > square([66.5, 54]); >} >#cube([66.5, 54, 2.0]); >_______________________________________________ >OpenSCAD mailing list >To unsubscribe send an email to discuss-leave@lists.openscad.org