discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: complex fillet

RW
Roger Whiteley
Sun, Dec 17, 2023 5:12 PM

Ah, rounded corners,

I've been playing with polygons for a while as a means of creating
objects that don't need chamfers, or filleting tools, its always easier
to avoid putting on corners than it is to remove them afterwards, even
if it needs a bit of mental gymnastics to compute the points.

Rounding the top edge of a cylinder is an excuse to use rotate_extrude
with a circle..

So here's an example of computing rounded corners, dropped into list
coordinates and then a 3D shape made from it.

Irritatingly, intersection doesn't return the same result when wrapped
around the make_ring modules, you get the points where the two objects
overlap, which is to be expected. So I left that out of the example below...

wall_thick = 2;
inner_radius = 0.5;

p2 = [[0,0], [wall_thick,0],

//at x=0,y=wall_thick
for (phi = [270 : 5 : 360]) [(inner_radius *
cos(phi))+wall_thick-inner_radius, inner_radius * sin(phi)+inner_radius],
//at X,Y = wall_thick
for (chi = [0 : 5 : 90]) [(inner_radius * cos(chi))
+wall_thick-inner_radius, inner_radius * sin(chi)+wall_thick-inner_radius],

[0,wall_thick]
];

module make_ring () {
rotate_extrude() translate([3.5,0,0])
polygon (p2);
}

translate ([5,0,-1])  make_ring ();
translate ([-5,-1,0]) rotate([90, 0, 180]) make_ring ();

thanks to all for a fascinating read as usual

Roger.

Ah, rounded corners, I've been playing with polygons for a while as a means of creating objects that don't need chamfers, or filleting tools, its always easier to avoid putting on corners than it is to remove them afterwards, even if it needs a bit of mental gymnastics to compute the points. Rounding the top edge of a cylinder is an excuse to use rotate_extrude with a circle.. So here's an example of computing rounded corners, dropped into list coordinates and then a 3D shape made from it. Irritatingly, intersection doesn't return the same result when wrapped around the make_ring modules, you get the points where the two objects overlap, which is to be expected. So I left that out of the example below... wall_thick = 2; inner_radius = 0.5; p2 = [[0,0], [wall_thick,0], //at x=0,y=wall_thick for (phi = [270 : 5 : 360]) [(inner_radius * cos(phi))+wall_thick-inner_radius, inner_radius * sin(phi)+inner_radius], //at X,Y = wall_thick for (chi = [0 : 5 : 90]) [(inner_radius * cos(chi)) +wall_thick-inner_radius, inner_radius * sin(chi)+wall_thick-inner_radius], [0,wall_thick] ]; module make_ring () { rotate_extrude() translate([3.5,0,0]) polygon (p2); } translate ([5,0,-1])  make_ring (); translate ([-5,-1,0]) rotate([90, 0, 180]) make_ring (); thanks to all for a fascinating read as usual Roger.
SP
Sanjeev Prabhakar
Mon, Dec 18, 2023 4:16 PM

I checked your code.
2 rings need to be joined together such that they appear as 1 object.
That is a real challenge, but there would be other approaches which can
achieve this. How neat that would be is the question.

On Sun, 17 Dec 2023 at 22:42, Roger Whiteley via Discuss <
discuss@lists.openscad.org> wrote:

Ah, rounded corners,

I've been playing with polygons for a while as a means of creating
objects that don't need chamfers, or filleting tools, its always easier
to avoid putting on corners than it is to remove them afterwards, even
if it needs a bit of mental gymnastics to compute the points.

Rounding the top edge of a cylinder is an excuse to use rotate_extrude
with a circle..

So here's an example of computing rounded corners, dropped into list
coordinates and then a 3D shape made from it.

Irritatingly, intersection doesn't return the same result when wrapped
around the make_ring modules, you get the points where the two objects
overlap, which is to be expected. So I left that out of the example
below...

wall_thick = 2;
inner_radius = 0.5;

p2 = [[0,0], [wall_thick,0],

//at x=0,y=wall_thick
for (phi = [270 : 5 : 360]) [(inner_radius *
cos(phi))+wall_thick-inner_radius, inner_radius * sin(phi)+inner_radius],
//at X,Y = wall_thick
for (chi = [0 : 5 : 90]) [(inner_radius * cos(chi))
+wall_thick-inner_radius, inner_radius * sin(chi)+wall_thick-inner_radius],

[0,wall_thick]
];

module make_ring () {
rotate_extrude() translate([3.5,0,0])
polygon (p2);
}

translate ([5,0,-1])  make_ring ();
translate ([-5,-1,0]) rotate([90, 0, 180]) make_ring ();

thanks to all for a fascinating read as usual

Roger.


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

I checked your code. 2 rings need to be joined together such that they appear as 1 object. That is a real challenge, but there would be other approaches which can achieve this. How neat that would be is the question. On Sun, 17 Dec 2023 at 22:42, Roger Whiteley via Discuss < discuss@lists.openscad.org> wrote: > Ah, rounded corners, > > I've been playing with polygons for a while as a means of creating > objects that don't need chamfers, or filleting tools, its always easier > to avoid putting on corners than it is to remove them afterwards, even > if it needs a bit of mental gymnastics to compute the points. > > Rounding the top edge of a cylinder is an excuse to use rotate_extrude > with a circle.. > > So here's an example of computing rounded corners, dropped into list > coordinates and then a 3D shape made from it. > > Irritatingly, intersection doesn't return the same result when wrapped > around the make_ring modules, you get the points where the two objects > overlap, which is to be expected. So I left that out of the example > below... > > wall_thick = 2; > inner_radius = 0.5; > > p2 = [[0,0], [wall_thick,0], > > //at x=0,y=wall_thick > for (phi = [270 : 5 : 360]) [(inner_radius * > cos(phi))+wall_thick-inner_radius, inner_radius * sin(phi)+inner_radius], > //at X,Y = wall_thick > for (chi = [0 : 5 : 90]) [(inner_radius * cos(chi)) > +wall_thick-inner_radius, inner_radius * sin(chi)+wall_thick-inner_radius], > > [0,wall_thick] > ]; > > module make_ring () { > rotate_extrude() translate([3.5,0,0]) > polygon (p2); > } > > translate ([5,0,-1]) make_ring (); > translate ([-5,-1,0]) rotate([90, 0, 180]) make_ring (); > > thanks to all for a fascinating read as usual > > Roger. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >