discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

How to round the top inner and outer edges?

BR
Bob Roos
Sun, Sep 3, 2023 1:19 AM

Hello OpenSCAD,

I want the bottom to be straight and the top inside and outside edges to have 2mm roundover

Thank you.

include <BOSL2/std.scad> //or screws or threading

W=34;
L=60;
H=10;
Or = 8;
Ir = 3;

rect_tube(size=[W,L], wall=5, rounding=Or, h=H,irounding=3);

--
Best regards,
Bob                          mailto:roosbob@wybatap.com

Hello OpenSCAD, I want the bottom to be straight and the top inside and outside edges to have 2mm roundover Thank you. include <BOSL2/std.scad> //or screws or threading W=34; L=60; H=10; Or = 8; Ir = 3; rect_tube(size=[W,L], wall=5, rounding=Or, h=H,irounding=3); -- Best regards, Bob mailto:roosbob@wybatap.com
SP
Sanjeev Prabhakar
Sun, Sep 3, 2023 8:13 AM

You can make a section and a rectangular path and then path_extrude it.
I am sure this would be available in bosl library

On Sun, 3 Sept, 2023, 6:50 am Bob Roos, roosbob@wybatap.com wrote:

Hello OpenSCAD,

I want the bottom to be straight and the top inside and outside edges to
have 2mm roundover

Thank you.

include <BOSL2/std.scad> //or screws or threading

W=34;
L=60;
H=10;
Or = 8;
Ir = 3;

rect_tube(size=[W,L], wall=5, rounding=Or, h=H,irounding=3);

--
Best regards,
Bob                          mailto:roosbob@wybatap.com


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

You can make a section and a rectangular path and then path_extrude it. I am sure this would be available in bosl library On Sun, 3 Sept, 2023, 6:50 am Bob Roos, <roosbob@wybatap.com> wrote: > Hello OpenSCAD, > > I want the bottom to be straight and the top inside and outside edges to > have 2mm roundover > > Thank you. > > include <BOSL2/std.scad> //or screws or threading > > W=34; > L=60; > H=10; > Or = 8; > Ir = 3; > > rect_tube(size=[W,L], wall=5, rounding=Or, h=H,irounding=3); > > -- > Best regards, > Bob mailto:roosbob@wybatap.com > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
SP
Sanjeev Prabhakar
Sun, Sep 3, 2023 10:17 AM

attached file
[image: Screenshot 2023-09-03 at 3.45.43 PM.png]

On Sun, 3 Sept 2023 at 06:50, Bob Roos roosbob@wybatap.com wrote:

Hello OpenSCAD,

I want the bottom to be straight and the top inside and outside edges to
have 2mm roundover

Thank you.

include <BOSL2/std.scad> //or screws or threading

W=34;
L=60;
H=10;
Or = 8;
Ir = 3;

rect_tube(size=[W,L], wall=5, rounding=Or, h=H,irounding=3);

--
Best regards,
Bob                          mailto:roosbob@wybatap.com


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

attached file [image: Screenshot 2023-09-03 at 3.45.43 PM.png] On Sun, 3 Sept 2023 at 06:50, Bob Roos <roosbob@wybatap.com> wrote: > Hello OpenSCAD, > > I want the bottom to be straight and the top inside and outside edges to > have 2mm roundover > > Thank you. > > include <BOSL2/std.scad> //or screws or threading > > W=34; > L=60; > H=10; > Or = 8; > Ir = 3; > > rect_tube(size=[W,L], wall=5, rounding=Or, h=H,irounding=3); > > -- > Best regards, > Bob mailto:roosbob@wybatap.com > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
SP
Sanjeev Prabhakar
Sun, Sep 3, 2023 10:31 AM

No need for dependencies2 file here and can be excluded

On Sun, 3 Sept, 2023, 3:47 pm Sanjeev Prabhakar, sprabhakar2006@gmail.com
wrote:

attached file
[image: Screenshot 2023-09-03 at 3.45.43 PM.png]

On Sun, 3 Sept 2023 at 06:50, Bob Roos roosbob@wybatap.com wrote:

Hello OpenSCAD,

I want the bottom to be straight and the top inside and outside edges to
have 2mm roundover

Thank you.

include <BOSL2/std.scad> //or screws or threading

W=34;
L=60;
H=10;
Or = 8;
Ir = 3;

rect_tube(size=[W,L], wall=5, rounding=Or, h=H,irounding=3);

--
Best regards,
Bob                          mailto:roosbob@wybatap.com


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

