T
Terry
Sat, Feb 19, 2022 4:15 PM
As recommended I'm using modules as much as possible. I'd welcome any general
critiques of this one (syntax, method, formatting, anything). But in particular
why is it that my code seems to work OK, despite the two console errors "Too
many unnamed arguments... What is wrong with those please?
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, $fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, true, $fn); // ERROR? <-----------------------------
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2t, d2-2t, true, $fn); // ERROR? <-----------------
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
https://www.dropbox.com/s/jmfgtbbl48xrzc0/HollowConeError.jpg?raw=1
Terry
As recommended I'm using modules as much as possible. I'd welcome any general
critiques of this one (syntax, method, formatting, anything). But in particular
why is it that my code seems to work OK, despite the two console errors "Too
many unnamed arguments... What is wrong with those please?
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, $fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, true, $fn); // ERROR? <-----------------------------
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2*t, d2-2*t, true, $fn); // ERROR? <-----------------
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
https://www.dropbox.com/s/jmfgtbbl48xrzc0/HollowConeError.jpg?raw=1
Terry
DP
David Phillip Oster
Sat, Feb 19, 2022 4:22 PM
The easy solution is to always use named arguments
cylinder(h=h, d1=d1, d2=d2, $fn);
cylinder(h=h+.01, d1=d1-2t, d2=d2-2t, $fn);
On Sat, Feb 19, 2022 at 11:16 AM Terry terrypingm@gmail.com wrote:
As recommended I'm using modules as much as possible. I'd welcome any
general
critiques of this one (syntax, method, formatting, anything). But in
particular
why is it that my code seems to work OK, despite the two console errors
"Too
many unnamed arguments... What is wrong with those please?
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, $fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, true, $fn); // ERROR?
<-----------------------------
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2t, d2-2t, true, $fn); // ERROR?
<-----------------
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
https://www.dropbox.com/s/jmfgtbbl48xrzc0/HollowConeError.jpg?raw=1
Terry
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
The easy solution is to always use named arguments
cylinder(h=h, d1=d1, d2=d2, $fn);
cylinder(h=h+.01, d1=d1-2*t, d2=d2-2*t, $fn);
On Sat, Feb 19, 2022 at 11:16 AM Terry <terrypingm@gmail.com> wrote:
> As recommended I'm using modules as much as possible. I'd welcome any
> general
> critiques of this one (syntax, method, formatting, anything). But in
> particular
> why is it that my code seems to work OK, despite the two console errors
> "Too
> many unnamed arguments... What is wrong with those please?
>
> // Creates a hollow partial cone
>
> // Height = h
> // Bottom diam = d1
> // Top diam = d2
> // center = true/false or 1/0; almost always use true
> // $fn = typically 24 for control knob
> // Thickness = t (same throughout)
>
> module hollowCyl_Full(h, d1, d2, center, $fn, t) {
>
> difference() {
> // Larger diam, from which a difference is needed
> cylinder(h, d1, d2, true, $fn); // ERROR?
> <-----------------------------
>
> // Remove smaller diam, but higher, protruding at both ends
> cylinder(h+.01, d1-2*t, d2-2*t, true, $fn); // ERROR?
> <-----------------
> }
> }
>
> // EXAMPLE
> hollowCyl_Full(9, 36, 28, true, 24, 1);
>
> https://www.dropbox.com/s/jmfgtbbl48xrzc0/HollowConeError.jpg?raw=1
>
> Terry
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
SP
Sanjeev Prabhakar
Sat, Feb 19, 2022 4:31 PM
I have made few changes and it works now in my system
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, center=center, $fn=fn); // ERROR?
<-----------------------------
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2t, d2-2t, center=center, $fn=fn); // ERROR?
<-----------------
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
On Sat, 19 Feb 2022 at 21:46, Terry terrypingm@gmail.com wrote:
As recommended I'm using modules as much as possible. I'd welcome any
general
critiques of this one (syntax, method, formatting, anything). But in
particular
why is it that my code seems to work OK, despite the two console errors
"Too
many unnamed arguments... What is wrong with those please?
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, $fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, true, $fn); // ERROR?
<-----------------------------
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2t, d2-2t, true, $fn); // ERROR?
<-----------------
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
https://www.dropbox.com/s/jmfgtbbl48xrzc0/HollowConeError.jpg?raw=1
Terry
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I have made few changes and it works now in my system
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, center=center, $fn=fn); // ERROR?
<-----------------------------
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2*t, d2-2*t, center=center, $fn=fn); // ERROR?
<-----------------
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
On Sat, 19 Feb 2022 at 21:46, Terry <terrypingm@gmail.com> wrote:
> As recommended I'm using modules as much as possible. I'd welcome any
> general
> critiques of this one (syntax, method, formatting, anything). But in
> particular
> why is it that my code seems to work OK, despite the two console errors
> "Too
> many unnamed arguments... What is wrong with those please?
>
> // Creates a hollow partial cone
>
> // Height = h
> // Bottom diam = d1
> // Top diam = d2
> // center = true/false or 1/0; almost always use true
> // $fn = typically 24 for control knob
> // Thickness = t (same throughout)
>
> module hollowCyl_Full(h, d1, d2, center, $fn, t) {
>
> difference() {
> // Larger diam, from which a difference is needed
> cylinder(h, d1, d2, true, $fn); // ERROR?
> <-----------------------------
>
> // Remove smaller diam, but higher, protruding at both ends
> cylinder(h+.01, d1-2*t, d2-2*t, true, $fn); // ERROR?
> <-----------------
> }
> }
>
> // EXAMPLE
> hollowCyl_Full(9, 36, 28, true, 24, 1);
>
> https://www.dropbox.com/s/jmfgtbbl48xrzc0/HollowConeError.jpg?raw=1
>
> Terry
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
T
Terry
Sat, Feb 19, 2022 5:17 PM
Thanks both, appreciate the fast responses.
Sanjeev: Works fine and no errors!
Dave: No errors, but it did not give me the same result. Probably my mistake.
Here's my revised code which I thought used your corrections?
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, $fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h=h, d1=d1, d2=d2, $fn);
// Remove smaller diam, but higher, protruding at both ends
cylinder(h=h+.01, d1=d1-2t, d2=d2-2t, $fn);
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
====================
On Sat, 19 Feb 2022 22:01:27 +0530, you wrote:
I have made few changes and it works now in my system
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, center=center, $fn=fn); // ERROR?
<-----------------------------
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2t, d2-2t, center=center, $fn=fn); // ERROR?
<-----------------
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
On Sat, 19 Feb 2022 at 21:46, Terry terrypingm@gmail.com wrote:
As recommended I'm using modules as much as possible. I'd welcome any
general
critiques of this one (syntax, method, formatting, anything). But in
particular
why is it that my code seems to work OK, despite the two console errors
"Too
many unnamed arguments... What is wrong with those please?
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, $fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, true, $fn); // ERROR?
<-----------------------------
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2t, d2-2t, true, $fn); // ERROR?
<-----------------
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
https://www.dropbox.com/s/jmfgtbbl48xrzc0/HollowConeError.jpg?raw=1
Terry
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Thanks both, appreciate the fast responses.
Sanjeev: Works fine and no errors!
Dave: No errors, but it did not give me the same result. Probably my mistake.
Here's my revised code which I thought used your corrections?
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, $fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h=h, d1=d1, d2=d2, $fn);
// Remove smaller diam, but higher, protruding at both ends
cylinder(h=h+.01, d1=d1-2*t, d2=d2-2*t, $fn);
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
====================
On Sat, 19 Feb 2022 22:01:27 +0530, you wrote:
>I have made few changes and it works now in my system
>
>// Creates a hollow partial cone
>
>// Height = h
>// Bottom diam = d1
>// Top diam = d2
>// center = true/false or 1/0; almost always use true
>// $fn = typically 24 for control knob
>// Thickness = t (same throughout)
>
>module hollowCyl_Full(h, d1, d2, center, fn, t) {
>
>difference() {
>// Larger diam, from which a difference is needed
> cylinder(h, d1, d2, center=center, $fn=fn); // ERROR?
><-----------------------------
>
>// Remove smaller diam, but higher, protruding at both ends
> cylinder(h+.01, d1-2*t, d2-2*t, center=center, $fn=fn); // ERROR?
><-----------------
> }
>}
>
>// EXAMPLE
>hollowCyl_Full(9, 36, 28, true, 24, 1);
>
>On Sat, 19 Feb 2022 at 21:46, Terry <terrypingm@gmail.com> wrote:
>
>> As recommended I'm using modules as much as possible. I'd welcome any
>> general
>> critiques of this one (syntax, method, formatting, anything). But in
>> particular
>> why is it that my code seems to work OK, despite the two console errors
>> "Too
>> many unnamed arguments... What is wrong with those please?
>>
>> // Creates a hollow partial cone
>>
>> // Height = h
>> // Bottom diam = d1
>> // Top diam = d2
>> // center = true/false or 1/0; almost always use true
>> // $fn = typically 24 for control knob
>> // Thickness = t (same throughout)
>>
>> module hollowCyl_Full(h, d1, d2, center, $fn, t) {
>>
>> difference() {
>> // Larger diam, from which a difference is needed
>> cylinder(h, d1, d2, true, $fn); // ERROR?
>> <-----------------------------
>>
>> // Remove smaller diam, but higher, protruding at both ends
>> cylinder(h+.01, d1-2*t, d2-2*t, true, $fn); // ERROR?
>> <-----------------
>> }
>> }
>>
>> // EXAMPLE
>> hollowCyl_Full(9, 36, 28, true, 24, 1);
>>
>> https://www.dropbox.com/s/jmfgtbbl48xrzc0/HollowConeError.jpg?raw=1
>>
>> Terry
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>
DP
David Phillip Oster
Sat, Feb 19, 2022 5:51 PM
the difference needs a translate down so you don't have colliding planes:
// Remove smaller diam, but higher, protruding at both ends
translate([0,0,-0.01])cylinder(h=h+.02, d1=d1-2t, d2=d2-2t, $fn);
On Sat, Feb 19, 2022 at 12:17 PM Terry terrypingm@gmail.com wrote:
Thanks both, appreciate the fast responses.
Sanjeev: Works fine and no errors!
Dave: No errors, but it did not give me the same result. Probably my
mistake.
Here's my revised code which I thought used your corrections?
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, $fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h=h, d1=d1, d2=d2, $fn);
// Remove smaller diam, but higher, protruding at both ends
cylinder(h=h+.01, d1=d1-2t, d2=d2-2t, $fn);
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
====================
On Sat, 19 Feb 2022 22:01:27 +0530, you wrote:
I have made few changes and it works now in my system
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, center=center, $fn=fn); // ERROR?
<-----------------------------
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2t, d2-2t, center=center, $fn=fn); // ERROR?
<-----------------
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
On Sat, 19 Feb 2022 at 21:46, Terry terrypingm@gmail.com wrote:
As recommended I'm using modules as much as possible. I'd welcome any
general
critiques of this one (syntax, method, formatting, anything). But in
particular
why is it that my code seems to work OK, despite the two console errors
"Too
many unnamed arguments... What is wrong with those please?
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, $fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, true, $fn); // ERROR?
<-----------------------------
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2t, d2-2t, true, $fn); // ERROR?
<-----------------
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
https://www.dropbox.com/s/jmfgtbbl48xrzc0/HollowConeError.jpg?raw=1
Terry
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
the difference needs a translate down so you don't have colliding planes:
// Remove smaller diam, but higher, protruding at both ends
translate([0,0,-0.01])cylinder(h=h+.02, d1=d1-2*t, d2=d2-2*t, $fn);
On Sat, Feb 19, 2022 at 12:17 PM Terry <terrypingm@gmail.com> wrote:
> Thanks both, appreciate the fast responses.
>
> Sanjeev: Works fine and no errors!
>
> Dave: No errors, but it did not give me the same result. Probably my
> mistake.
> Here's my revised code which I thought used your corrections?
>
> // Creates a hollow partial cone
>
> // Height = h
> // Bottom diam = d1
> // Top diam = d2
> // center = true/false or 1/0; almost always use true
> // $fn = typically 24 for control knob
> // Thickness = t (same throughout)
>
> module hollowCyl_Full(h, d1, d2, center, $fn, t) {
>
> difference() {
> // Larger diam, from which a difference is needed
> cylinder(h=h, d1=d1, d2=d2, $fn);
>
> // Remove smaller diam, but higher, protruding at both ends
> cylinder(h=h+.01, d1=d1-2*t, d2=d2-2*t, $fn);
> }
> }
>
> // EXAMPLE
> hollowCyl_Full(9, 36, 28, true, 24, 1);
>
>
> ====================
>
>
> On Sat, 19 Feb 2022 22:01:27 +0530, you wrote:
>
> >I have made few changes and it works now in my system
> >
> >// Creates a hollow partial cone
> >
> >// Height = h
> >// Bottom diam = d1
> >// Top diam = d2
> >// center = true/false or 1/0; almost always use true
> >// $fn = typically 24 for control knob
> >// Thickness = t (same throughout)
> >
> >module hollowCyl_Full(h, d1, d2, center, fn, t) {
> >
> >difference() {
> >// Larger diam, from which a difference is needed
> > cylinder(h, d1, d2, center=center, $fn=fn); // ERROR?
> ><-----------------------------
> >
> >// Remove smaller diam, but higher, protruding at both ends
> > cylinder(h+.01, d1-2*t, d2-2*t, center=center, $fn=fn); // ERROR?
> ><-----------------
> > }
> >}
> >
> >// EXAMPLE
> >hollowCyl_Full(9, 36, 28, true, 24, 1);
> >
> >On Sat, 19 Feb 2022 at 21:46, Terry <terrypingm@gmail.com> wrote:
> >
> >> As recommended I'm using modules as much as possible. I'd welcome any
> >> general
> >> critiques of this one (syntax, method, formatting, anything). But in
> >> particular
> >> why is it that my code seems to work OK, despite the two console errors
> >> "Too
> >> many unnamed arguments... What is wrong with those please?
> >>
> >> // Creates a hollow partial cone
> >>
> >> // Height = h
> >> // Bottom diam = d1
> >> // Top diam = d2
> >> // center = true/false or 1/0; almost always use true
> >> // $fn = typically 24 for control knob
> >> // Thickness = t (same throughout)
> >>
> >> module hollowCyl_Full(h, d1, d2, center, $fn, t) {
> >>
> >> difference() {
> >> // Larger diam, from which a difference is needed
> >> cylinder(h, d1, d2, true, $fn); // ERROR?
> >> <-----------------------------
> >>
> >> // Remove smaller diam, but higher, protruding at both ends
> >> cylinder(h+.01, d1-2*t, d2-2*t, true, $fn); // ERROR?
> >> <-----------------
> >> }
> >> }
> >>
> >> // EXAMPLE
> >> hollowCyl_Full(9, 36, 28, true, 24, 1);
> >>
> >> https://www.dropbox.com/s/jmfgtbbl48xrzc0/HollowConeError.jpg?raw=1
> >>
> >> Terry
> >> _______________________________________________
> >> OpenSCAD mailing list
> >> To unsubscribe send an email to discuss-leave@lists.openscad.org
> >>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
T
Terry
Sat, Feb 19, 2022 6:40 PM
I allowed for that with my h+0.01.
I think the problem arises because of your
h=h
and
h=h+.01
Terry
====================
On Sat, 19 Feb 2022 12:51:26 -0500, you wrote:
the difference needs a translate down so you don't have colliding planes:
// Remove smaller diam, but higher, protruding at both ends
translate([0,0,-0.01])cylinder(h=h+.02, d1=d1-2t, d2=d2-2t, $fn);
On Sat, Feb 19, 2022 at 12:17 PM Terry terrypingm@gmail.com wrote:
Thanks both, appreciate the fast responses.
Sanjeev: Works fine and no errors!
Dave: No errors, but it did not give me the same result. Probably my
mistake.
Here's my revised code which I thought used your corrections?
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, $fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h=h, d1=d1, d2=d2, $fn);
// Remove smaller diam, but higher, protruding at both ends
cylinder(h=h+.01, d1=d1-2t, d2=d2-2t, $fn);
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
====================
On Sat, 19 Feb 2022 22:01:27 +0530, you wrote:
I have made few changes and it works now in my system
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, center=center, $fn=fn); // ERROR?
<-----------------------------
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2t, d2-2t, center=center, $fn=fn); // ERROR?
<-----------------
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
On Sat, 19 Feb 2022 at 21:46, Terry terrypingm@gmail.com wrote:
As recommended I'm using modules as much as possible. I'd welcome any
general
critiques of this one (syntax, method, formatting, anything). But in
particular
why is it that my code seems to work OK, despite the two console errors
"Too
many unnamed arguments... What is wrong with those please?
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, $fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, true, $fn); // ERROR?
<-----------------------------
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2t, d2-2t, true, $fn); // ERROR?
<-----------------
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
https://www.dropbox.com/s/jmfgtbbl48xrzc0/HollowConeError.jpg?raw=1
Terry
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I allowed for that with my h+0.01.
I think the problem arises because of your
h=h
and
h=h+.01
Terry
====================
On Sat, 19 Feb 2022 12:51:26 -0500, you wrote:
>the difference needs a translate down so you don't have colliding planes:
>
>// Remove smaller diam, but higher, protruding at both ends
> translate([0,0,-0.01])cylinder(h=h+.02, d1=d1-2*t, d2=d2-2*t, $fn);
>
>On Sat, Feb 19, 2022 at 12:17 PM Terry <terrypingm@gmail.com> wrote:
>
>> Thanks both, appreciate the fast responses.
>>
>> Sanjeev: Works fine and no errors!
>>
>> Dave: No errors, but it did not give me the same result. Probably my
>> mistake.
>> Here's my revised code which I thought used your corrections?
>>
>> // Creates a hollow partial cone
>>
>> // Height = h
>> // Bottom diam = d1
>> // Top diam = d2
>> // center = true/false or 1/0; almost always use true
>> // $fn = typically 24 for control knob
>> // Thickness = t (same throughout)
>>
>> module hollowCyl_Full(h, d1, d2, center, $fn, t) {
>>
>> difference() {
>> // Larger diam, from which a difference is needed
>> cylinder(h=h, d1=d1, d2=d2, $fn);
>>
>> // Remove smaller diam, but higher, protruding at both ends
>> cylinder(h=h+.01, d1=d1-2*t, d2=d2-2*t, $fn);
>> }
>> }
>>
>> // EXAMPLE
>> hollowCyl_Full(9, 36, 28, true, 24, 1);
>>
>>
>> ====================
>>
>>
>> On Sat, 19 Feb 2022 22:01:27 +0530, you wrote:
>>
>> >I have made few changes and it works now in my system
>> >
>> >// Creates a hollow partial cone
>> >
>> >// Height = h
>> >// Bottom diam = d1
>> >// Top diam = d2
>> >// center = true/false or 1/0; almost always use true
>> >// $fn = typically 24 for control knob
>> >// Thickness = t (same throughout)
>> >
>> >module hollowCyl_Full(h, d1, d2, center, fn, t) {
>> >
>> >difference() {
>> >// Larger diam, from which a difference is needed
>> > cylinder(h, d1, d2, center=center, $fn=fn); // ERROR?
>> ><-----------------------------
>> >
>> >// Remove smaller diam, but higher, protruding at both ends
>> > cylinder(h+.01, d1-2*t, d2-2*t, center=center, $fn=fn); // ERROR?
>> ><-----------------
>> > }
>> >}
>> >
>> >// EXAMPLE
>> >hollowCyl_Full(9, 36, 28, true, 24, 1);
>> >
>> >On Sat, 19 Feb 2022 at 21:46, Terry <terrypingm@gmail.com> wrote:
>> >
>> >> As recommended I'm using modules as much as possible. I'd welcome any
>> >> general
>> >> critiques of this one (syntax, method, formatting, anything). But in
>> >> particular
>> >> why is it that my code seems to work OK, despite the two console errors
>> >> "Too
>> >> many unnamed arguments... What is wrong with those please?
>> >>
>> >> // Creates a hollow partial cone
>> >>
>> >> // Height = h
>> >> // Bottom diam = d1
>> >> // Top diam = d2
>> >> // center = true/false or 1/0; almost always use true
>> >> // $fn = typically 24 for control knob
>> >> // Thickness = t (same throughout)
>> >>
>> >> module hollowCyl_Full(h, d1, d2, center, $fn, t) {
>> >>
>> >> difference() {
>> >> // Larger diam, from which a difference is needed
>> >> cylinder(h, d1, d2, true, $fn); // ERROR?
>> >> <-----------------------------
>> >>
>> >> // Remove smaller diam, but higher, protruding at both ends
>> >> cylinder(h+.01, d1-2*t, d2-2*t, true, $fn); // ERROR?
>> >> <-----------------
>> >> }
>> >> }
>> >>
>> >> // EXAMPLE
>> >> hollowCyl_Full(9, 36, 28, true, 24, 1);
>> >>
>> >> https://www.dropbox.com/s/jmfgtbbl48xrzc0/HollowConeError.jpg?raw=1
>> >>
>> >> Terry
>> >> _______________________________________________
>> >> OpenSCAD mailing list
>> >> To unsubscribe send an email to discuss-leave@lists.openscad.org
>> >>
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>
DM
Douglas Miller
Sat, Feb 19, 2022 6:51 PM
This will render far, far faster, especially at higher values of $fn:
rotate_extrude() polygon([[d1/2 - t,0], [d1/2,0], [d2/2,h], [d2/2 - t,h]]);
On 2/19/2022 11:15 AM, Terry wrote:
As recommended I'm using modules as much as possible. I'd welcome any general
critiques of this one (syntax, method, formatting, anything). But in particular
why is it that my code seems to work OK, despite the two console errors "Too
many unnamed arguments... What is wrong with those please?
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, $fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, true, $fn); // ERROR? <-----------------------------
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2t, d2-2t, true, $fn); // ERROR? <-----------------
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
https://www.dropbox.com/s/jmfgtbbl48xrzc0/HollowConeError.jpg?raw=1
Terry
This will render far, far faster, especially at higher values of $fn:
rotate_extrude() polygon([[d1/2 - t,0], [d1/2,0], [d2/2,h], [d2/2 - t,h]]);
On 2/19/2022 11:15 AM, Terry wrote:
> As recommended I'm using modules as much as possible. I'd welcome any general
> critiques of this one (syntax, method, formatting, anything). But in particular
> why is it that my code seems to work OK, despite the two console errors "Too
> many unnamed arguments... What is wrong with those please?
>
> // Creates a hollow partial cone
>
> // Height = h
> // Bottom diam = d1
> // Top diam = d2
> // center = true/false or 1/0; almost always use true
> // $fn = typically 24 for control knob
> // Thickness = t (same throughout)
>
> module hollowCyl_Full(h, d1, d2, center, $fn, t) {
>
> difference() {
> // Larger diam, from which a difference is needed
> cylinder(h, d1, d2, true, $fn); // ERROR? <-----------------------------
>
> // Remove smaller diam, but higher, protruding at both ends
> cylinder(h+.01, d1-2*t, d2-2*t, true, $fn); // ERROR? <-----------------
> }
> }
>
> // EXAMPLE
> hollowCyl_Full(9, 36, 28, true, 24, 1);
>
> https://www.dropbox.com/s/jmfgtbbl48xrzc0/HollowConeError.jpg?raw=1
>
> Terry
RW
Rogier Wolff
Sat, Feb 19, 2022 8:21 PM
On Sat, Feb 19, 2022 at 06:40:43PM +0000, Terry wrote:
I allowed for that with my h+0.01.
No you didn't. You elevated the top surface of the subtracted cylinder
by 0.01, so that doesn't clash with the subtracted-from cylinder's top
surface. But both bottom surfaces are still at precisely 0.000.
I think the problem arises because of your
h=h
and
h=h+.01
You're thinking that does something funny because "h may be modified by
h=h+.01" ? That's not the case,
OpenScad allows variable-looking things to have the same name, but in
fact they are different variable-looking-things.
In
cylinder(h=h+.02, d1=d1-2t, d2=d2-2t, $fn);
The first "h" is "the cylinder parameter called h". and the second one
is the "local variable called h". Those are entirely different things
and could have WILDLY different values.
Nothing funny happens when you know what's going on. Feel free to do
pipe (dd, hh, t)
{
difference () {
cylinder (d=dd+2*t, h=hh, center=true);
cylinder (d=dd, h=hh+.2, center=true);
}
}
like I sometimes do, if you don't trust that stuff.
Roger.
Terry
====================
On Sat, 19 Feb 2022 12:51:26 -0500, you wrote:
the difference needs a translate down so you don't have colliding planes:
// Remove smaller diam, but higher, protruding at both ends
translate([0,0,-0.01])cylinder(h=h+.02, d1=d1-2t, d2=d2-2t, $fn);
On Sat, Feb 19, 2022 at 12:17 PM Terry terrypingm@gmail.com wrote:
Thanks both, appreciate the fast responses.
Sanjeev: Works fine and no errors!
Dave: No errors, but it did not give me the same result. Probably my
mistake.
Here's my revised code which I thought used your corrections?
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, $fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h=h, d1=d1, d2=d2, $fn);
// Remove smaller diam, but higher, protruding at both ends
cylinder(h=h+.01, d1=d1-2t, d2=d2-2t, $fn);
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
====================
On Sat, 19 Feb 2022 22:01:27 +0530, you wrote:
I have made few changes and it works now in my system
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, center=center, $fn=fn); // ERROR?
<-----------------------------
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2t, d2-2t, center=center, $fn=fn); // ERROR?
<-----------------
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
On Sat, 19 Feb 2022 at 21:46, Terry terrypingm@gmail.com wrote:
As recommended I'm using modules as much as possible. I'd welcome any
general
critiques of this one (syntax, method, formatting, anything). But in
particular
why is it that my code seems to work OK, despite the two console errors
"Too
many unnamed arguments... What is wrong with those please?
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, $fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, true, $fn); // ERROR?
<-----------------------------
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2t, d2-2t, true, $fn); // ERROR?
<-----------------
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
https://www.dropbox.com/s/jmfgtbbl48xrzc0/HollowConeError.jpg?raw=1
Terry
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 **
f equals m times a. When your f is steady, and your m is going down
your a is going up. -- Chris Hadfield about flying up the space shuttle.
On Sat, Feb 19, 2022 at 06:40:43PM +0000, Terry wrote:
> I allowed for that with my h+0.01.
No you didn't. You elevated the top surface of the subtracted cylinder
by 0.01, so that doesn't clash with the subtracted-from cylinder's top
surface. But both bottom surfaces are still at precisely 0.000.
> I think the problem arises because of your
> h=h
> and
> h=h+.01
You're thinking that does something funny because "h may be modified by
h=h+.01" ? That's not the case,
OpenScad allows variable-looking things to have the same name, but in
fact they are different variable-looking-things.
In
cylinder(h=h+.02, d1=d1-2*t, d2=d2-2*t, $fn);
The first "h" is "the cylinder parameter called h". and the second one
is the "local variable called h". Those are entirely different things
and could have WILDLY different values.
Nothing funny happens when you know what's going on. Feel free to do
pipe (dd, hh, t)
{
difference () {
cylinder (d=dd+2*t, h=hh, center=true);
cylinder (d=dd, h=hh+.2, center=true);
}
}
like I sometimes do, if you don't trust that stuff.
Roger.
>
>
> Terry
>
> ====================
>
> On Sat, 19 Feb 2022 12:51:26 -0500, you wrote:
>
> >the difference needs a translate down so you don't have colliding planes:
> >
> >// Remove smaller diam, but higher, protruding at both ends
> > translate([0,0,-0.01])cylinder(h=h+.02, d1=d1-2*t, d2=d2-2*t, $fn);
> >
> >On Sat, Feb 19, 2022 at 12:17 PM Terry <terrypingm@gmail.com> wrote:
> >
> >> Thanks both, appreciate the fast responses.
> >>
> >> Sanjeev: Works fine and no errors!
> >>
> >> Dave: No errors, but it did not give me the same result. Probably my
> >> mistake.
> >> Here's my revised code which I thought used your corrections?
> >>
> >> // Creates a hollow partial cone
> >>
> >> // Height = h
> >> // Bottom diam = d1
> >> // Top diam = d2
> >> // center = true/false or 1/0; almost always use true
> >> // $fn = typically 24 for control knob
> >> // Thickness = t (same throughout)
> >>
> >> module hollowCyl_Full(h, d1, d2, center, $fn, t) {
> >>
> >> difference() {
> >> // Larger diam, from which a difference is needed
> >> cylinder(h=h, d1=d1, d2=d2, $fn);
> >>
> >> // Remove smaller diam, but higher, protruding at both ends
> >> cylinder(h=h+.01, d1=d1-2*t, d2=d2-2*t, $fn);
> >> }
> >> }
> >>
> >> // EXAMPLE
> >> hollowCyl_Full(9, 36, 28, true, 24, 1);
> >>
> >>
> >> ====================
> >>
> >>
> >> On Sat, 19 Feb 2022 22:01:27 +0530, you wrote:
> >>
> >> >I have made few changes and it works now in my system
> >> >
> >> >// Creates a hollow partial cone
> >> >
> >> >// Height = h
> >> >// Bottom diam = d1
> >> >// Top diam = d2
> >> >// center = true/false or 1/0; almost always use true
> >> >// $fn = typically 24 for control knob
> >> >// Thickness = t (same throughout)
> >> >
> >> >module hollowCyl_Full(h, d1, d2, center, fn, t) {
> >> >
> >> >difference() {
> >> >// Larger diam, from which a difference is needed
> >> > cylinder(h, d1, d2, center=center, $fn=fn); // ERROR?
> >> ><-----------------------------
> >> >
> >> >// Remove smaller diam, but higher, protruding at both ends
> >> > cylinder(h+.01, d1-2*t, d2-2*t, center=center, $fn=fn); // ERROR?
> >> ><-----------------
> >> > }
> >> >}
> >> >
> >> >// EXAMPLE
> >> >hollowCyl_Full(9, 36, 28, true, 24, 1);
> >> >
> >> >On Sat, 19 Feb 2022 at 21:46, Terry <terrypingm@gmail.com> wrote:
> >> >
> >> >> As recommended I'm using modules as much as possible. I'd welcome any
> >> >> general
> >> >> critiques of this one (syntax, method, formatting, anything). But in
> >> >> particular
> >> >> why is it that my code seems to work OK, despite the two console errors
> >> >> "Too
> >> >> many unnamed arguments... What is wrong with those please?
> >> >>
> >> >> // Creates a hollow partial cone
> >> >>
> >> >> // Height = h
> >> >> // Bottom diam = d1
> >> >> // Top diam = d2
> >> >> // center = true/false or 1/0; almost always use true
> >> >> // $fn = typically 24 for control knob
> >> >> // Thickness = t (same throughout)
> >> >>
> >> >> module hollowCyl_Full(h, d1, d2, center, $fn, t) {
> >> >>
> >> >> difference() {
> >> >> // Larger diam, from which a difference is needed
> >> >> cylinder(h, d1, d2, true, $fn); // ERROR?
> >> >> <-----------------------------
> >> >>
> >> >> // Remove smaller diam, but higher, protruding at both ends
> >> >> cylinder(h+.01, d1-2*t, d2-2*t, true, $fn); // ERROR?
> >> >> <-----------------
> >> >> }
> >> >> }
> >> >>
> >> >> // EXAMPLE
> >> >> hollowCyl_Full(9, 36, 28, true, 24, 1);
> >> >>
> >> >> https://www.dropbox.com/s/jmfgtbbl48xrzc0/HollowConeError.jpg?raw=1
> >> >>
> >> >> Terry
> >> >> _______________________________________________
> >> >> OpenSCAD mailing list
> >> >> To unsubscribe send an email to discuss-leave@lists.openscad.org
> >> >>
> >> _______________________________________________
> >> OpenSCAD mailing list
> >> To unsubscribe send an email to discuss-leave@lists.openscad.org
> >>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 **
f equals m times a. When your f is steady, and your m is going down
your a is going up. -- Chris Hadfield about flying up the space shuttle.
T
Terry
Sat, Feb 19, 2022 10:16 PM
But having centered, I get protrusions of 0.005 at both top and bottom, yes?
I'll take a closer look in the morning, but my latest code below, based on
Sanjeev's reply, works fine. But using h=h+.01 as David suggested does not. Does
it work for you?
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, center=center, $fn=fn); // ERROR?
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2t, d2-2t, center=center, $fn=fn);
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
====================
On Sat, 19 Feb 2022 21:21:40 +0100, you wrote:
On Sat, Feb 19, 2022 at 06:40:43PM +0000, Terry wrote:
I allowed for that with my h+0.01.
No you didn't. You elevated the top surface of the subtracted cylinder
by 0.01, so that doesn't clash with the subtracted-from cylinder's top
surface. But both bottom surfaces are still at precisely 0.000.
I think the problem arises because of your
h=h
and
h=h+.01
You're thinking that does something funny because "h may be modified by
h=h+.01" ? That's not the case,
OpenScad allows variable-looking things to have the same name, but in
fact they are different variable-looking-things.
In
cylinder(h=h+.02, d1=d1-2t, d2=d2-2t, $fn);
The first "h" is "the cylinder parameter called h". and the second one
is the "local variable called h". Those are entirely different things
and could have WILDLY different values.
Nothing funny happens when you know what's going on. Feel free to do
pipe (dd, hh, t)
{
difference () {
cylinder (d=dd+2*t, h=hh, center=true);
cylinder (d=dd, h=hh+.2, center=true);
}
}
like I sometimes do, if you don't trust that stuff.
Roger.
Terry
====================
On Sat, 19 Feb 2022 12:51:26 -0500, you wrote:
the difference needs a translate down so you don't have colliding planes:
// Remove smaller diam, but higher, protruding at both ends
translate([0,0,-0.01])cylinder(h=h+.02, d1=d1-2t, d2=d2-2t, $fn);
On Sat, Feb 19, 2022 at 12:17 PM Terry terrypingm@gmail.com wrote:
Thanks both, appreciate the fast responses.
Sanjeev: Works fine and no errors!
Dave: No errors, but it did not give me the same result. Probably my
mistake.
Here's my revised code which I thought used your corrections?
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, $fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h=h, d1=d1, d2=d2, $fn);
// Remove smaller diam, but higher, protruding at both ends
cylinder(h=h+.01, d1=d1-2t, d2=d2-2t, $fn);
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
====================
On Sat, 19 Feb 2022 22:01:27 +0530, you wrote:
I have made few changes and it works now in my system
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, center=center, $fn=fn); // ERROR?
<-----------------------------
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2t, d2-2t, center=center, $fn=fn); // ERROR?
<-----------------
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
On Sat, 19 Feb 2022 at 21:46, Terry terrypingm@gmail.com wrote:
As recommended I'm using modules as much as possible. I'd welcome any
general
critiques of this one (syntax, method, formatting, anything). But in
particular
why is it that my code seems to work OK, despite the two console errors
"Too
many unnamed arguments... What is wrong with those please?
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, $fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, true, $fn); // ERROR?
<-----------------------------
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2t, d2-2t, true, $fn); // ERROR?
<-----------------
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
https://www.dropbox.com/s/jmfgtbbl48xrzc0/HollowConeError.jpg?raw=1
Terry
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
But having centered, I get protrusions of 0.005 at both top and bottom, yes?
I'll take a closer look in the morning, but my latest code below, based on
Sanjeev's reply, works fine. But using h=h+.01 as David suggested does not. Does
it work for you?
// Creates a hollow partial cone
// Height = h
// Bottom diam = d1
// Top diam = d2
// center = true/false or 1/0; almost always use true
// $fn = typically 24 for control knob
// Thickness = t (same throughout)
module hollowCyl_Full(h, d1, d2, center, fn, t) {
difference() {
// Larger diam, from which a difference is needed
cylinder(h, d1, d2, center=center, $fn=fn); // ERROR?
// Remove smaller diam, but higher, protruding at both ends
cylinder(h+.01, d1-2*t, d2-2*t, center=center, $fn=fn);
}
}
// EXAMPLE
hollowCyl_Full(9, 36, 28, true, 24, 1);
====================
On Sat, 19 Feb 2022 21:21:40 +0100, you wrote:
>On Sat, Feb 19, 2022 at 06:40:43PM +0000, Terry wrote:
>> I allowed for that with my h+0.01.
>
>No you didn't. You elevated the top surface of the subtracted cylinder
>by 0.01, so that doesn't clash with the subtracted-from cylinder's top
>surface. But both bottom surfaces are still at precisely 0.000.
>
>> I think the problem arises because of your
>> h=h
>> and
>> h=h+.01
>
>You're thinking that does something funny because "h may be modified by
>h=h+.01" ? That's not the case,
>OpenScad allows variable-looking things to have the same name, but in
>fact they are different variable-looking-things.
>
>In
> cylinder(h=h+.02, d1=d1-2*t, d2=d2-2*t, $fn);
>
>The first "h" is "the cylinder parameter called h". and the second one
>is the "local variable called h". Those are entirely different things
>and could have WILDLY different values.
>
>Nothing funny happens when you know what's going on. Feel free to do
>
>pipe (dd, hh, t)
>{
> difference () {
> cylinder (d=dd+2*t, h=hh, center=true);
> cylinder (d=dd, h=hh+.2, center=true);
> }
>}
>
>like I sometimes do, if you don't trust that stuff.
>
> Roger.
>
>
>>
>>
>> Terry
>>
>> ====================
>>
>> On Sat, 19 Feb 2022 12:51:26 -0500, you wrote:
>>
>> >the difference needs a translate down so you don't have colliding planes:
>> >
>> >// Remove smaller diam, but higher, protruding at both ends
>> > translate([0,0,-0.01])cylinder(h=h+.02, d1=d1-2*t, d2=d2-2*t, $fn);
>> >
>> >On Sat, Feb 19, 2022 at 12:17 PM Terry <terrypingm@gmail.com> wrote:
>> >
>> >> Thanks both, appreciate the fast responses.
>> >>
>> >> Sanjeev: Works fine and no errors!
>> >>
>> >> Dave: No errors, but it did not give me the same result. Probably my
>> >> mistake.
>> >> Here's my revised code which I thought used your corrections?
>> >>
>> >> // Creates a hollow partial cone
>> >>
>> >> // Height = h
>> >> // Bottom diam = d1
>> >> // Top diam = d2
>> >> // center = true/false or 1/0; almost always use true
>> >> // $fn = typically 24 for control knob
>> >> // Thickness = t (same throughout)
>> >>
>> >> module hollowCyl_Full(h, d1, d2, center, $fn, t) {
>> >>
>> >> difference() {
>> >> // Larger diam, from which a difference is needed
>> >> cylinder(h=h, d1=d1, d2=d2, $fn);
>> >>
>> >> // Remove smaller diam, but higher, protruding at both ends
>> >> cylinder(h=h+.01, d1=d1-2*t, d2=d2-2*t, $fn);
>> >> }
>> >> }
>> >>
>> >> // EXAMPLE
>> >> hollowCyl_Full(9, 36, 28, true, 24, 1);
>> >>
>> >>
>> >> ====================
>> >>
>> >>
>> >> On Sat, 19 Feb 2022 22:01:27 +0530, you wrote:
>> >>
>> >> >I have made few changes and it works now in my system
>> >> >
>> >> >// Creates a hollow partial cone
>> >> >
>> >> >// Height = h
>> >> >// Bottom diam = d1
>> >> >// Top diam = d2
>> >> >// center = true/false or 1/0; almost always use true
>> >> >// $fn = typically 24 for control knob
>> >> >// Thickness = t (same throughout)
>> >> >
>> >> >module hollowCyl_Full(h, d1, d2, center, fn, t) {
>> >> >
>> >> >difference() {
>> >> >// Larger diam, from which a difference is needed
>> >> > cylinder(h, d1, d2, center=center, $fn=fn); // ERROR?
>> >> ><-----------------------------
>> >> >
>> >> >// Remove smaller diam, but higher, protruding at both ends
>> >> > cylinder(h+.01, d1-2*t, d2-2*t, center=center, $fn=fn); // ERROR?
>> >> ><-----------------
>> >> > }
>> >> >}
>> >> >
>> >> >// EXAMPLE
>> >> >hollowCyl_Full(9, 36, 28, true, 24, 1);
>> >> >
>> >> >On Sat, 19 Feb 2022 at 21:46, Terry <terrypingm@gmail.com> wrote:
>> >> >
>> >> >> As recommended I'm using modules as much as possible. I'd welcome any
>> >> >> general
>> >> >> critiques of this one (syntax, method, formatting, anything). But in
>> >> >> particular
>> >> >> why is it that my code seems to work OK, despite the two console errors
>> >> >> "Too
>> >> >> many unnamed arguments... What is wrong with those please?
>> >> >>
>> >> >> // Creates a hollow partial cone
>> >> >>
>> >> >> // Height = h
>> >> >> // Bottom diam = d1
>> >> >> // Top diam = d2
>> >> >> // center = true/false or 1/0; almost always use true
>> >> >> // $fn = typically 24 for control knob
>> >> >> // Thickness = t (same throughout)
>> >> >>
>> >> >> module hollowCyl_Full(h, d1, d2, center, $fn, t) {
>> >> >>
>> >> >> difference() {
>> >> >> // Larger diam, from which a difference is needed
>> >> >> cylinder(h, d1, d2, true, $fn); // ERROR?
>> >> >> <-----------------------------
>> >> >>
>> >> >> // Remove smaller diam, but higher, protruding at both ends
>> >> >> cylinder(h+.01, d1-2*t, d2-2*t, true, $fn); // ERROR?
>> >> >> <-----------------
>> >> >> }
>> >> >> }
>> >> >>
>> >> >> // EXAMPLE
>> >> >> hollowCyl_Full(9, 36, 28, true, 24, 1);
>> >> >>
>> >> >> https://www.dropbox.com/s/jmfgtbbl48xrzc0/HollowConeError.jpg?raw=1
>> >> >>
>> >> >> Terry
>> >> >> _______________________________________________
>> >> >> OpenSCAD mailing list
>> >> >> To unsubscribe send an email to discuss-leave@lists.openscad.org
>> >> >>
>> >> _______________________________________________
>> >> OpenSCAD mailing list
>> >> To unsubscribe send an email to discuss-leave@lists.openscad.org
>> >>
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org
DM
Douglas Miller
Sat, Feb 19, 2022 11:05 PM
On 2/19/2022 12:51 PM, David Phillip Oster wrote:
the difference needs a translate down so you don't have colliding planes:
Not if he uses the 'center' parameter properly, he doesn't. Instead of
cylinder(h=h, d1=d1, d2=d2, $fn);
he needs to use cylinder(h=h, d1=d1, d2=d2, center=center, $fn); and
similarly on the subtracted inner cylinder.
Terry: your main issue throughout is that you're not sending the correct
parameters to cylinder().
And as I've noted in a different message, the whole issue becomes moot
and everything becomes much easier and faster if you make this figure by
rotate_extrude()ing a parallelogram.
On 2/19/2022 12:51 PM, David Phillip Oster wrote:
> the difference needs a translate down so you don't have colliding planes:
Not if he uses the 'center' parameter properly, he doesn't. Instead of
> cylinder(h=h, d1=d1, d2=d2, $fn);
he needs to use cylinder(h=h, d1=d1, d2=d2, center=center, $fn); and
similarly on the subtracted inner cylinder.
Terry: your main issue throughout is that you're not sending the correct
parameters to cylinder().
And as I've noted in a different message, the whole issue becomes moot
and everything becomes much easier and faster if you make this figure by
rotate_extrude()ing a parallelogram.