Newbie here, I don't really know how to frame the question, but here goes:
I defined a rib to put on this clamp that I'm making. I had already done
the clamp main body to satisfaction, and I was hoping to add these ribs in
with a union.
module Rib() {
difference (){
cylinder(h = (Clamp_X - 40), d=(Rib_Rad*2), center = true);
translate ([(Rib_Rad/2),0,0]){
cube(([(Rib_Rad2),(Rib_Rad2),(Clamp_X-39)]),center= true);
} // end of translate
} // End of difference !! I expected the scope of the difference to end
here.
} // End of module Rib
difference() {
//-- Main cube
union (){
cube([Clamp_X, 5,0.01],center=true);
translate ([0,(0 - Rib_Rad),0]){rotate (a=[0,90,0]) {Rib();}};
translate ([0,(0 + Rib_Rad),0]){rotate (a=[0,90,0]) {Rib();}};
}; // End of union
// Holes for screws
translate ([Screw1_X,0,-3]) cylinder (r = Screw_Rad, h=Screw_High,center =
false, $fn=45);
translate ([Screw2_X,0,-3]) cylinder (r = Screw_Rad, h=Screw_High,center =
false, $fn=45);
// Recesses for nuts
translate ([Screw1_X,0,Nut_Offset]) cylinder (r = Nut_Rad,
h=Nut_High,center = false, $fn=6);
translate ([Screw2_X,0,Nut_Offset]) cylinder (r = Nut_Rad,
h=Nut_High,center = false, $fn=6);
//-- concave_corners for doing the beveling
bevel(ec1, en1, cr = 10, cres=10, l=size[1]+2);
bevel(ec2, en2, cr = 10, cres=10, l=size[1]+2);
bevel(ec3, en3, cr = 10, cres=10, l=size[0.5]);
bevel(ec4, en4, cr = 10, cres=10, l=size[0.5]);
}
I thought that this would work, and obviously it's not.
It looks like the differencing in the ribs is somehow applying to the body
of the clamp?
Rendering the rib separately, I am getting what I expect.
Hi,
Compiling design (CSG Tree generation)...
WARNING: Ignoring unknown variable 'Clamp_X'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Clamp_X'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Clamp_X'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Clamp_X'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Clamp_X'.
WARNING: Ignoring unknown variable 'Screw1_X'.
WARNING: Ignoring unknown variable 'Screw_Rad'.
WARNING: Ignoring unknown variable 'Screw_High'.
WARNING: Ignoring unknown variable 'Screw2_X'.
WARNING: Ignoring unknown variable 'Screw_Rad'.
WARNING: Ignoring unknown variable 'Screw_High'.
WARNING: Ignoring unknown variable 'Screw1_X'.
WARNING: Ignoring unknown variable 'Nut_Offset'.
WARNING: Ignoring unknown variable 'Nut_Rad'.
WARNING: Ignoring unknown variable 'Nut_High'.
WARNING: Ignoring unknown variable 'Screw2_X'.
WARNING: Ignoring unknown variable 'Nut_Offset'.
WARNING: Ignoring unknown variable 'Nut_Rad'.
WARNING: Ignoring unknown variable 'Nut_High'.
WARNING: Ignoring unknown module 'bevel'.
WARNING: Ignoring unknown module 'bevel'.
WARNING: Ignoring unknown module 'bevel'.
WARNING: Ignoring unknown module 'bevel'.
Compiling design (CSG Products generation)...
Please supply the variables.
Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.
View this message in context: http://forum.openscad.org/Difference-in-a-module-tp11886p11887.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Current state of the project:
//-----------------------------------------------------------------------
//-- Bottom Clamp with Ridges
//-----------------------------------------------------------------------
use <obiscad/bevel.scad>
use <obiscad/attach.scad>
Screw_Dia = 4.60 ; //mm for 8/32 screw
Nut_Flats = 8.50 ; // Measure across the flats.
Nut_Slack = 0.40 ;
Flats_Rad = Nut_Flats/2;
Nut_Rad = ((Flats_Rad / cos(30)) + Nut_Slack); // Correction factor for
size.
Nut_High = 3 ;
Nut_Offset = -3 ;
// Basic dimensions of the part
Clamp_X = 95 ; // mm length
Clamp_Y = 45 ; // mm depth
Clamp_Thick = 5 ; //
Clamp_Size=[Clamp_X,Clamp_Y,Clamp_Thick];
// Define screw last
Screw_Rad = (Screw_Dia/2) ;// mm
Screw_High = (Clamp_Thick + 2) ;// mm We will translate down by 1
Screw_Inset = 13 ; //mm from the ends
// Positions for the two screws
Screw1_X = ( 0 - ((Clamp_X/2) - Screw_Inset));
Screw2_X = (Clamp_X - ((Clamp_X/2) + Screw_Inset));
//-- Define the connectors for beveling the for top edges
//-- Top-right beveling
ec1 = [ [Clamp_Size[0]/2, 0, Clamp_Size[2]/2], [0,1,0], 0];
en1 = [ ec1[0], [1,0,1], 0];
//-- Top-left beveling
ec2 = [ [-Clamp_Size[0]/2, 0, Clamp_Size[2]/2], [0,1,0], 0];
en2 = [ ec2[0], [-1,0,1], 0];
//-- Top-front beveling
ec3 = [ [0, -Clamp_Size[1]/2, Clamp_Size[2]/2], [1,0,0], 0];
en3 = [ ec3[0], [0,-1,1], 0];
//-- Top-back beveling
ec4 = [ [0, Clamp_Size[1]/2, Clamp_Size[2]/2], [1,0,0], 0];
en4 = [ ec4[0], [0,1,1], 0];
// Ribs
Rib_Rad = 2 ;//
module Rib() {
difference (){
cylinder(h = (Clamp_X - 40), d=(Rib_Rad*2), center = true, $fs=60);
translate ([(Rib_Rad/2),0,0]){
cube(([(Rib_Rad2),(Rib_Rad2),(Clamp_X-39)]),center= true);
} // end of translate
} // End of difference
} // End of module Rib
module Screw_Hole(){
cylinder (r = Screw_Rad, h=Screw_High,center = false, $fn=45);
} // End of module
module Nut_Recess(){
cylinder (r = Nut_Rad, h=Nut_High,center = false, $fn=6);
} // End of module
// Add the ribs to the box
module Clamp(){
union (){
cube([Clamp_Size],center = true);
translate ([0,(0 - Rib_Rad),0]){rotate (a=[0,90,0]) {Rib();}};
translate ([0,(0 + Rib_Rad),0]){rotate (a=[0,90,0]) {Rib();}};
}; // End of union
}; // End of module
Clamp();
/*
difference () {
Clamp();
translate ([Screw1_X,0,-3]) Screw_Hole();
translate ([Screw2_X,0,-3]) Screw_Hole();
translate ([Screw1_X,0,Nut_Offset]) Nut_Recess();
translate ([Screw2_X,0,Nut_Offset]) Nut_Recess();
bevel(ec1, en1, cr = 10, cres=10, l=Clamp_Size[1]+2);
bevel(ec2, en2, cr = 10, cres=10, l=Clamp_Size[1]+2);
bevel(ec3, en3, cr = 10, cres=10, l=Clamp_Size[0.5]);
bevel(ec4, en4, cr = 10, cres=10, l=Clamp_Size[0.5]);
} // end of difference
*/
On Wed, Mar 4, 2015 at 6:26 PM, MichaelAtOz oz.at.michael@gmail.com wrote:
Hi,
Compiling design (CSG Tree generation)...
WARNING: Ignoring unknown variable 'Clamp_X'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Clamp_X'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Clamp_X'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Clamp_X'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Clamp_X'.
WARNING: Ignoring unknown variable 'Screw1_X'.
WARNING: Ignoring unknown variable 'Screw_Rad'.
WARNING: Ignoring unknown variable 'Screw_High'.
WARNING: Ignoring unknown variable 'Screw2_X'.
WARNING: Ignoring unknown variable 'Screw_Rad'.
WARNING: Ignoring unknown variable 'Screw_High'.
WARNING: Ignoring unknown variable 'Screw1_X'.
WARNING: Ignoring unknown variable 'Nut_Offset'.
WARNING: Ignoring unknown variable 'Nut_Rad'.
WARNING: Ignoring unknown variable 'Nut_High'.
WARNING: Ignoring unknown variable 'Screw2_X'.
WARNING: Ignoring unknown variable 'Nut_Offset'.
WARNING: Ignoring unknown variable 'Nut_Rad'.
WARNING: Ignoring unknown variable 'Nut_High'.
WARNING: Ignoring unknown module 'bevel'.
WARNING: Ignoring unknown module 'bevel'.
WARNING: Ignoring unknown module 'bevel'.
WARNING: Ignoring unknown module 'bevel'.
Compiling design (CSG Products generation)...
Please supply the variables.
Unless specifically shown otherwise above, my contribution is in the
Public Domain; To the extent possible under law, I have waived all
copyright and related or neighbouring rights to this work. This work is
published globally via the internet. :) Inclusion of works of previous
authors is not included in the above.
View this message in context:
http://forum.openscad.org/Difference-in-a-module-tp11886p11887.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
At this point, I expect the two ribs to be sitting on top of a box that is
a bit larger than the ribs, and about as thick.
I commented out the differencing where I drill the screw holes, add nut
recesses, and bevel the edges.
One problem at a time.
On Wed, Mar 4, 2015 at 6:27 PM, david vanhorn kc6ete@gmail.com wrote:
Current state of the project:
//-----------------------------------------------------------------------
//-- Bottom Clamp with Ridges
//-----------------------------------------------------------------------
use <obiscad/bevel.scad>
use <obiscad/attach.scad>
Screw_Dia = 4.60 ; //mm for 8/32 screw
Nut_Flats = 8.50 ; // Measure across the flats.
Nut_Slack = 0.40 ;
Flats_Rad = Nut_Flats/2;
Nut_Rad = ((Flats_Rad / cos(30)) + Nut_Slack); // Correction factor for
size.
Nut_High = 3 ;
Nut_Offset = -3 ;
// Basic dimensions of the part
Clamp_X = 95 ; // mm length
Clamp_Y = 45 ; // mm depth
Clamp_Thick = 5 ; //
Clamp_Size=[Clamp_X,Clamp_Y,Clamp_Thick];
// Define screw last
Screw_Rad = (Screw_Dia/2) ;// mm
Screw_High = (Clamp_Thick + 2) ;// mm We will translate down by 1
Screw_Inset = 13 ; //mm from the ends
// Positions for the two screws
Screw1_X = ( 0 - ((Clamp_X/2) - Screw_Inset));
Screw2_X = (Clamp_X - ((Clamp_X/2) + Screw_Inset));
//-- Define the connectors for beveling the for top edges
//-- Top-right beveling
ec1 = [ [Clamp_Size[0]/2, 0, Clamp_Size[2]/2], [0,1,0], 0];
en1 = [ ec1[0], [1,0,1], 0];
//-- Top-left beveling
ec2 = [ [-Clamp_Size[0]/2, 0, Clamp_Size[2]/2], [0,1,0], 0];
en2 = [ ec2[0], [-1,0,1], 0];
//-- Top-front beveling
ec3 = [ [0, -Clamp_Size[1]/2, Clamp_Size[2]/2], [1,0,0], 0];
en3 = [ ec3[0], [0,-1,1], 0];
//-- Top-back beveling
ec4 = [ [0, Clamp_Size[1]/2, Clamp_Size[2]/2], [1,0,0], 0];
en4 = [ ec4[0], [0,1,1], 0];
// Ribs
Rib_Rad = 2 ;//
module Rib() {
difference (){
cylinder(h = (Clamp_X - 40), d=(Rib_Rad*2), center = true, $fs=60);
translate ([(Rib_Rad/2),0,0]){
cube(([(Rib_Rad2),(Rib_Rad2),(Clamp_X-39)]),center= true);
} // end of translate
} // End of difference
} // End of module Rib
module Screw_Hole(){
cylinder (r = Screw_Rad, h=Screw_High,center = false, $fn=45);
} // End of module
module Nut_Recess(){
cylinder (r = Nut_Rad, h=Nut_High,center = false, $fn=6);
} // End of module
// Add the ribs to the box
module Clamp(){
union (){
cube([Clamp_Size],center = true);
translate ([0,(0 - Rib_Rad),0]){rotate (a=[0,90,0]) {Rib();}};
translate ([0,(0 + Rib_Rad),0]){rotate (a=[0,90,0]) {Rib();}};
}; // End of union
}; // End of module
Clamp();
/*
difference () {
Clamp();
translate ([Screw1_X,0,-3]) Screw_Hole();
translate ([Screw2_X,0,-3]) Screw_Hole();
translate ([Screw1_X,0,Nut_Offset]) Nut_Recess();
translate ([Screw2_X,0,Nut_Offset]) Nut_Recess();
bevel(ec1, en1, cr = 10, cres=10, l=Clamp_Size[1]+2);
bevel(ec2, en2, cr = 10, cres=10, l=Clamp_Size[1]+2);
bevel(ec3, en3, cr = 10, cres=10, l=Clamp_Size[0.5]);
bevel(ec4, en4, cr = 10, cres=10, l=Clamp_Size[0.5]);
} // end of difference
*/
On Wed, Mar 4, 2015 at 6:26 PM, MichaelAtOz oz.at.michael@gmail.com
wrote:
Hi,
Compiling design (CSG Tree generation)...
WARNING: Ignoring unknown variable 'Clamp_X'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Clamp_X'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Clamp_X'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Clamp_X'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Rib_Rad'.
WARNING: Ignoring unknown variable 'Clamp_X'.
WARNING: Ignoring unknown variable 'Screw1_X'.
WARNING: Ignoring unknown variable 'Screw_Rad'.
WARNING: Ignoring unknown variable 'Screw_High'.
WARNING: Ignoring unknown variable 'Screw2_X'.
WARNING: Ignoring unknown variable 'Screw_Rad'.
WARNING: Ignoring unknown variable 'Screw_High'.
WARNING: Ignoring unknown variable 'Screw1_X'.
WARNING: Ignoring unknown variable 'Nut_Offset'.
WARNING: Ignoring unknown variable 'Nut_Rad'.
WARNING: Ignoring unknown variable 'Nut_High'.
WARNING: Ignoring unknown variable 'Screw2_X'.
WARNING: Ignoring unknown variable 'Nut_Offset'.
WARNING: Ignoring unknown variable 'Nut_Rad'.
WARNING: Ignoring unknown variable 'Nut_High'.
WARNING: Ignoring unknown module 'bevel'.
WARNING: Ignoring unknown module 'bevel'.
WARNING: Ignoring unknown module 'bevel'.
WARNING: Ignoring unknown module 'bevel'.
Compiling design (CSG Products generation)...
Please supply the variables.
Unless specifically shown otherwise above, my contribution is in the
Public Domain; To the extent possible under law, I have waived all
copyright and related or neighbouring rights to this work. This work is
published globally via the internet. :) Inclusion of works of previous
authors is not included in the above.
View this message in context:
http://forum.openscad.org/Difference-in-a-module-tp11886p11887.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
WARNING: Can't open library 'obiscad/bevel.scad'.
WARNING: Can't open library 'obiscad/attach.scad'.
Where can I get those?
Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.
View this message in context: http://forum.openscad.org/Difference-in-a-module-tp11886p11890.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
I think I figured it out.. Thanks.
This is a lot like Povray, but different enough that it keeps tripping me
up.
I found those here: http://www.thingiverse.com/thing:30336
On Wed, Mar 4, 2015 at 6:36 PM, MichaelAtOz oz.at.michael@gmail.com wrote:
WARNING: Can't open library 'obiscad/bevel.scad'.
WARNING: Can't open library 'obiscad/attach.scad'.
Where can I get those?
Unless specifically shown otherwise above, my contribution is in the
Public Domain; To the extent possible under law, I have waived all
copyright and related or neighbouring rights to this work. This work is
published globally via the internet. :) Inclusion of works of previous
authors is not included in the above.
View this message in context:
http://forum.openscad.org/Difference-in-a-module-tp11886p11890.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org