No need for dependencies2 file here and can be excluded On Sun, 3 Sept, 2023, 3:47 pm Sanjeev Prabhakar, <sprabhakar2006@gmail.com> wrote: > attached file > [image: Screenshot 2023-09-03 at 3.45.43 PM.png] > > > > On Sun, 3 Sept 2023 at 06:50, Bob Roos <roosbob@wybatap.com> wrote: > >> Hello OpenSCAD, >> >> I want the bottom to be straight and the top inside and outside edges to >> have 2mm roundover >> >> Thank you. >> >> include <BOSL2/std.scad> //or screws or threading >> >> W=34; >> L=60; >> H=10; >> Or = 8; >> Ir = 3; >> >> rect_tube(size=[W,L], wall=5, rounding=Or, h=H,irounding=3); >> >> -- >> Best regards, >> Bob mailto:roosbob@wybatap.com >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >
BR
Bob Roos
Sun, Sep 3, 2023 11:02 AM

Hi Sanjeev,

Thank you. It's beautiful, but how did you generate all those points??

I had to hollow out the part a bit and change the shape some so I would like to find a more generic way to round the edges.
 
Bob
 
Sunday, September 3, 2023, 6:17:54 AM, you wrote:

attached file

On Sun, 3 Sept 2023 at 06:50, Bob Roos roosbob@wybatap.com wrote:

Hello OpenSCAD,

I want the bottom to be straight and the top inside and outside edges to have 2mm roundover

Thank you.

  include <BOSL2/std.scad> //or screws or threading

W=34;
L=60;
H=10;
Or = 8;
Ir = 3;

rect_tube(size=[W,L], wall=5, rounding=Or, h=H,irounding=3);

-- 
have Fun,
 Bob                           mailto:roosbob@wybatap.com

Hi Sanjeev, Thank you. It's beautiful, but how did you generate all those points?? I had to hollow out the part a bit and change the shape some so I would like to find a more generic way to round the edges.   Bob   Sunday, September 3, 2023, 6:17:54 AM, you wrote: > attached file > On Sun, 3 Sept 2023 at 06:50, Bob Roos <roosbob@wybatap.com> wrote: >> Hello OpenSCAD, >> I want the bottom to be straight and the top inside and outside edges to have 2mm roundover >> Thank you. >>   include <BOSL2/std.scad> //or screws or threading >> W=34; >> L=60; >> H=10; >> Or = 8; >> Ir = 3; >> rect_tube(size=[W,L], wall=5, rounding=Or, h=H,irounding=3); --  have Fun,  Bob                           mailto:roosbob@wybatap.com
FH
Father Horton
Sun, Sep 3, 2023 11:07 AM

When I want something with rounded corners, I use BOSL2’s turtle.

On Sun, Sep 3, 2023 at 6:02 AM Bob Roos roosbob@wybatap.com wrote:

Hi Sanjeev,

Thank you. It's beautiful, but how did you generate all those points??

I had to hollow out the part a bit and change the shape some so I would
like to find a more generic way to round the edges.

Bob

Sunday, September 3, 2023, 6:17:54 AM, you wrote:

attached file
[image: Screenshot 2023-09-03 at 3.45.43 PM.png]

On Sun, 3 Sept 2023 at 06:50, Bob Roos roosbob@wybatap.com wrote:

Hello OpenSCAD,

I want the bottom to be straight and the top inside and outside edges to
have 2mm roundover

Thank you.

include <BOSL2/std.scad> //or screws or threading

W=34;
L=60;
H=10;
Or = 8;
Ir = 3;

rect_tube(size=[W,L], wall=5, rounding=Or, h=H,irounding=3);

--
Best regards,
Bob                          mailto:roosbob@wybatap.com


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

--
have Fun,
Bob                          mailto:roosbob@wybatap.com
roosbob@wybatap.com


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

When I want something with rounded corners, I use BOSL2’s turtle. On Sun, Sep 3, 2023 at 6:02 AM Bob Roos <roosbob@wybatap.com> wrote: > Hi Sanjeev, > > > Thank you. It's beautiful, but how did you generate all those points?? > > > I had to hollow out the part a bit and change the shape some so I would > like to find a more generic way to round the edges. > > > > Bob > > > > Sunday, September 3, 2023, 6:17:54 AM, you wrote: > > attached file > [image: Screenshot 2023-09-03 at 3.45.43 PM.png] > > > > On Sun, 3 Sept 2023 at 06:50, Bob Roos <roosbob@wybatap.com> wrote: > >> Hello OpenSCAD, >> >> I want the bottom to be straight and the top inside and outside edges to >> have 2mm roundover >> >> Thank you. >> >> include <BOSL2/std.scad> //or screws or threading >> >> W=34; >> L=60; >> H=10; >> Or = 8; >> Ir = 3; >> >> rect_tube(size=[W,L], wall=5, rounding=Or, h=H,irounding=3); >> >> -- >> Best regards, >> Bob mailto:roosbob@wybatap.com >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > > -- > have Fun, > Bob mailto:roosbob@wybatap.com > <roosbob@wybatap.com> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
SP
Sanjeev Prabhakar
Sun, Sep 3, 2023 11:17 AM

