On 2019-11-22 16:25, Alex Gibson wrote:
Nice! I must check out AngelCAD.
So this works well for square-edged items. I wanted to check how well
my example would work for rounded shapes. Not so well.
In this case the 'mount' is supposed to have rounded ends being the
union of two cylinders. But the cubes I used to inflate the original
piece overpowered the original shape's radii:
I have not tried that, but this technique is equivalent to "machine
away" a layer of material of thickness equal to fillet radius from all
sides, so if the shape is rounded in the first place, that rounding will
be reduced or disappear.
Perhaps the general solution is to first inflate the original rounded
shape using minkowski, using a sphere with the fillet radius. Then apply
the same technique as demonstrated for the square-edge items on the
result.
This could be considered a 3d equivalent to positive followed by
negative offsets in 2d.
Carsten Arnholm
For convex shapes, one can use the following solution that builds on hull:
convex_fillet(10)
linear_extrude(50)
offset(0) square([10, 40], center = true);
module convex_fillet(r=10, n=6)
{
for(i=[0:n-1])
{
w0 = 90/ni;
w1 = 90/n(i+1);
x0 = r*(1-sin(w0));
x1 = r*(1-sin(w1));
y0 = r*(1-cos(w0));
y1 = r*(1-cos(w1));
hull()
{
translate([0,0,y0])linear_extrude(.01)
offset(x0)projection() children();
translate([0,0,y1])linear_extrude(.01)
offset(x1)projection() children();
}
}
children();
}
http://forum.openscad.org/file/t887/fillet.png
--
Sent from: http://forum.openscad.org/
I plowed on in the same vein as the previous example, but using TWO
minkowski spheres, one to inflate, and the next to cut.
After 5 HOURS of rendering, I got the intended result:
Here's the slightly tweaked code:
fillet_radius = 10;
mount_width = 15;
module original_shape()
{
union()
{
//plate
translate([0,0,-5])
cube([200,100,10],center=true);
//mount
hull()
{
translate([0,75/2-mount_width/2,25])
cylinder(50,mount_width/2,mount_width/2,center=true);
translate([0,-75/2+mount_width/2,25])
cylinder(50,mount_width/2,mount_width/2,center=true);
}
}
}
module shape_inflated()
{
minkowski()
{
original_shape();
sphere(fillet_radius);
}
}
difference()
{
shape_inflated();
minkowski()
{
difference()
{
cube([500,500,500],center=true);
shape_inflated();
}
sphere(fillet_radius);
}
}
Doing a minkowski with sphere operation on an already completed minkowski
sphere is super intensive to code, so i will be keen to try any other ways
to achieve the same result.!
Also, I showed the good side above; here is the other side, with either a
render defect or a hole in the mesh.!
Alex Gibson
admg consulting
edumaker limited
. Project management
. Operations & Process improvement
. 3D Printing
-----Original Message-----
From: Discuss [mailto:discuss-bounces@lists.openscad.org] On Behalf Of
arnholm@arnholm.org
Sent: 23 November 2019 09:57
To: OpenSCAD general discussion
Subject: Re: [OpenSCAD] Monitor Mount
On 2019-11-22 16:25, Alex Gibson wrote:
Nice! I must check out AngelCAD.
So this works well for square-edged items. I wanted to check how well
my example would work for rounded shapes. Not so well.
In this case the 'mount' is supposed to have rounded ends being the
union of two cylinders. But the cubes I used to inflate the original
piece overpowered the original shape's radii:
I have not tried that, but this technique is equivalent to "machine
away" a layer of material of thickness equal to fillet radius from all
sides, so if the shape is rounded in the first place, that rounding will
be reduced or disappear.
Perhaps the general solution is to first inflate the original rounded
shape using minkowski, using a sphere with the fillet radius. Then apply
the same technique as demonstrated for the square-edge items on the
result.
This could be considered a 3d equivalent to positive followed by
negative offsets in 2d.
Carsten Arnholm
OpenSCAD mailing list
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
I wrote a module specifically to handle this sort of problem. My module,
offset_sweep, constructs a polygon from a set of polygons offset from a
given polygon. You have to supply the starting shape as a point sequence
rather than geometry. I contributed by function to the BOSL2 library.
Here's the code:
include<BOSL2/std.scad>
include<BOSL2/rounding.scad>
fillet_radius = 10;
mount_width = 15;
mount_length = 75;
rectangle = square([mount_width, mount_length],center=true);
round_rectangle = round_corners(rectangle, measure="radius",
size=mount_width/2,$fn=64);
cuboid([200,100,10],anchor=TOP);
offset_sweep(round_rectangle, height=50,
bottom=os_circle(r=-fillet_radius));
And here's the result, which previews in 1s and renders in 3s on my machine.
http://forum.openscad.org/file/t2477/round_thing.png
--
Sent from: http://forum.openscad.org/
Didn't see adrianv's reply til now, but I just created a simple module to
perform fillet on bottom and/or top as a sort of variation on
linear_extrude, called fillet_extrude.
https://gist.github.com/thehans/b47ab7077c862361eb5d8f095448b2d4
Its not as efficient or flexible as the BOSL example appears to be, since
my version does not work directly with point data.
But still should render under a minute, with fairly compact, self-contained
code.
Hans
On Sat, Nov 23, 2019 at 8:12 PM adrianv avm4@cornell.edu wrote:
I wrote a module specifically to handle this sort of problem. My module,
offset_sweep, constructs a polygon from a set of polygons offset from a
given polygon. You have to supply the starting shape as a point sequence
rather than geometry. I contributed by function to the BOSL2 library.
Here's the code:
include<BOSL2/std.scad>
include<BOSL2/rounding.scad>
fillet_radius = 10;
mount_width = 15;
mount_length = 75;
rectangle = square([mount_width, mount_length],center=true);
round_rectangle = round_corners(rectangle, measure="radius",
size=mount_width/2,$fn=64);
cuboid([200,100,10],anchor=TOP);
offset_sweep(round_rectangle, height=50,
bottom=os_circle(r=-fillet_radius));
And here's the result, which previews in 1s and renders in 3s on my
machine.
http://forum.openscad.org/file/t2477/round_thing.png
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
It seems like the main unavoidable limitation of your approach is that the
polygon has to be convex (and the resulting shape has to be constructable
from convex slices). It's certainly a heck of a lot simpler than what I
did.
thehans wrote
Didn't see adrianv's reply til now, but I just created a simple module to
perform fillet on bottom and/or top as a sort of variation on
linear_extrude, called fillet_extrude.
https://gist.github.com/thehans/b47ab7077c862361eb5d8f095448b2d4
Its not as efficient or flexible as the BOSL example appears to be, since
my version does not work directly with point data.
But still should render under a minute, with fairly compact,
self-contained
code.
Hans
On Sat, Nov 23, 2019 at 8:12 PM adrianv <
avm4@
> wrote:
I wrote a module specifically to handle this sort of problem. My module,
offset_sweep, constructs a polygon from a set of polygons offset from a
given polygon. You have to supply the starting shape as a point sequence
rather than geometry. I contributed by function to the BOSL2 library.
Here's the code:
include<BOSL2/std.scad>
include<BOSL2/rounding.scad>
fillet_radius = 10;
mount_width = 15;
mount_length = 75;
rectangle = square([mount_width, mount_length],center=true);
round_rectangle = round_corners(rectangle, measure="radius",
size=mount_width/2,$fn=64);
cuboid([200,100,10],anchor=TOP);
offset_sweep(round_rectangle, height=50,
bottom=os_circle(r=-fillet_radius));
And here's the result, which previews in 1s and renders in 3s on my
machine.
<http://forum.openscad.org/file/t2477/round_thing.png>
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@.openscad
Discuss@.openscad
--
Sent from: http://forum.openscad.org/