H
Hendrik
Tue, Mar 15, 2022 3:36 PM
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
-->Hi
When I use r1 and r2 in a cylinder which one of the radius is at [0,0,0].
Cylinder(r1=10, r2=20,h=25);
Is the r1= 10 at the 0,0,0 or the r2?
Thank you
Sent from Mail for Windows
TP
Torsten Paul
Tue, Mar 15, 2022 3:42 PM
On 15.03.22 16:36, Hendrik wrote:
Cylinder(r1=10, r2=20,h=25);
r1 is the one at the bottom, circle around [0, 0, 0]
r2 is at the top, the bigger circle around [0, 0, 25]
ciao,
Torsten.
On 15.03.22 16:36, Hendrik wrote:
> Cylinder(r1=10, r2=20,h=25);
r1 is the one at the bottom, circle around [0, 0, 0]
r2 is at the top, the bigger circle around [0, 0, 25]
ciao,
Torsten.
BR
Bob Roos
Wed, Mar 16, 2022 1:43 AM
Hi Torsten,
I struggle with that because it seems backwards to me, but I am coping.....
Bob
Tuesday, March 15, 2022, 11:42:55 AM, you wrote:
On 15.03.22 16:36, Hendrik wrote:
Cylinder(r1=10, r2=20,h=25);
r1 is the one at the bottom, circle around [0, 0, 0]
r2 is at the top, the bigger circle around [0, 0, 25]
Hi Torsten,
I struggle with that because it seems backwards to me, but I am coping.....
Bob
Tuesday, March 15, 2022, 11:42:55 AM, you wrote:
> On 15.03.22 16:36, Hendrik wrote:
>> Cylinder(r1=10, r2=20,h=25);
> r1 is the one at the bottom, circle around [0, 0, 0]
> r2 is at the top, the bigger circle around [0, 0, 25]
> ciao,
> Torsten.
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
--
have Fun,
Bob mailto:roosbob@wybatap.com
M
MichaelAtOz
Wed, Mar 16, 2022 1:46 AM
I had a go at clarifying the wiki.
-----Original Message-----
From: Bob Roos [mailto:roosbob@wybatap.com]
Sent: Wed, 16 Mar 2022 12:43
To: OpenSCAD general discussion
Subject: [OpenSCAD] Re: r1 and r2
Hi Torsten,
I struggle with that because it seems backwards to me, but I am coping.....
Bob
Tuesday, March 15, 2022, 11:42:55 AM, you wrote:
On 15.03.22 16:36, Hendrik wrote:
Cylinder(r1=10, r2=20,h=25);
r1 is the one at the bottom, circle around [0, 0, 0]
r2 is at the top, the bigger circle around [0, 0, 25]
I had a go at clarifying the wiki.
> -----Original Message-----
> From: Bob Roos [mailto:roosbob@wybatap.com]
> Sent: Wed, 16 Mar 2022 12:43
> To: OpenSCAD general discussion
> Subject: [OpenSCAD] Re: r1 and r2
>
> Hi Torsten,
>
> I struggle with that because it seems backwards to me, but I am coping.....
>
> Bob
>
> Tuesday, March 15, 2022, 11:42:55 AM, you wrote:
> > On 15.03.22 16:36, Hendrik wrote:
> >> Cylinder(r1=10, r2=20,h=25);
>
> > r1 is the one at the bottom, circle around [0, 0, 0]
>
> > r2 is at the top, the bigger circle around [0, 0, 25]
>
> > ciao,
> > Torsten.
> > _______________________________________________
> > OpenSCAD mailing list
> > To unsubscribe send an email to discuss-leave@lists.openscad.org
>
>
> --
> have Fun,
> Bob mailto:roosbob@wybatap.com
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
--
This email has been checked for viruses by AVG.
https://www.avg.com
JB
Jordan Brown
Wed, Mar 16, 2022 4:04 AM
On 3/15/2022 6:43 PM, Bob Roos wrote:
I struggle with that because it seems backwards to me, but I am coping.....
Most things in OpenSCAD extend by default from the origin into +Z:
cylinder, cube, linear_extrude, et cetera. I think of the origin as the
"first" part of the object, so it makes sense to me that r1 controls the
radius on the origin plane.
If you set center=true then that logic goes out the window and it
becomes arbitrary whether the top or the bottom is "first".
On 3/15/2022 6:43 PM, Bob Roos wrote:
> I struggle with that because it seems backwards to me, but I am coping.....
Most things in OpenSCAD extend by default from the origin into +Z:
cylinder, cube, linear_extrude, et cetera. I think of the origin as the
"first" part of the object, so it makes sense to me that r1 controls the
radius on the origin plane.
If you set center=true then that logic goes out the window and it
becomes arbitrary whether the top or the bottom is "first".
DS
David Schooley
Wed, Mar 16, 2022 4:26 AM
The difference between how cubes are handled vs.cylinders has always been interesting. I have a lot of code that is more of a mess than necessary because cubes don’t center on the X-Y plane but cylinders do. I think what OpenSCAD does is correct, but a “centerxy” parameter for cubes would be a good thing.
I struggle with that because it seems backwards to me, but I am coping.....
Most things in OpenSCAD extend by default from the origin into +Z: cylinder, cube, linear_extrude, et cetera. I think of the origin as the "first" part of the object, so it makes sense to me that r1 controls the radius on the origin plane.
If you set center=true then that logic goes out the window and it becomes arbitrary whether the top or the bottom is "first".
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
The difference between how cubes are handled vs.cylinders has always been interesting. I have a lot of code that is more of a mess than necessary because cubes don’t center on the X-Y plane but cylinders do. I think what OpenSCAD does is correct, but a “centerxy” parameter for cubes would be a good thing.
> On Mar 15, 2022, at 11:04 PM, Jordan Brown <openscad@jordan.maileater.net> wrote:
>
> On 3/15/2022 6:43 PM, Bob Roos wrote:
>> I struggle with that because it seems backwards to me, but I am coping.....
>
> Most things in OpenSCAD extend by default from the origin into +Z: cylinder, cube, linear_extrude, et cetera. I think of the origin as the "first" part of the object, so it makes sense to me that r1 controls the radius on the origin plane.
>
> If you set center=true then that logic goes out the window and it becomes arbitrary whether the top or the bottom is "first".
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
RW
Rogier Wolff
Wed, Mar 16, 2022 8:46 AM
On Wed, Mar 16, 2022 at 04:04:51AM +0000, Jordan Brown wrote:
If you set center=true then that logic goes out the window and it
becomes arbitrary whether the top or the bottom is "first".
But still it'd be very odd if the orientation would "flip" when you
add center=true !
Roger.
--
** 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 Wed, Mar 16, 2022 at 04:04:51AM +0000, Jordan Brown wrote:
> If you set center=true then that logic goes out the window and it
> becomes arbitrary whether the top or the bottom is "first".
But still it'd be very odd if the orientation would "flip" when you
add center=true !
Roger.
--
** 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.
J
jon
Wed, Mar 16, 2022 12:03 PM
Easy enough to roll your own CubeCXY() which centers in XY.
On 3/16/2022 12:26 AM, David Schooley wrote:
The difference between how cubes are handled vs.cylinders has always been interesting. I have a lot of code that is more of a mess than necessary because cubes don’t center on the X-Y plane but cylinders do. I think what OpenSCAD does is correct, but a “centerxy” parameter for cubes would be a good thing.
Easy enough to roll your own CubeCXY() which centers in XY.
On 3/16/2022 12:26 AM, David Schooley wrote:
> The difference between how cubes are handled vs.cylinders has always been interesting. I have a lot of code that is more of a mess than necessary because cubes don’t center on the X-Y plane but cylinders do. I think what OpenSCAD does is correct, but a “centerxy” parameter for cubes would be a good thing.
>
DM
Douglas Miller
Wed, Mar 16, 2022 12:14 PM
Bob,
Here ya go.
module cube(size,center=false) {
x = is_list(size) ? size[0] : size;
y = is_list(size) ? size[1] : size;
z = is_list(size) ? size[2] : size;
DeltaZ = center ? -z/2 : 0;
translate([0,0,DeltaZ]) linear_extrude(height=z) square([x,y],true);
}
center true gives you a rectangular solid with its geometric center at
the origin; center false (or omitted) gives you the same solid with its
base centered at the origin, extending upward in +z. size can be either
a scalar (true cube) or a list (x, y, z values independent), same as in
the standard cube() function.
On 3/16/2022 12:26 AM, David Schooley wrote:
The difference between how cubes are handled vs.cylinders has always been interesting. I have a lot of code that is more of a mess than necessary because cubes don’t center on the X-Y plane but cylinders do. I think what OpenSCAD does is correct, but a “centerxy” parameter for cubes would be a good thing.
Bob,
Here ya go.
module cube(size,center=false) {
x = is_list(size) ? size[0] : size;
y = is_list(size) ? size[1] : size;
z = is_list(size) ? size[2] : size;
DeltaZ = center ? -z/2 : 0;
translate([0,0,DeltaZ]) linear_extrude(height=z) square([x,y],true);
}
center true gives you a rectangular solid with its geometric center at
the origin; center false (or omitted) gives you the same solid with its
base centered at the origin, extending upward in +z. size can be either
a scalar (true cube) or a list (x, y, z values independent), same as in
the standard cube() function.
On 3/16/2022 12:26 AM, David Schooley wrote:
> The difference between how cubes are handled vs.cylinders has always been interesting. I have a lot of code that is more of a mess than necessary because cubes don’t center on the X-Y plane but cylinders do. I think what OpenSCAD does is correct, but a “centerxy” parameter for cubes would be a good thing.
>
TP
Torsten Paul
Wed, Mar 16, 2022 12:19 PM
On 16.03.22 13:14, Douglas Miller wrote:
DeltaZ = center ? -z/2 : 0;
translate([0,0,DeltaZ]) linear_extrude(height=z) square([x,y],true);
linear_extrude(height=z, center=center) square([x,y],true);
No need for translate(), linear_extrude() has a center
parameter too.
ciao,
Torsten.
On 16.03.22 13:14, Douglas Miller wrote:
> DeltaZ = center ? -z/2 : 0;
> translate([0,0,DeltaZ]) linear_extrude(height=z) square([x,y],true);
linear_extrude(height=z, center=center) square([x,y],true);
No need for translate(), linear_extrude() has a center
parameter too.
ciao,
Torsten.