I will explain the process
I think this is important.

There are 2 approaches.

  1. Extrude a section along a path
  2. Make a section and offset it multiple times to generate a solid.

I am sure this explanation is not enough. Will create a visual description
and send it to you.

For approach 2:
The key is writing a function to offset a section, which I think is not so
easy.

On Sun, 3 Sept, 2023, 4:32 pm Bob Roos, roosbob@wybatap.com wrote:

Hi Sanjeev,

Thank you. It's beautiful, but how did you generate all those points??

I had to hollow out the part a bit and change the shape some so I would
like to find a more generic way to round the edges.

Bob

Sunday, September 3, 2023, 6:17:54 AM, you wrote:

attached file
[image: Screenshot 2023-09-03 at 3.45.43 PM.png]

On Sun, 3 Sept 2023 at 06:50, Bob Roos roosbob@wybatap.com wrote:

Hello OpenSCAD,

I want the bottom to be straight and the top inside and outside edges to
have 2mm roundover

Thank you.

include <BOSL2/std.scad> //or screws or threading

W=34;
L=60;
H=10;
Or = 8;
Ir = 3;

rect_tube(size=[W,L], wall=5, rounding=Or, h=H,irounding=3);

--
Best regards,
Bob                          mailto:roosbob@wybatap.com


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

--
have Fun,
Bob                          mailto:roosbob@wybatap.com
roosbob@wybatap.com


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

I will explain the process I think this is important. There are 2 approaches. 1. Extrude a section along a path 2. Make a section and offset it multiple times to generate a solid. I am sure this explanation is not enough. Will create a visual description and send it to you. For approach 2: The key is writing a function to offset a section, which I think is not so easy. On Sun, 3 Sept, 2023, 4:32 pm Bob Roos, <roosbob@wybatap.com> wrote: > Hi Sanjeev, > > > Thank you. It's beautiful, but how did you generate all those points?? > > > I had to hollow out the part a bit and change the shape some so I would > like to find a more generic way to round the edges. > > > > Bob > > > > Sunday, September 3, 2023, 6:17:54 AM, you wrote: > > attached file > [image: Screenshot 2023-09-03 at 3.45.43 PM.png] > > > > On Sun, 3 Sept 2023 at 06:50, Bob Roos <roosbob@wybatap.com> wrote: > >> Hello OpenSCAD, >> >> I want the bottom to be straight and the top inside and outside edges to >> have 2mm roundover >> >> Thank you. >> >> include <BOSL2/std.scad> //or screws or threading >> >> W=34; >> L=60; >> H=10; >> Or = 8; >> Ir = 3; >> >> rect_tube(size=[W,L], wall=5, rounding=Or, h=H,irounding=3); >> >> -- >> Best regards, >> Bob mailto:roosbob@wybatap.com >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > > -- > have Fun, > Bob mailto:roosbob@wybatap.com > <roosbob@wybatap.com> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
SP
Sanjeev Prabhakar
Sun, Sep 3, 2023 12:05 PM

Explanation of approach 1 attached

On Sun, 3 Sept 2023 at 16:47, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

I will explain the process
I think this is important.

There are 2 approaches.

  1. Extrude a section along a path
  2. Make a section and offset it multiple times to generate a solid.

I am sure this explanation is not enough. Will create a visual description
and send it to you.

For approach 2:
The key is writing a function to offset a section, which I think is not so
easy.

Explanation of approach 1 attached On Sun, 3 Sept 2023 at 16:47, Sanjeev Prabhakar <sprabhakar2006@gmail.com> wrote: > I will explain the process > I think this is important. > > There are 2 approaches. > 1. Extrude a section along a path > 2. Make a section and offset it multiple times to generate a solid. > > I am sure this explanation is not enough. Will create a visual description > and send it to you. > > For approach 2: > The key is writing a function to offset a section, which I think is not so > easy. >
SP
Sanjeev Prabhakar
Sun, Sep 3, 2023 12:40 PM

sorry i got a warning for big file size

I have posted them here
https://github.com/sprabhakar2006/openSCAD/tree/main/explanation%20of%20approaches

