Hello Discuss,
I was trying to learn about diff and relative placement of objects. I thought I had it all working and then the differences stopped showing up on F6
// spool holder
// Bob Roos
// March 11, 2022, revised March 29, 2023
$fn = 48;
include <BOSL2/std.scad> // or screws or threading
// bearing
BOD = 22;
BID = 7.8;
BW = 7;
FF = 1; // fudge factor
// material
FF2 = 2FF;
T = 1.8;
D = BID + 2;
W = 2T+BW;
L = 1.5*BOD;
H = BOD + T;
// relation of parts
Sep = 105;
Sepw = 82;
module BearingBlock (sep,w,l,h,bod,bid,bw,ff){
diff(){
tag("keep") cuboid([w,l,h],rounding=1,anchor=BOTTOM) // basic block shape
#up(4) tag("remove") xcyl(h=bw+ff,d=bod+ff,anchor=CENTER) // remove bearing space
#down(.5)tag("remove") xcyl(h=w+ff,d=bid+ff,anchor=CENTER) // leave room for axle hole
#up(bod/4) tag("remove")cuboid([bw+1ff,bod+2ff,h/2],anchor=CENTER); // remove part above for lift out
}
}
module BlockSide (sep,w,l,h,bod,bid,bw,ff){
BearingBlock(sep,w,l,h,bod,bid,bw,ff);
translate([0,sep/2,0]) cuboid([w,sep-bod,2*ff],rounding=.75,anchor=BOTTOM);
translate([0,sep,0]) BearingBlock(sep,w,l,h,bod,bid,bw,ff);
}
module CrossPiece (sep,w,l,h,bod,bid,bw,ff){
cuboid([sep,w,ff],rounding=.5,anchor=BOTTOM);
}
// build the 4 support blocks and connecting piece
difference(){
union(){
tag("keep") BlockSide(sep=Sep,w=W,l=L,h=H,bod=BOD,bid=BID,bw=BW,ff=FF); // one side
tag("keep")translate([Sepw,0,0]) BlockSide(sep=Sep,w=W,l=L,h=H,bod=BOD,bid=BID,bw=BW,ff=FF); // other side
}
#tag("remove")back(Sep/2) cyl(d=4,h=4T,anchor=CENTER); // screw hole
#tag("remove")back(Sep/2)right(Sepw) cyl(d=4,h=4T,anchor=CENTER); // screw hole
}
// cross members
translate([Sepw/2,Sep/5,0]) CrossPiece(sep=Sepw,w=W,l=L,h=H,bod=BOD,bid=BID,bw=BW,ff=FF); // one cross
translate([Sepw/2,4*Sep/5,0]) CrossPiece(sep=Sepw,w=W,l=L,h=H,bod=BOD,bid=BID,bw=BW,ff=FF); // other cross
--
Best regards,
Bob mailto:roosbob@wybatap.com
The result from F5 and F6 is the same. It looks like your problem is that
you tagged something with "keep" and are now wondering why that object was
kept. If you use the keep tag it means the object will not be affected by
any remove operations. I believe that if you just delete that tag you get
the result that you want.
If you have any thoughts in how the manual could me made more clear about
this, let me know.
On Thu, Mar 30, 2023 at 10:08 PM Bob Roos roosbob@wybatap.com wrote:
Hello Discuss,
I was trying to learn about diff and relative placement of objects. I
thought I had it all working and then the differences stopped showing up on
F6
// spool holder
// Bob Roos
// March 11, 2022, revised March 29, 2023
$fn = 48;
include <BOSL2/std.scad> // or screws or threading
// bearing
BOD = 22;
BID = 7.8;
BW = 7;
FF = 1; // fudge factor
// material
FF2 = 2FF;
T = 1.8;
D = BID + 2;
W = 2T+BW;
L = 1.5*BOD;
H = BOD + T;
// relation of parts
Sep = 105;
Sepw = 82;
module BearingBlock (sep,w,l,h,bod,bid,bw,ff){
diff(){
tag("keep") cuboid([w,l,h],rounding=1,anchor=BOTTOM)
// basic block shape
#up(4) tag("remove") xcyl(h=bw+ff,d=bod+ff,anchor=CENTER) //
remove bearing space
#down(.5)tag("remove") xcyl(h=w+ff,d=bid+ff,anchor=CENTER) //
leave room for axle hole
#up(bod/4)
tag("remove")cuboid([bw+1ff,bod+2ff,h/2],anchor=CENTER); // remove part
above for lift out
}
}
module BlockSide (sep,w,l,h,bod,bid,bw,ff){
BearingBlock(sep,w,l,h,bod,bid,bw,ff);
translate([0,sep/2,0])
cuboid([w,sep-bod,2*ff],rounding=.75,anchor=BOTTOM);
translate([0,sep,0]) BearingBlock(sep,w,l,h,bod,bid,bw,ff);
}
module CrossPiece (sep,w,l,h,bod,bid,bw,ff){
cuboid([sep,w,ff],rounding=.5,anchor=BOTTOM);
}
// build the 4 support blocks and connecting piece
difference(){
union(){
tag("keep")
BlockSide(sep=Sep,w=W,l=L,h=H,bod=BOD,bid=BID,bw=BW,ff=FF); // one side
tag("keep")translate([Sepw,0,0])
BlockSide(sep=Sep,w=W,l=L,h=H,bod=BOD,bid=BID,bw=BW,ff=FF); // other side
}
#tag("remove")back(Sep/2) cyl(d=4,h=4T,anchor=CENTER); //
screw hole
#tag("remove")back(Sep/2)right(Sepw) cyl(d=4,h=4T,anchor=CENTER); //
screw hole
}
// cross members
translate([Sepw/2,Sep/5,0])
CrossPiece(sep=Sepw,w=W,l=L,h=H,bod=BOD,bid=BID,bw=BW,ff=FF); // one cross
translate([Sepw/2,4*Sep/5,0])
CrossPiece(sep=Sepw,w=W,l=L,h=H,bod=BOD,bid=BID,bw=BW,ff=FF); // other
cross
--
Best regards,
Bob mailto:roosbob@wybatap.com
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Hi Adrian,
Thank you. The tags were left over from trying "diff" instead of difference. When that gave the same results with and without "keep" I gave up and used difference not realizing that the tags would go deeper into the assembly and affect sub parts. Removing the tags did indeed solve the problem.
I still don't fully understand "children". I will continue reading on that.
Thanks again, Bob Roos
Friday, March 31, 2023, 7:34:58 AM, you wrote:
The result from F5 and F6 is the same. It looks like your problem is that you tagged something with "keep" and are now wondering why that object was kept. If you use the keep tag it means the object will not be affected by any remove operations. I believe that if you just delete that tag you get the result that you want.
If you have any thoughts in how the manual could me made more clear about this, let me know.
On Thu, Mar 30, 2023 at 10:08 PM Bob Roos roosbob@wybatap.com wrote:
Hello Discuss,
I was trying to learn about diff and relative placement of objects. I thought I had it all working and then the differences stopped showing up on F6
// spool holder
// Bob Roos
// March 11, 2022, revised March 29, 2023
$fn = 48;
include <BOSL2/std.scad> // or screws or threading
// bearing
BOD = 22;
BID = 7.8;
BW = 7;
FF = 1; // fudge factor
// material
FF2 = 2FF;
T = 1.8;
D = BID + 2;
W = 2T+BW;
L = 1.5*BOD;
H = BOD + T;
// relation of parts
Sep = 105;
Sepw = 82;
module BearingBlock (sep,w,l,h,bod,bid,bw,ff){
diff(){
tag("keep") cuboid([w,l,h],rounding=1,anchor=BOTTOM) // basic block shape
#up(4) tag("remove") xcyl(h=bw+ff,d=bod+ff,anchor=CENTER) // remove bearing space
#down(.5)tag("remove") xcyl(h=w+ff,d=bid+ff,anchor=CENTER) // leave room for axle hole
#up(bod/4) tag("remove")cuboid([bw+1ff,bod+2ff,h/2],anchor=CENTER); // remove part above for lift out
}
}
module BlockSide (sep,w,l,h,bod,bid,bw,ff){
BearingBlock(sep,w,l,h,bod,bid,bw,ff);
translate([0,sep/2,0]) cuboid([w,sep-bod,2*ff],rounding=.75,anchor=BOTTOM);
translate([0,sep,0]) BearingBlock(sep,w,l,h,bod,bid,bw,ff);
}
module CrossPiece (sep,w,l,h,bod,bid,bw,ff){
cuboid([sep,w,ff],rounding=.5,anchor=BOTTOM);
}
// build the 4 support blocks and connecting piece
difference(){
union(){
tag("keep") BlockSide(sep=Sep,w=W,l=L,h=H,bod=BOD,bid=BID,bw=BW,ff=FF); // one side
tag("keep")translate([Sepw,0,0]) BlockSide(sep=Sep,w=W,l=L,h=H,bod=BOD,bid=BID,bw=BW,ff=FF); // other side
}
#tag("remove")back(Sep/2) cyl(d=4,h=4T,anchor=CENTER); // screw hole
#tag("remove")back(Sep/2)right(Sepw) cyl(d=4,h=4T,anchor=CENTER); // screw hole
}
// cross members
translate([Sepw/2,Sep/5,0]) CrossPiece(sep=Sepw,w=W,l=L,h=H,bod=BOD,bid=BID,bw=BW,ff=FF); // one cross
translate([Sepw/2,4*Sep/5,0]) CrossPiece(sep=Sepw,w=W,l=L,h=H,bod=BOD,bid=BID,bw=BW,ff=FF); // other cross
--
have Fun,
Bob mailto:roosbob@wybatap.com