Hello Discuss,
T=1.8;
W=53.5;
L=70;
union(){
translate([0,-17,-T/2])rect_tube(size=[W,L],wall=T/2,h=2*T,rounding=T/2);
translate([0,-17,0])cube([W-T,L-T,T],center=true);
}
I want to round the 8 horizontal top edges and the 4 outside horizontal bottom edges in addition to the already rounded side corners.
The union is there for the convenience of eliminating the generation using *
I thought about using cuboid with rounding and differencing out the top part with negative rounding on the top of the difference cuboid
Is there an easier way? I am trying to learn how to think "OpenSCAD"
--
Best regards,
Bob mailto:roosbob@wybatap.com
i am no openscad expert, but i use this class cubeR() i wrote for
rounding edges of cubes. you can pass in bools for each edge you want
radius.
$fn= 64;
// 1/4 of an inverted cylinder
module cylinder90i(r, h, tol=0.01)
{
difference()
{
translate([-r-tol, -r-tol, 0])
cube([r+tol+tol, r+tol+tol, h]);
translate([0, 0, -tol])
cylinder(r=r, h=h+tol+tol);
}
}
// cube with selectable radiused edges
module cubeR(args, tol=0.01,
FT1=false, FT2=false, FT3=false, FT4=false,
BK1=false, BK2=false, BK3=false, BK4=false,
L1 =false, L2 =false, L3 =false, L4=false,
R1 =false, R2 =false, R3 =false, R4=false,
TP1=false, TP2=false, TP3=false, TP4=false,
BT1=false, BT2=false, BT3=false, BT4=false)
{
width = args[0];
height = args[1];
depth = args[2];
rad = args[3];
c = tol;
difference()
{
cube([width, height, depth]);
union()
{
// Front
if (FT1||TP3)
{
translate([0, rad, depth-rad])
rotate([0, 90, 0])
translate([0, 0, -c])
cylinder90i(r=rad, h=width+c+c);
}
if (FT2||R4)
{
translate([width, 0, 0])
rotate([0, 180, 0]) translate([0, 0, -depth])
translate([rad, rad, 0])
translate([0, 0, -c])
cylinder90i(r=rad, h=depth+c+c);
}
if (FT3||BT1)
{
translate([0, rad, 0]) rotate([0, 90, 0])
translate([-rad, 0, 0]) rotate([0, 0, 90])
translate([0, 0, -c])
cylinder90i(r=rad, h=width+c+c);
}
if (FT4||L2)
{
translate([rad, rad, 0])
translate([0, 0, -c])
cylinder90i(r=rad, h=depth+c+c);
}
// Back
if (BK1||TP1)
{
translate([0, 0, 0])
translate([0, height-rad, depth-rad])
rotate([270, 0, 0])
rotate([0, 90, 0])
translate([0, 0, -c])
cylinder90i(r=rad, h=width+c+c);
}
if (BK2||L4)
{
translate([0, height, 0])
translate([rad, -rad, 0])
rotate([0, 0, 270])
translate([0, 0, -c])
cylinder90i(r=rad, h=depth+c+c);
}
if (BK3||BT3)
{
translate([0, height-rad, 0])
translate([0, 0, rad])
rotate([180, 0, 0])
rotate([0, 90, 0])
translate([0, 0, -c])
cylinder90i(r=rad, h=width+c+c);
}
if (BK4||R2)
{
translate([width-rad, height-rad, 0])
rotate([0, 0, 180])
translate([0, 0, -c])
cylinder90i(r=rad, h=depth+c+c);
}
// left
if (L1||TP4)
{
translate([rad, rad, depth-rad])
rotate([0, 90, 0])
translate([0, height-rad, 0]) rotate([90, 0, 0])
translate([0, 0, -c])
cylinder90i(r=rad, h=height+c+c);
}
if (L3||BT4)
{
translate([rad, rad, rad])
translate([0, height-rad, 0]) rotate([90, 0, 0])
translate([0, 0, -c])
cylinder90i(r=rad, h=height+c+c);
}
// right
if (R1||TP2)
{
translate([width-rad, 0, depth-rad])
rotate([270, 90, 0])
translate([0, 0, -c])
cylinder90i(r=rad, h=height+c+c);
}
if (R3||BT2)
{
translate([width-rad, 0])
rotate([270, 90, 0])
rotate([0, 0, 90]) translate([0, rad, 0])
translate([0, 0, -c])
cylinder90i(r=rad, h=height+c+c);
}
}
}
}
//
//
T=1.8;
W=53.5;
L=70;
rad = 2;
union()
{
cubeR([W, L, T, rad], TP1=true, TP2=true, TP3=true, TP4=true);
//translate([0,-17,-T/2])
rect_tube(size=[W,L],wall=T/2,h=2*T,rounding=T/2);
//translate([0,-17,0]) cube([W-T,L-T,T],center=true);
}
On 2022-12-26 08:30, Bob Roos wrote:
Hello Discuss,
T=1.8;
W=53.5;
L=70;
union(){
translate([0,-17,-T/2])rect_tube(size=[W,L],wall=T/2,h=2*T,rounding=T/2);
translate([0,-17,0])cube([W-T,L-T,T],center=true);
}
I want to round the 8 horizontal top edges and the 4 outside horizontal
bottom edges in addition to the already rounded side corners.
The union is there for the convenience of eliminating the generation
using *
I thought about using cuboid with rounding and differencing out the top
part with negative rounding on the top of the difference cuboid
Is there an easier way? I am trying to learn how to think "OpenSCAD"
--
Best regards,
Bob mailto:roosbob@wybatap.com
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
i have a redundant file "Connectors.scad.gAoowr" in the same folder as
"Connectors.scad"
i am unable to delete it as it says it dose not exist
it is likely something to do with when i crashed openscad last week
while working with "Connectors.scad" creating a circular reference by
mistake, any ideas how i can get rid of it
screenshot attached
Have you rebooted the computer since the crash? Possibly there is a zombie
process locking the file.
On Mon, 26 Dec 2022 at 12:25, jay@jdnd.co.uk wrote:
i have a redundant file "Connectors.scad.gAoowr" in the same folder as
"Connectors.scad"
i am unable to delete it as it says it dose not exist
it is likely something to do with when i crashed openscad last week while
working with "Connectors.scad" creating a circular reference by mistake,
any ideas how i can get rid of it
screenshot attached
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Hi Jay,
It could have the "hidden" attribute set. I don't speak your OS so can't offer any advice on checking the attribute. Also notice the little LOCK icon. It may be considered some kind of a system file and so prevented from an ordinary user's access. You need super posers.....
Bob Roos
Monday, December 26, 2022, 7:25:22 AM, you wrote:
i have a redundant file "Connectors.scad.gAoowr" in the same folder as "Connectors.scad"
i am unable to delete it as it says it dose not exist
it is likely something to do with when i crashed openscad last week while working with "Connectors.scad" creating a circular reference by mistake, any ideas how i can get rid of it
screenshot attached
--
have Fun,
Bob mailto:roosbob@wybatap.com
I suggest posting fully valid code for users who may not realize that
you're using BOSL2 or know what that means. Omitting the include may be
confusing to some.
Yes, the natural way to make a box in OpenSCAD is to make the outside and
subtract the inside. However, your rounding as shown is too big to be
applied to the top edge on both sides. If you're satisfied with decreasing
the rounding and using a rounding of T/4 everywhere, then doing it like
this is reasonable:
include<BOSL2/std.scad>
$fn=32;
T=1.8;
W=53.5;
L=70;
diff()
cuboid(size=[W,L,2T], rounding=T/4)
tag("remove")up(T/2+.01)cuboid([W-T,L-T,1T],rounding=-T/4,edges=TOP);
If you're planning to 3d print this you may want to use the teardrop option
to the outer cuboid, because circular roundings are often problematic
without support.
Note to Jay: BOSL2's cuboid() can round individual edges, but also can
round by groupings, so edges=TOP rounds all the top edges without the need
to enumerate them individually. You can also do edges=TOP, except=RIGHT to
round 3 of the top edges. In additional, cuboid can accept negative values
for the roundings on the top and bottom, which then causes it to produce
roundings that flare out. That negative rounding is needed to address
Bob's problem.
Getting back to the problem at hand, if you really want the larger rounding
on the outside, then I'd suggest taking a look at either rounded_prism() or
offset_sweep() from rounding.scad. I basically wrote offset_sweep for the
purpose of making rounded boxes, and there are several examples showing how
to use it. You can make the outside vertical rounding anything you want
and make the box thickness follow that rounding. See the examples in the
wiki. It may be a little simpler to use rounded_prism, but it only makes
continuous curvature roundings, so you won't be specifying them by radius.
Note that for either of these options, you still make the outside and
subtract the inside, it's just that offset_sweep and rounded_prism can make
a shape with different roundings on different edges with graceful corners
where the roundings meet.
The last approach you could use for this case would be to use the rounding
masks in masks3d---you'd make the outside vertical edges unrounded and then
apply the masks to them---but I think you'll get less pleasing corners
compared to the other options. And to me it seems more complicated than
the other solutions.
On Mon, Dec 26, 2022 at 3:32 AM Bob Roos roosbob@wybatap.com wrote:
Hello Discuss,
T=1.8;
W=53.5;
L=70;
union(){
translate([0,-17,-T/2])rect_tube(size=[W,L],wall=T/2,h=2*T,rounding=T/2);
translate([0,-17,0])cube([W-T,L-T,T],center=true);
}
I want to round the 8 horizontal top edges and the 4 outside horizontal
bottom edges in addition to the already rounded side corners.
The union is there for the convenience of eliminating the generation using
*
I thought about using cuboid with rounding and differencing out the top
part with negative rounding on the top of the difference cuboid
Is there an easier way? I am trying to learn how to think "OpenSCAD"
--
Best regards,
Bob mailto:roosbob@wybatap.com
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Hi Bob,
I ended up using brute force by defining each of the sides. Am curious if there is a better way
T=1.8;
W=53.5;
L=70;
union(){
//translate([0,-17,-T/2])rect_tube(size=[W,L],wall=T/2,h=2T,rounding=T/2);
translate([0,17,T/2]) cuboid([W+T,T,2T],rounding=T/2);
translate([0,-L+17,T/2]) cuboid([W+T,T,2T],rounding=T/2);
translate([W/2,-17-T/2,T/2]) cuboid([T,L+T,2T],rounding=T/2);
translate([-W/2,-17-T/2,T/2]) cuboid([T,L+T,2T],rounding=T/2);
translate([0,-17-T/2,0])cube([W,L,T],center=true);
}
Monday, December 26, 2022, 3:30:35 AM, you wrote:
Hello Discuss,
T=1.8;
W=53.5;
L=70;
union(){
translate([0,-17,-T/2])rect_tube(size=[W,L],wall=T/2,h=2*T,rounding=T/2);
translate([0,-17,0])cube([W-T,L-T,T],center=true);
}
I want to round the 8 horizontal top edges and the 4 outside horizontal bottom edges in addition to the already rounded side corners.
The union is there for the convenience of eliminating the generation using *
I thought about using cuboid with rounding and differencing out the top part with negative rounding on the top of the difference cuboid
Is there an easier way? I am trying to learn how to think "OpenSCAD"
--
have Fun,
Bob mailto:roosbob@wybatap.com
I would do it like this:
include <BOSL2/std.scad>
$fa=4; // min angle
$fs=.3; // min side
draw=true;
ndraw=false;
T=1.8;
W=53.5;
L=70;
%if(ndraw) union(){ // iriginal question
translate([0,-17,-T/2])rect_tube(size=[W,L],wall=T/2,h=2*T,rounding=T/2);
translate([0,-17,0])cube([W-T,L-T,T],center=true);
}
w=(W-T)/2;
l=(L-T)/2;
h=T/2;
if(draw)translate([0,0,h]) {
hull(){ //bottom
translate([ w, l-17,-h]) sphere(d=T);
translate([ w,-l-17,-h]) sphere(d=T);
translate([-w, l-17,-h]) sphere(d=T);
translate([-w,-l-17,-h]) sphere(d=T);
}
hull(){ // +X
translate([ w, l-17, h]) sphere(d=T);
translate([ w,-l-17, h]) sphere(d=T);
translate([ w, l-17,-h]) sphere(d=T);
translate([ w,-l-17,-h]) sphere(d=T);
}
hull(){ // +X
translate([-w, l-17, h]) sphere(d=T);
translate([-w,-l-17, h]) sphere(d=T);
translate([-w, l-17,-h]) sphere(d=T);
translate([-w,-l-17,-h]) sphere(d=T);
}
hull(){ // +Y
translate([ w, l-17, h]) sphere(d=T);
translate([-w, l-17, h]) sphere(d=T);
translate([ w, l-17,-h]) sphere(d=T);
translate([-w, l-17,-h]) sphere(d=T);
}
hull(){ // -Y
translate([ w,-l-17, h]) sphere(d=T);
translate([-w,-l-17, h]) sphere(d=T);
translate([ w,-l-17,-h]) sphere(d=T);
translate([-w,-l-17,-h]) sphere(d=T);
}
}
On Mon, Dec 26, 2022 at 3:31 AM Bob Roos roosbob@wybatap.com wrote:
Hello Discuss,
T=1.8;
W=53.5;
L=70;
union(){
translate([0,-17,-T/2])rect_tube(size=[W,L],wall=T/2,h=2*T,rounding=T/2);
translate([0,-17,0])cube([W-T,L-T,T],center=true);
}
I want to round the 8 horizontal top edges and the 4 outside horizontal
bottom edges in addition to the already rounded side corners.
The union is there for the convenience of eliminating the generation using
*
I thought about using cuboid with rounding and differencing out the top
part with negative rounding on the top of the difference cuboid
Is there an easier way? I am trying to learn how to think "OpenSCAD"
--
Best regards,
Bob mailto:roosbob@wybatap.com
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
That approach looks terrible at the corners because the roundings don't
blend properly. You can fix it by using except options to cuboid to
exclude from rounding the inner corners of each side wall, but the
approaches I posted already are better.
Another thing, if you want to "think OpenSCAD": make your object in a
natural place and then translate the finished object into position. Every
translate has 17 in the Y and T/2 in the Z. Put that outside the union.
Then using right() and left() to position the walls will make the code more
clear.
On Mon, Dec 26, 2022 at 9:17 AM Bob Roos roosbob@wybatap.com wrote:
Hi Bob,
I ended up using brute force by defining each of the sides. Am curious if
there is a better way
T=1.8;
W=53.5;
L=70;
union(){
//translate([0,-17,-T/2])rect_tube(size=[W,L],wall=T/2,h=2T,rounding=T/2);
translate([0,17,T/2]) cuboid([W+T,T,2T],rounding=T/2);
translate([0,-L+17,T/2]) cuboid([W+T,T,2T],rounding=T/2);
translate([W/2,-17-T/2,T/2]) cuboid([T,L+T,2T],rounding=T/2);
translate([-W/2,-17-T/2,T/2]) cuboid([T,L+T,2T],rounding=T/2);
translate([0,-17-T/2,0])cube([W,L,T],center=true);
}
Monday, December 26, 2022, 3:30:35 AM, you wrote:
Hello Discuss,
T=1.8;
W=53.5;
L=70;
union(){
translate([0,-17,-T/2])rect_tube(size=[W,L],wall=T/2,h=2*T,rounding=T/2);
translate([0,-17,0])cube([W-T,L-T,T],center=true);
}
I want to round the 8 horizontal top edges and the 4 outside horizontal
bottom edges in addition to the already rounded side corners.
The union is there for the convenience of eliminating the generation
using *
I thought about using cuboid with rounding and differencing out the top
part with negative rounding on the top of the difference cuboid
Is there an easier way? I am trying to learn how to think "OpenSCAD"
--
have Fun,
Bob mailto:roosbob@wybatap.com
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Yes the corners are spiked, it wouldent take much to dif a sphere from each corner though, there is only 8.I have never had a need to do so as i only rad the edges so thay 3d print better.Like i said, im no openscad expert. I just make cases to box things upSorry.Sent via the Samsung Galaxy S7, an AT&T 4G LTE smartphone
-------- Original message --------From: Adrian Mariano avm4@cornell.edu Date: 12/26/22 2:33 PM (GMT+00:00) To: OpenSCAD general discussion Mailing-list discuss@lists.openscad.org Subject: [OpenSCAD] Re: BOSL2 rounding edges of rect_tube That approach looks terrible at the corners because the roundings don't blend properly. You can fix it by using except options to cuboid to exclude from rounding the inner corners of each side wall, but the approaches I posted already are better. Another thing, if you want to "think OpenSCAD": make your object in a natural place and then translate the finished object into position. Every translate has 17 in the Y and T/2 in the Z. Put that outside the union. Then using right() and left() to position the walls will make the code more clear. On Mon, Dec 26, 2022 at 9:17 AM Bob Roos roosbob@wybatap.com wrote:Hi Bob,
I ended up using brute force by defining each of the sides. Am curious if there is a better way
T=1.8;
W=53.5;
L=70;
union(){
//translate([0,-17,-T/2])rect_tube(size=[W,L],wall=T/2,h=2T,rounding=T/2);
translate([0,17,T/2]) cuboid([W+T,T,2T],rounding=T/2);
translate([0,-L+17,T/2]) cuboid([W+T,T,2T],rounding=T/2);
translate([W/2,-17-T/2,T/2]) cuboid([T,L+T,2T],rounding=T/2);
translate([-W/2,-17-T/2,T/2]) cuboid([T,L+T,2T],rounding=T/2);
translate([0,-17-T/2,0])cube([W,L,T],center=true);
}
Monday, December 26, 2022, 3:30:35 AM, you wrote:
Hello Discuss,
T=1.8;
W=53.5;
L=70;
union(){
translate([0,-17,-T/2])rect_tube(size=[W,L],wall=T/2,h=2*T,rounding=T/2);
translate([0,-17,0])cube([W-T,L-T,T],center=true);
}
I want to round the 8 horizontal top edges and the 4 outside horizontal bottom edges in addition to the already rounded side corners.
The union is there for the convenience of eliminating the generation using *
I thought about using cuboid with rounding and differencing out the top part with negative rounding on the top of the difference cuboid
Is there an easier way? I am trying to learn how to think "OpenSCAD"
--
have Fun,
Bob mailto:roosbob@wybatap.com
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Hi Adrian,
THANK YOU Good point about the include. Thank you for the example it works perfectly for me. I see why you say T/4 because I only made the outer width +T instead of +2*T. There wasn't enough wall thickness to allow T/2 rounding.
I will study your example and dig into the meaning and use of the new to me parameters.
Bob
Monday, December 26, 2022, 9:14:47 AM, you wrote:
I suggest posting fully valid code for users who may not realize that you're using BOSL2 or know what that means. Omitting the include may be confusing to some.
Yes, the natural way to make a box in OpenSCAD is to make the outside and subtract the inside. However, your rounding as shown is too big to be applied to the top edge on both sides. If you're satisfied with decreasing the rounding and using a rounding of T/4 everywhere, then doing it like this is reasonable:
include<BOSL2/std.scad>
$fn=32;
T=1.8;
W=53.5;
L=70;
diff()
cuboid(size=[W,L,2T], rounding=T/4)
tag("remove")up(T/2+.01)cuboid([W-T,L-T,1T],rounding=-T/4,edges=TOP);
If you're planning to 3d print this you may want to use the teardrop option to the outer cuboid, because circular roundings are often problematic without support.
Note to Jay: BOSL2's cuboid() can round individual edges, but also can round by groupings, so edges=TOP rounds all the top edges without the need to enumerate them individually. You can also do edges=TOP, except=RIGHT to round 3 of the top edges. In additional, cuboid can accept negative values for the roundings on the top and bottom, which then causes it to produce roundings that flare out. That negative rounding is needed to address Bob's problem.
Getting back to the problem at hand, if you really want the larger rounding on the outside, then I'd suggest taking a look at either rounded_prism() or offset_sweep() from rounding.scad. I basically wrote offset_sweep for the purpose of making rounded boxes, and there are several examples showing how to use it. You can make the outside vertical rounding anything you want and make the box thickness follow that rounding. See the examples in the wiki. It may be a little simpler to use rounded_prism, but it only makes continuous curvature roundings, so you won't be specifying them by radius. Note that for either of these options, you still make the outside and subtract the inside, it's just that offset_sweep and rounded_prism can make a shape with different roundings on different edges with graceful corners where the roundings meet.
The last approach you could use for this case would be to use the rounding masks in masks3d---you'd make the outside vertical edges unrounded and then apply the masks to them---but I think you'll get less pleasing corners compared to the other options. And to me it seems more complicated than the other solutions.
On Mon, Dec 26, 2022 at 3:32 AM Bob Roos roosbob@wybatap.com wrote:
Hello Discuss,
T=1.8;
W=53.5;
L=70;
union(){
translate([0,-17,-T/2])rect_tube(size=[W,L],wall=T/2,h=2*T,rounding=T/2);
translate([0,-17,0])cube([W-T,L-T,T],center=true);
}
I want to round the 8 horizontal top edges and the 4 outside horizontal bottom edges in addition to the already rounded side corners.
The union is there for the convenience of eliminating the generation using *
I thought about using cuboid with rounding and differencing out the top part with negative rounding on the top of the difference cuboid
Is there an easier way? I am trying to learn how to think "OpenSCAD"
--
have Fun,
Bob mailto:roosbob@wybatap.com
Just type "Ubuntu unlock files" into YouTube and follow the guidelines to open a terminal, su to root, and change that files permissions to 777
On 26 Dec 2022, at 13:27, Bob Roos roosbob@wybatap.com wrote:
Hi Jay,
It could have the "hidden" attribute set. I don't speak your OS so can't offer any advice on checking the attribute. Also notice the little LOCK icon. It may be considered some kind of a system file and so prevented from an ordinary user's access. You need super posers.....
Bob Roos
Monday, December 26, 2022, 7:25:22 AM, you wrote:
i have a redundant file "Connectors.scad.gAoowr" in the same folder as "Connectors.scad"
i am unable to delete it as it says it dose not exist
it is likely something to do with when i crashed openscad last week while working with "Connectors.scad" creating a circular reference by mistake, any ideas how i can get rid of it
screenshot attached
<996473276.png>
--
have Fun,
Bob mailto:roosbob@wybatap.com mailto:roosbob@wybatap.com_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org
Hi Bob,
You can also just use Minkowski, no need for much else, but you need to
make a few calculations, to reduce the 'core size'. Hopefully the
attached script explains the process. I would also extract the radius of
the sphere, not making it dependent on the wall thickness.
From your original info,, It looked more like a shallow tray, so I
included a value for h outside of the calculations, so you may be able
to produce more generic boxes/trays. Minkowski needs something to 'roll
the sphere around', and as it is 3d printing, then a minimum wall of
0.0001 will give no noticeable error for a box. If the rounding radius
was smaller than half the wall thickness, then that could be dispensed
with. I've shown a section at the bottom of the script. Often if you
round off edges, without taking care of the inside corners, it generates
a weak point. It's OK, in this case.
t=1.8;
w=53.5;
l=70;
//h= t*2; //height
h=10;
///////////////////////////////////////////
module box(){ // this has square edges
difference(){
cube([w,l,h],true); // os of box?
translate([0,0,t])
cube([w-t-t,l-t-t,h],true);
}
}
//wanted same size with rounded corners of radius t/2
// make new box, t smaller, and inside t bigger since sphere of
// radius t/2 is 'offset over surface'
module box2(){
difference(){
cube([w-t,l-t,h-t],true);
translate([0,0,t/2+0.0001])
cube([w-t-.0001,l-t-.0001,h],true); //need to give some thickness
}
}
module rounded(){
$fn=90;
minkowski(){
box2();
sphere(r=t/2);
}
}
intersection(){
union(){
rounded();
translate([w+5,0,0]) // compare with box with square corners
box();
}
translate ([0,0,-20])
cube(100);
}
//(remove the intersection and the box() and translate rounded() to
wherever)
On 26/12/2022 15:15, Bob Roos wrote:
Hi Adrian,
THANK YOU Good point about the include. Thank you for the example it
works perfectly for me. I see why you say T/4 because I only made the
outer width +T instead of +2*T. There wasn't enough wall thickness to
allow T/2 rounding.
I will study your example and dig into the meaning and use of the new
to me parameters.
Bob
Monday, December 26, 2022, 9:14:47 AM, you wrote:
I suggest posting fully valid code for users who may not realize
that you're using BOSL2 or know what that means. Omitting the
include may be confusing to some.
Yes, the natural way to make a box in OpenSCAD is to make the
outside and subtract the inside. However, your rounding as shown
is too big to be applied to the top edge on both sides. If you're
satisfied with decreasing the rounding and using a rounding of T/4
everywhere, then doing it like this is reasonable:
include<BOSL2/std.scad>
$fn=32;
T=1.8;
W=53.5;
L=70;
diff()
cuboid(size=[W,L,2*T], rounding=T/4)
tag("remove")up(T/2+.01)cuboid([W-T,L-T,1*T],rounding=-T/4,edges=TOP);
If you're planning to 3d print this you may want to use the
teardrop option to the outer cuboid, because circular roundings
are often problematic without support.
Note to Jay: BOSL2's cuboid() can round individual edges, but
also can round by groupings, so edges=TOP rounds all the top edges
without the need to enumerate them individually. You can also do
edges=TOP, except=RIGHT to round 3 of the top edges. In
additional, cuboid can accept negative values for the roundings on
the top and bottom, which then causes it to produce roundings that
flare out. That negative rounding is needed to address Bob's problem.
Getting back to the problem at hand, if you really want the larger
rounding on the outside, then I'd suggest taking a look at either
rounded_prism() or offset_sweep() from rounding.scad. I
basically wrote offset_sweep for the purpose of making rounded
boxes, and there are several examples showing how to use it. You
can make the outside vertical rounding anything you want and make
the box thickness follow that rounding. See the examples in the
wiki. It may be a little simpler to use rounded_prism, but it
only makes continuous curvature roundings, so you won't be
specifying them by radius. Note that for either of these options,
you still make the outside and subtract the inside, it's just that
offset_sweep and rounded_prism can make a shape with different
roundings on different edges with graceful corners where the
roundings meet.
The last approach you could use for this case would be to use the
rounding masks in masks3d---you'd make the outside vertical edges
unrounded and then apply the masks to them---but I think you'll
get less pleasing corners compared to the other options. And to
me it seems more complicated than the other solutions.
On Mon, Dec 26, 2022 at 3:32 AM Bob Roos <roosbob@wybatap.com> wrote:
Hello Discuss,
T=1.8;
W=53.5;
L=70;
union(){
translate([0,-17,-T/2])rect_tube(size=[W,L],wall=T/2,h=2*T,rounding=T/2);
translate([0,-17,0])cube([W-T,L-T,T],center=true);
}
I want to round the 8 horizontal top edges and the 4 outside
horizontal bottom edges in addition to the already rounded
side corners.
The union is there for the convenience of eliminating the
generation using *
I thought about using cuboid with rounding and differencing
out the top part with negative rounding on the top of the
difference cuboid
Is there an easier way? I am trying to learn how to think
"OpenSCAD"
--
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 mailto:roosbob@wybatap.com
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org