On Sun, 3 Sept 2023 at 16:47, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

I will explain the process
I think this is important.

There are 2 approaches.

  1. Extrude a section along a path
  2. Make a section and offset it multiple times to generate a solid.

I am sure this explanation is not enough. Will create a visual description
and send it to you.

For approach 2:
The key is writing a function to offset a section, which I think is not so
easy.

sorry i got a warning for big file size I have posted them here https://github.com/sprabhakar2006/openSCAD/tree/main/explanation%20of%20approaches On Sun, 3 Sept 2023 at 16:47, Sanjeev Prabhakar <sprabhakar2006@gmail.com> wrote: > I will explain the process > I think this is important. > > There are 2 approaches. > 1. Extrude a section along a path > 2. Make a section and offset it multiple times to generate a solid. > > I am sure this explanation is not enough. Will create a visual description > and send it to you. > > For approach 2: > The key is writing a function to offset a section, which I think is not so > easy. >
AM
Adrian Mariano
Sun, Sep 3, 2023 12:59 PM

I think that Sanjeev has identified the two main approaches.  You can make
a rounded rectangle shape and sweep.  That would look like this:

include<BOSL2/std.scad>

$fa=1;$fs=1;
W=34;L=60;H=10;Or = 8;Ir = 3;

section = rect([Or-Ir,H], rounding=[2,2,0,0],anchor=BOT+LEFT);
path = rect([W,L],rounding=Ir);
path_sweep(section,path,closed=true);

Note that I have chosen as the sweep path the inner rounded rectangle which
avoids issues with self-intersection of the sweep.  This is probably the
best way to do this in terms of efficiency.  Note also that using turtle()
to compute a rounded rectangle is overkill.  I only use turtle() for shapes
that are somehow irregular.

Sanjeev's second approach is to use offsetting.  This is possible using
offset_sweep(), but will likely be slower than path_sweep() because
computing offset in userspace is slow.  To do this, you have to compute the
outside rounded shape and then subtract the inner rounded shape.  So it
could be done like this:

include<BOSL2/std.scad>
include<BOSL2/rounding.scad>

$fa=1;$fs=1;
W=34;L=60;H=10;Or = 8;Ir = 3;

inside = rect([W,L]-(Or-Ir)*[2,2], rounding=Ir);
outside = rect([W,L], rounding=Or);

difference(){
offset_sweep(outside, h=H, top=os_circle(r=2));
down(1)offset_sweep(inside, h=H+1, top=os_circle(r=-2),extra=1);
}

Note that you could also compute just one of inside and outside directly
and get the other one with offset().

A third way to make a shape like this is to use rounded_prism(), again with
a difference.  However, rounded_prism doesn't make circular roundings, so
the results will be a bit different, and it will not be possible to assure
a uniform width at the corners.  (Roundovers here are continuous curvature
beziers.  The k parameter controls how gentle the transition, with a value
of .8 close to circular.  Smaller k values will give gentler transitions,
but then large joint distance may be desired.  Try changing k to 0.5 to see
the difference.)

include<BOSL2/std.scad>
include<BOSL2/rounding.scad>

$fa=1;$fs=1;
W=34;L=60;H=10;Or = 8;Ir = 3;

diff(){
rounded_prism(rect([W,L]),height=H, joint_top=2, joint_sides=8,k=.8)
up(.01)align(TOP,inside=true)rounded_prism(rect([W,L]-[5,5]),height=H+1,
joint_top=-2, joint_sides=6,k=.8);
}

On Sun, Sep 3, 2023 at 7:18 AM Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

I will explain the process
I think this is important.

There are 2 approaches.

  1. Extrude a section along a path
  2. Make a section and offset it multiple times to generate a solid.

I am sure this explanation is not enough. Will create a visual description
and send it to you.

For approach 2:
The key is writing a function to offset a section, which I think is not so
easy.

On Sun, 3 Sept, 2023, 4:32 pm Bob Roos, roosbob@wybatap.com wrote:

Hi Sanjeev,

Thank you. It's beautiful, but how did you generate all those points??

I had to hollow out the part a bit and change the shape some so I would
like to find a more generic way to round the edges.

Bob

Sunday, September 3, 2023, 6:17:54 AM, you wrote:

attached file
[image: Screenshot 2023-09-03 at 3.45.43 PM.png]

On Sun, 3 Sept 2023 at 06:50, Bob Roos roosbob@wybatap.com wrote:

Hello OpenSCAD,

I want the bottom to be straight and the top inside and outside edges to
have 2mm roundover

Thank you.

include <BOSL2/std.scad> //or screws or threading

W=34;
L=60;
H=10;
Or = 8;
Ir = 3;

rect_tube(size=[W,L], wall=5, rounding=Or, h=H,irounding=3);

--
Best regards,
Bob                          mailto:roosbob@wybatap.com


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

--
have Fun,
Bob                          mailto:roosbob@wybatap.com
roosbob@wybatap.com


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

I think that Sanjeev has identified the two main approaches. You can make a rounded rectangle shape and sweep. That would look like this: include<BOSL2/std.scad> $fa=1;$fs=1; W=34;L=60;H=10;Or = 8;Ir = 3; section = rect([Or-Ir,H], rounding=[2,2,0,0],anchor=BOT+LEFT); path = rect([W,L],rounding=Ir); path_sweep(section,path,closed=true); Note that I have chosen as the sweep path the inner rounded rectangle which avoids issues with self-intersection of the sweep. This is probably the best way to do this in terms of efficiency. Note also that using turtle() to compute a rounded rectangle is overkill. I only use turtle() for shapes that are somehow irregular. Sanjeev's second approach is to use offsetting. This is possible using offset_sweep(), but will likely be slower than path_sweep() because computing offset in userspace is slow. To do this, you have to compute the outside rounded shape and then subtract the inner rounded shape. So it could be done like this: include<BOSL2/std.scad> include<BOSL2/rounding.scad> $fa=1;$fs=1; W=34;L=60;H=10;Or = 8;Ir = 3; inside = rect([W,L]-(Or-Ir)*[2,2], rounding=Ir); outside = rect([W,L], rounding=Or); difference(){ offset_sweep(outside, h=H, top=os_circle(r=2)); down(1)offset_sweep(inside, h=H+1, top=os_circle(r=-2),extra=1); } Note that you could also compute just one of inside and outside directly and get the other one with offset(). A third way to make a shape like this is to use rounded_prism(), again with a difference. However, rounded_prism doesn't make circular roundings, so the results will be a bit different, and it will not be possible to assure a uniform width at the corners. (Roundovers here are continuous curvature beziers. The k parameter controls how gentle the transition, with a value of .8 close to circular. Smaller k values will give gentler transitions, but then large joint distance may be desired. Try changing k to 0.5 to see the difference.) include<BOSL2/std.scad> include<BOSL2/rounding.scad> $fa=1;$fs=1; W=34;L=60;H=10;Or = 8;Ir = 3; diff(){ rounded_prism(rect([W,L]),height=H, joint_top=2, joint_sides=8,k=.8) up(.01)align(TOP,inside=true)rounded_prism(rect([W,L]-[5,5]),height=H+1, joint_top=-2, joint_sides=6,k=.8); } On Sun, Sep 3, 2023 at 7:18 AM Sanjeev Prabhakar <sprabhakar2006@gmail.com> wrote: > I will explain the process > I think this is important. > > There are 2 approaches. > 1. Extrude a section along a path > 2. Make a section and offset it multiple times to generate a solid. > > I am sure this explanation is not enough. Will create a visual description > and send it to you. > > For approach 2: > The key is writing a function to offset a section, which I think is not so > easy. > > > > > On Sun, 3 Sept, 2023, 4:32 pm Bob Roos, <roosbob@wybatap.com> wrote: > >> Hi Sanjeev, >> >> >> Thank you. It's beautiful, but how did you generate all those points?? >> >> >> I had to hollow out the part a bit and change the shape some so I would >> like to find a more generic way to round the edges. >> >> >> >> Bob >> >> >> >> Sunday, September 3, 2023, 6:17:54 AM, you wrote: >> >> attached file >> [image: Screenshot 2023-09-03 at 3.45.43 PM.png] >> >> >> >> On Sun, 3 Sept 2023 at 06:50, Bob Roos <roosbob@wybatap.com> wrote: >> >>> Hello OpenSCAD, >>> >>> I want the bottom to be straight and the top inside and outside edges to >>> have 2mm roundover >>> >>> Thank you. >>> >>> include <BOSL2/std.scad> //or screws or threading >>> >>> W=34; >>> L=60; >>> H=10; >>> Or = 8; >>> Ir = 3; >>> >>> rect_tube(size=[W,L], wall=5, rounding=Or, h=H,irounding=3); >>> >>> -- >>> Best regards, >>> Bob mailto:roosbob@wybatap.com >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> >> -- >> have Fun, >> Bob mailto:roosbob@wybatap.com >> <roosbob@wybatap.com> >> _______________________________________________ >> 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 >