Can anyone tell me rather then building a long cylinder with different diameters and stacking them on top of each other if a person can do rather create a long cylinder and use nested difference() to keep the cylinder solid and only take away the different diameters. For example.
difference() {
cylinder(d=22, h=40, $fn=100);
difference() {
cylinder(d=22, h=2, $fn=100);
cylinder(d=8, h=4, $fn=100);
}
difference() {
translate([0,0,2]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,1]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,3.5]) cylinder(d=22, h=5, $fn=100);
translate([0,0,2.5]) cylinder(d=8, h=7, $fn=100);
}
difference() {
translate([0,0,8.5]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,7.5]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,12]) cylinder(d=22, h=28, $fn=100);
translate([0,0,11]) cylinder(d=16, h=30, $fn=100);
}
translate([0,0,15]) cylinder(d=12, 26, $fn=100););
}
Sent from Mail for Windows
If I understand your question correctly, you pose a possible construction
technique, give an example, and ask if it works.
What happens when you run that code?
(Yeah, I tried your example, it has a simple typo, and in preview you get
Z-fighting, which is easily fixable by making the subtraction cylinders
slightly larger)
Or are you asking something else?
Michael, fra mobilen
fre. 4. mar. 2022 16.30 skrev Hendrik blindguydiy@gmail.com:
Hi
Can anyone tell me rather then building a long cylinder with different
diameters and stacking them on top of each other if a person can do rather
create a long cylinder and use nested difference() to keep the cylinder
solid and only take away the different diameters. For example.
difference() {
cylinder(d=22, h=40, $fn=100);
difference() {
cylinder(d=22, h=2, $fn=100);
cylinder(d=8, h=4, $fn=100);
}
difference() {
translate([0,0,2]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,1]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,3.5]) cylinder(d=22, h=5, $fn=100);
translate([0,0,2.5]) cylinder(d=8, h=7, $fn=100);
}
difference() {
translate([0,0,8.5]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,7.5]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,12]) cylinder(d=22, h=28, $fn=100);
translate([0,0,11]) cylinder(d=16, h=30, $fn=100);
}
translate([0,0,15]) cylinder(d=12, 26, $fn=100););
}
Sent from Mail https://go.microsoft.com/fwlink/?LinkId=550986 for
Windows
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
You could build the profile in 2D and then rotate_extrude() it.
Jon
On 3/4/2022 10:29 AM, Hendrik wrote:
difference() {
cylinder(d=22, h=40, $fn=100);
difference() {
cylinder(d=22, h=2, $fn=100);
cylinder(d=8, h=4, $fn=100);
}
difference() {
translate([0,0,2]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,1]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,3.5]) cylinder(d=22, h=5, $fn=100);
translate([0,0,2.5]) cylinder(d=8, h=7, $fn=100);
}
difference() {
translate([0,0,8.5]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,7.5]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,12]) cylinder(d=22, h=28, $fn=100);
translate([0,0,11]) cylinder(d=16, h=30, $fn=100);
}
translate([0,0,15]) cylinder(d=12, 26, $fn=100););
}
Another way to make it that would execute much faster is to
rotate_extrude() a half profile, which would either be a polygon or a union
of squares.
On Fri, 4 Mar 2022 at 15:48, Michael Möller private2michael@gmail.com
wrote:
If I understand your question correctly, you pose a possible construction
technique, give an example, and ask if it works.
What happens when you run that code?
(Yeah, I tried your example, it has a simple typo, and in preview you get
Z-fighting, which is easily fixable by making the subtraction cylinders
slightly larger)
Or are you asking something else?
Michael, fra mobilen
fre. 4. mar. 2022 16.30 skrev Hendrik blindguydiy@gmail.com:
Hi
Can anyone tell me rather then building a long cylinder with different
diameters and stacking them on top of each other if a person can do rather
create a long cylinder and use nested difference() to keep the cylinder
solid and only take away the different diameters. For example.
difference() {
cylinder(d=22, h=40, $fn=100);
difference() {
cylinder(d=22, h=2, $fn=100);
cylinder(d=8, h=4, $fn=100);
}
difference() {
translate([0,0,2]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,1]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,3.5]) cylinder(d=22, h=5, $fn=100);
translate([0,0,2.5]) cylinder(d=8, h=7, $fn=100);
}
difference() {
translate([0,0,8.5]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,7.5]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,12]) cylinder(d=22, h=28, $fn=100);
translate([0,0,11]) cylinder(d=16, h=30, $fn=100);
}
translate([0,0,15]) cylinder(d=12, 26, $fn=100););
}
Sent from Mail https://go.microsoft.com/fwlink/?LinkId=550986 for
Windows
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
If I run the code with f5 and f6 I get no errors and it loads it. But will have to try and find someone to see what is on the screen..
I can even export it.
Sent from Mail for Windows
From: Michael Möller
Sent: Friday, 04 March 2022 17:48
To: OpenSCAD general discussion
Subject: [OpenSCAD] Re: nested difference to subtract from solid
If I understand your question correctly, you pose a possible construction technique, give an example, and ask if it works.
What happens when *you* run that code?
(Yeah, I tried your example, it has a simple typo, and in preview you get Z-fighting, which is easily fixable by making the subtraction cylinders slightly larger)
Or are you asking something else?
Michael, fra mobilen
fre. 4. mar. 2022 16.30 skrev Hendrik <blindguydiy@gmail.com>:
Hi
Can anyone tell me rather then building a long cylinder with different diameters and stacking them on top of each other if a person can do rather create a long cylinder and use nested difference() to keep the cylinder solid and only take away the different diameters. For example.
difference() {
cylinder(d=22, h=40, $fn=100);
difference() {
cylinder(d=22, h=2, $fn=100);
cylinder(d=8, h=4, $fn=100);
}
difference() {
translate([0,0,2]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,1]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,3.5]) cylinder(d=22, h=5, $fn=100);
translate([0,0,2.5]) cylinder(d=8, h=7, $fn=100);
}
difference() {
translate([0,0,8.5]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,7.5]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,12]) cylinder(d=22, h=28, $fn=100);
translate([0,0,11]) cylinder(d=16, h=30, $fn=100);
}
translate([0,0,15]) cylinder(d=12, 26, $fn=100););
}
Sent from Mail for Windows
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Sent from Mail for Windows
From: Michael Möller
Sent: Friday, 04 March 2022 17:48
To: OpenSCAD general discussion
Subject: [OpenSCAD] Re: nested difference to subtract from solid
If I understand your question correctly, you pose a possible construction technique, give an example, and ask if it works.
What happens when *you* run that code?
(Yeah, I tried your example, it has a simple typo, and in preview you get Z-fighting, which is easily fixable by making the subtraction cylinders slightly larger)
Or are you asking something else?
Michael, fra mobilen
fre. 4. mar. 2022 16.30 skrev Hendrik <blindguydiy@gmail.com>:
Hi
Can anyone tell me rather then building a long cylinder with different diameters and stacking them on top of each other if a person can do rather create a long cylinder and use nested difference() to keep the cylinder solid and only take away the different diameters. For example.
difference() {
cylinder(d=22, h=40, $fn=100);
difference() {
cylinder(d=22, h=2, $fn=100);
cylinder(d=8, h=4, $fn=100);
}
difference() {
translate([0,0,2]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,1]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,3.5]) cylinder(d=22, h=5, $fn=100);
translate([0,0,2.5]) cylinder(d=8, h=7, $fn=100);
}
difference() {
translate([0,0,8.5]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,7.5]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,12]) cylinder(d=22, h=28, $fn=100);
translate([0,0,11]) cylinder(d=16, h=30, $fn=100);
}
translate([0,0,15]) cylinder(d=12, 26, $fn=100););
}
Sent from Mail for Windows
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
In general it is wise to overlap unioned shapes, especially in 3D. In your
case all the heights look like they can be represented exactly in floating
point fractions, so you probably get away without it.
On Fri, 4 Mar 2022 at 16:26, Hendrik blindguydiy@gmail.com wrote:
The reason why I looked at doing it that way, it means that it is one
solid part and problems with correctly union where small spaces can appear
is excluded. So just was wondering if it could be done like that. On the
other hand say I stack all the different cylinders is it safer to include a
esp=0.01 or something like that to make sure no spaces appear. Could it do
any harm in including the esp or could it be just a safety net.
Sent from Mail https://go.microsoft.com/fwlink/?LinkId=550986 for
Windows
*From: *Michael Möller private2michael@gmail.com
*Sent: *Friday, 04 March 2022 17:48
*To: *OpenSCAD general discussion discuss@lists.openscad.org
*Subject: *[OpenSCAD] Re: nested difference to subtract from solid
If I understand your question correctly, you pose a possible construction
technique, give an example, and ask if it works.
What happens when you run that code?
(Yeah, I tried your example, it has a simple typo, and in preview you get
Z-fighting, which is easily fixable by making the subtraction cylinders
slightly larger)
Or are you asking something else?
Michael, fra mobilen
fre. 4. mar. 2022 16.30 skrev Hendrik blindguydiy@gmail.com:
Hi
Can anyone tell me rather then building a long cylinder with different
diameters and stacking them on top of each other if a person can do rather
create a long cylinder and use nested difference() to keep the cylinder
solid and only take away the different diameters. For example.
difference() {
cylinder(d=22, h=40, $fn=100);
difference() {
cylinder(d=22, h=2, $fn=100);
cylinder(d=8, h=4, $fn=100);
}
difference() {
translate([0,0,2]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,1]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,3.5]) cylinder(d=22, h=5, $fn=100);
translate([0,0,2.5]) cylinder(d=8, h=7, $fn=100);
}
difference() {
translate([0,0,8.5]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,7.5]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,12]) cylinder(d=22, h=28, $fn=100);
translate([0,0,11]) cylinder(d=16, h=30, $fn=100);
}
translate([0,0,15]) cylinder(d=12, 26, $fn=100););
}
Sent from Mail https://go.microsoft.com/fwlink/?LinkId=550986 for
Windows
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
Hendrik,
nop.head’s alternative is this,
rotate_extrude($fn=100)
polygon(points=
[[0,0],
[4,0],
[4,2],
[3.5,2],
[3.5,3.5],
[4,3.5],
[4,8.5],
[3.5,8.5],
[3.5,10],
[11,10],
[11,12],
[8,12],
[8,40],
[6,40],
[6,12],
[0,12],
[0,0]]
);
Whilst this is simpler to code and execute it may be more difficult for you to visualise. I think I have the values correct I overlaid the two outputs and they look the same to me.
The polygon is a list of co-ordinates to draw out a flat shape that describes the cross section profile of one half of your finished set of cylinders complete with holes. This is then rotated about the z axis through 360 to create the finished object.
Note the final [0,0] point is not strictly necessary, it is not shown in the examples, and the code works without it, but I just like to close out shapes..
I use this method to create the various bezel cross section shapes for my dial instruments, I then use translate to push the profile away from the z axis before rotate_extrude to create the hole for the glass to go in the middle.
Cheers
Bob C
On 4 Mar 2022, at 16:59, nop head nop.head@gmail.com wrote:
In general it is wise to overlap unioned shapes, especially in 3D. In your case all the heights look like they can be represented exactly in floating point fractions, so you probably get away without it.
On Fri, 4 Mar 2022 at 16:26, Hendrik <blindguydiy@gmail.com mailto:blindguydiy@gmail.com> wrote:
The reason why I looked at doing it that way, it means that it is one solid part and problems with correctly union where small spaces can appear is excluded. So just was wondering if it could be done like that. On the other hand say I stack all the different cylinders is it safer to include a esp=0.01 or something like that to make sure no spaces appear. Could it do any harm in including the esp or could it be just a safety net.
Sent from Mail https://go.microsoft.com/fwlink/?LinkId=550986 for Windows
From: Michael Möller mailto:private2michael@gmail.com
Sent: Friday, 04 March 2022 17:48
To: OpenSCAD general discussion mailto:discuss@lists.openscad.org
Subject: [OpenSCAD] Re: nested difference to subtract from solid
If I understand your question correctly, you pose a possible construction technique, give an example, and ask if it works.
What happens when you run that code?
(Yeah, I tried your example, it has a simple typo, and in preview you get Z-fighting, which is easily fixable by making the subtraction cylinders slightly larger)
Or are you asking something else?
Michael, fra mobilen
fre. 4. mar. 2022 16.30 skrev Hendrik <blindguydiy@gmail.com mailto:blindguydiy@gmail.com>:
Hi
Can anyone tell me rather then building a long cylinder with different diameters and stacking them on top of each other if a person can do rather create a long cylinder and use nested difference() to keep the cylinder solid and only take away the different diameters. For example.
difference() {
cylinder(d=22, h=40, $fn=100);
difference() {
cylinder(d=22, h=2, $fn=100);
cylinder(d=8, h=4, $fn=100);
}
difference() {
translate([0,0,2]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,1]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,3.5]) cylinder(d=22, h=5, $fn=100);
translate([0,0,2.5]) cylinder(d=8, h=7, $fn=100);
}
difference() {
translate([0,0,8.5]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,7.5]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,12]) cylinder(d=22, h=28, $fn=100);
translate([0,0,11]) cylinder(d=16, h=30, $fn=100);
}
translate([0,0,15]) cylinder(d=12, 26, $fn=100););
}
Sent from Mail https://go.microsoft.com/fwlink/?LinkId=550986 for Windows
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Sent from Mail for Windows
From: Bob Carter
Sent: Friday, 04 March 2022 19:35
To: OpenSCAD general discussion
Subject: [OpenSCAD] Re: nested difference to subtract from solid
Hendrik,
nop.head’s alternative is this,
rotate_extrude($fn=100)
polygon(points=
[[0,0],
[4,0],
[4,2],
[3.5,2],
[3.5,3.5],
[4,3.5],
[4,8.5],
[3.5,8.5],
[3.5,10],
[11,10],
[11,12],
[8,12],
[8,40],
[6,40],
[6,12],
[0,12],
[0,0]]
);
Whilst this is simpler to code and execute it may be more difficult for you to visualise. I think I have the values correct I overlaid the two outputs and they look the same to me.
The polygon is a list of co-ordinates to draw out a flat shape that describes the cross section profile of one half of your finished set of cylinders complete with holes. This is then rotated about the z axis through 360 to create the finished object.
Note the final [0,0] point is not strictly necessary, it is not shown in the examples, and the code works without it, but I just like to close out shapes..
I use this method to create the various bezel cross section shapes for my dial instruments, I then use translate to push the profile away from the z axis before rotate_extrude to create the hole for the glass to go in the middle.
Cheers
Bob C
On 4 Mar 2022, at 16:59, nop head <nop.head@gmail.com> wrote:
In general it is wise to overlap unioned shapes, especially in 3D. In your case all the heights look like they can be represented exactly in floating point fractions, so you probably get away without it.
On Fri, 4 Mar 2022 at 16:26, Hendrik <blindguydiy@gmail.com> wrote:
The reason why I looked at doing it that way, it means that it is one solid part and problems with correctly union where small spaces can appear is excluded. So just was wondering if it could be done like that. On the other hand say I stack all the different cylinders is it safer to include a esp=0.01 or something like that to make sure no spaces appear. Could it do any harm in including the esp or could it be just a safety net.
Sent from Mail for Windows
From: Michael Möller
Sent: Friday, 04 March 2022 17:48
To: OpenSCAD general discussion
Subject: [OpenSCAD] Re: nested difference to subtract from solidIf I understand your question correctly, you pose a possible construction technique, give an example, and ask if it works.
What happens when *you* run that code?
(Yeah, I tried your example, it has a simple typo, and in preview you get Z-fighting, which is easily fixable by making the subtraction cylinders slightly larger)
Or are you asking something else?
Michael, fra mobilen
fre. 4. mar. 2022 16.30 skrev Hendrik <blindguydiy@gmail.com>:
Hi
Can anyone tell me rather then building a long cylinder with different diameters and stacking them on top of each other if a person can do rather create a long cylinder and use nested difference() to keep the cylinder solid and only take away the different diameters. For example.
difference() {
cylinder(d=22, h=40, $fn=100);
difference() {
cylinder(d=22, h=2, $fn=100);
cylinder(d=8, h=4, $fn=100);
}
difference() {
translate([0,0,2]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,1]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,3.5]) cylinder(d=22, h=5, $fn=100);
translate([0,0,2.5]) cylinder(d=8, h=7, $fn=100);
}
difference() {
translate([0,0,8.5]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,7.5]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,12]) cylinder(d=22, h=28, $fn=100);
translate([0,0,11]) cylinder(d=16, h=30, $fn=100);
}
translate([0,0,15]) cylinder(d=12, 26, $fn=100););
}
Sent from Mail for Windows
_______________________________________________
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
On Fri, Mar 04, 2022 at 04:59:16PM +0000, nop head wrote:
In general it is wise to overlap unioned shapes, especially in 3D. In your
case all the heights look like they can be represented exactly in floating
point fractions, so you probably get away without it.
In general you don't usually want such "fragile" code. Fragile means
that a "should be independent" change impacts/breaks code you didn't touch.
In this case, moving everything up by say 0.1mm will cause the floating
point representations to be endlessly repeating, the roundoff can then cause
a small gap or an overlap.
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.
Hi Hendrik,
Your solution works OK, afaik, (apart from typo in penultimate line and
if the top section is meant to be a tube ) but there is a load of
z-fighting at the circumferences of the cylinders in the f5 render. I
would make any similar shape by union of cylinders. I've put an example
below, to show the principles I'd use, but it is not an attempt to
produce your specific shape.
// cylinder test
$fn =100; //this applies to whole of it
// make the thinnest cylinder the total height of solid cylinders
// total height 100
cylinder (100,10,10);
cylinder (80,15,15);
cylinder (50,20,20);
// there is no visible 'z-fighting at the base
// or if some other arrangement
translate ([50,0,0]) // moved across to show it
{
cylinder (100,10,10);
translate ([0,0,20])cylinder (20,20,20);
translate ([0,0,60])cylinder (20,20,20);
}
// now, check for z fighting at top if first shape
// is created with ends of cylinders at top.
translate ([100,,0,0])
{
cylinder(100,10,10);
translate([0,0,20])cylinder(80,15,15);
translate([0,0,50])cylinder(50,20,20);
}
//it all renders fine
// end
Best wishes,
Ray
On 04/03/2022 15:29, Hendrik wrote:
Hi
Can anyone tell me rather then building a long cylinder with different
diameters and stacking them on top of each other if a person can do
rather create a long cylinder and use nested difference() to keep the
cylinder solid and only take away the different diameters. For example.
difference() {
cylinder(d=22, h=40, $fn=100);
difference() {
cylinder(d=22, h=2, $fn=100);
cylinder(d=8, h=4, $fn=100);
}
difference() {
translate([0,0,2]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,1]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,3.5]) cylinder(d=22, h=5, $fn=100);
translate([0,0,2.5]) cylinder(d=8, h=7, $fn=100);
}
difference() {
translate([0,0,8.5]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,7.5]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,12]) cylinder(d=22, h=28, $fn=100);
translate([0,0,11]) cylinder(d=16, h=30, $fn=100);
}
translate([0,0,15]) cylinder(d=12, 26, $fn=100););
}
Sent from Mail https://go.microsoft.com/fwlink/?LinkId=550986 for
Windows
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
Does z-fighting from unions matter for rendering? Since OP is blind I
would assume he doesn't care if the preview looks bad, but only if the
render is correct.
On Sat, Mar 5, 2022 at 7:17 AM Raymond West raywest@raywest.com wrote:
Hi Hendrik,
Your solution works OK, afaik, (apart from typo in penultimate line and if the top section is meant to be a tube ) but there is a load of z-fighting at the circumferences of the cylinders in the f5 render. I would make any similar shape by union of cylinders. I've put an example below, to show the principles I'd use, but it is not an attempt to produce your specific shape.
// cylinder test
$fn =100; //this applies to whole of it
// make the thinnest cylinder the total height of solid cylinders
// total height 100
cylinder (100,10,10);
cylinder (80,15,15);
cylinder (50,20,20);
// there is no visible 'z-fighting at the base
// or if some other arrangement
translate ([50,0,0]) // moved across to show it
{
cylinder (100,10,10);
translate ([0,0,20])cylinder (20,20,20);
translate ([0,0,60])cylinder (20,20,20);
}
// now, check for z fighting at top if first shape
// is created with ends of cylinders at top.
translate ([100,,0,0])
{
cylinder(100,10,10);
translate([0,0,20])cylinder(80,15,15);
translate([0,0,50])cylinder(50,20,20);
}
//it all renders fine
// end
Best wishes,
Ray
On 04/03/2022 15:29, Hendrik wrote:
Hi
Can anyone tell me rather then building a long cylinder with different diameters and stacking them on top of each other if a person can do rather create a long cylinder and use nested difference() to keep the cylinder solid and only take away the different diameters. For example.
difference() {
cylinder(d=22, h=40, $fn=100);
difference() {
cylinder(d=22, h=2, $fn=100);
cylinder(d=8, h=4, $fn=100);
}
difference() {
translate([0,0,2]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,1]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,3.5]) cylinder(d=22, h=5, $fn=100);
translate([0,0,2.5]) cylinder(d=8, h=7, $fn=100);
}
difference() {
translate([0,0,8.5]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,7.5]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,12]) cylinder(d=22, h=28, $fn=100);
translate([0,0,11]) cylinder(d=16, h=30, $fn=100);
}
translate([0,0,15]) cylinder(d=12, 26, $fn=100););
}
Sent from Mail for Windows
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
This entire discussion has been very interesting to me as it almost covers the complete gamut of manufacturing technologies. Additive (piling up cylinders), substractive (mill it from a solid billet) and extrusion (by rotating a profile or linear extrusion of the individual cylinders and pipes from a 2D shape).
At the end of the day we have constructed the same complex object via different methods and indeed a mix of the methods. Some of these methods are more efficient from a pure coding perspective, and some introduce z-fighting for those that can see it.
But in this case it comes down to which method is the simplest for Hendrik to be able to visualise inside his head.
regards
Bob
On 5 Mar 2022, at 12:24, Adrian Mariano avm4@cornell.edu wrote:
Does z-fighting from unions matter for rendering? Since OP is blind I
would assume he doesn't care if the preview looks bad, but only if the
render is correct.
On Sat, Mar 5, 2022 at 7:17 AM Raymond West raywest@raywest.com wrote:
Hi Hendrik,
Your solution works OK, afaik, (apart from typo in penultimate line and if the top section is meant to be a tube ) but there is a load of z-fighting at the circumferences of the cylinders in the f5 render. I would make any similar shape by union of cylinders. I've put an example below, to show the principles I'd use, but it is not an attempt to produce your specific shape.
// cylinder test
$fn =100; //this applies to whole of it
// make the thinnest cylinder the total height of solid cylinders
// total height 100
cylinder (100,10,10);
cylinder (80,15,15);
cylinder (50,20,20);
// there is no visible 'z-fighting at the base
// or if some other arrangement
translate ([50,0,0]) // moved across to show it
{
cylinder (100,10,10);
translate ([0,0,20])cylinder (20,20,20);
translate ([0,0,60])cylinder (20,20,20);
}
// now, check for z fighting at top if first shape
// is created with ends of cylinders at top.
translate ([100,,0,0])
{
cylinder(100,10,10);
translate([0,0,20])cylinder(80,15,15);
translate([0,0,50])cylinder(50,20,20);
}
//it all renders fine
// end
Best wishes,
Ray
On 04/03/2022 15:29, Hendrik wrote:
Hi
Can anyone tell me rather then building a long cylinder with different diameters and stacking them on top of each other if a person can do rather create a long cylinder and use nested difference() to keep the cylinder solid and only take away the different diameters. For example.
difference() {
cylinder(d=22, h=40, $fn=100);
difference() {
cylinder(d=22, h=2, $fn=100);
cylinder(d=8, h=4, $fn=100);
}
difference() {
translate([0,0,2]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,1]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,3.5]) cylinder(d=22, h=5, $fn=100);
translate([0,0,2.5]) cylinder(d=8, h=7, $fn=100);
}
difference() {
translate([0,0,8.5]) cylinder(d=22, h=1.5, $fn=100);
translate([0,0,7.5]) cylinder(d=7, h=3.5, $fn=100);
}
difference() {
translate([0,0,12]) cylinder(d=22, h=28, $fn=100);
translate([0,0,11]) cylinder(d=16, h=30, $fn=100);
}
translate([0,0,15]) cylinder(d=12, 26, $fn=100););
}
Sent from Mail for Windows
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
Hi Adrian,
My understanding is that 'z fighting' indicates a situation where there
is some indecision as to which of the two or more of the 'fighting
faces' should be used. In the physical world, it is the same, you would
not bore a hole exactly the same depth as the workpiece, the result will
not be what you may expect. I believe is is good practice to avoid these
sort of errors, even if the object renders OK to an stl, say.
The principle I tried to explain, avoids z-fighting on the cylinder
boundaries, since there are no boundaries, and the flat faces, which I
tested, seem OK too. I think, that generally I use differences for
forming shapes into an object, but unions to generate the external shape.
On 05/03/2022 12:24, Adrian Mariano wrote:
Does z-fighting from unions matter for rendering? Since OP is blind I
would assume he doesn't care if the preview looks bad, but only if the
render is correct.
I think z-fighting is a result of the fact that preview just displays
all the objects in the model without doing any actual union or
difference operations, and when you have two objects displayed with
overlaid faces, you get the funny looking faces. It doesn't
necessarily mean that anything will go wrong in render, which is a
completely different process. Now as you say, there may be
"indecision" at such surfaces about the model, but if you think about
it carefully, this indecision is only a problem with difference
operations, where you have the potential to leave a thin slice behind
if your subtracted object is round-of-error smaller than the parent.
Indecision in unions will just mean that you don't know where exactly
the final face is. As far as I can tell, It appears harmless.
On Sat, Mar 5, 2022 at 9:30 AM Raymond West raywest@raywest.com wrote:
Hi Adrian,
My understanding is that 'z fighting' indicates a situation where there
is some indecision as to which of the two or more of the 'fighting
faces' should be used. In the physical world, it is the same, you would
not bore a hole exactly the same depth as the workpiece, the result will
not be what you may expect. I believe is is good practice to avoid these
sort of errors, even if the object renders OK to an stl, say.
The principle I tried to explain, avoids z-fighting on the cylinder
boundaries, since there are no boundaries, and the flat faces, which I
tested, seem OK too. I think, that generally I use differences for
forming shapes into an object, but unions to generate the external shape.
On 05/03/2022 12:24, Adrian Mariano wrote:
Does z-fighting from unions matter for rendering? Since OP is blind I
would assume he doesn't care if the preview looks bad, but only if the
render is correct.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Actually there are two kinds of unions: if you are unioning objects
that just share a face then if they don't overlap you could get a tiny
space in between, which would be bad in render. If you're union
objects that do overlap, it seems like there should be no problem. In
the former case, the problematic area is inside, so you can't get
z-fighting.
It seems like getting z-fighting in the other case requires doing
something to get multiple colors, like this:
cube(10); color("green")translate([5,5])cube(10);
There is z-fighting, but no problem here, I think.
On Sat, Mar 5, 2022 at 9:39 AM Adrian Mariano avm4@cornell.edu wrote:
I think z-fighting is a result of the fact that preview just displays
all the objects in the model without doing any actual union or
difference operations, and when you have two objects displayed with
overlaid faces, you get the funny looking faces. It doesn't
necessarily mean that anything will go wrong in render, which is a
completely different process. Now as you say, there may be
"indecision" at such surfaces about the model, but if you think about
it carefully, this indecision is only a problem with difference
operations, where you have the potential to leave a thin slice behind
if your subtracted object is round-of-error smaller than the parent.
Indecision in unions will just mean that you don't know where exactly
the final face is. As far as I can tell, It appears harmless.
On Sat, Mar 5, 2022 at 9:30 AM Raymond West raywest@raywest.com wrote:
Hi Adrian,
My understanding is that 'z fighting' indicates a situation where there
is some indecision as to which of the two or more of the 'fighting
faces' should be used. In the physical world, it is the same, you would
not bore a hole exactly the same depth as the workpiece, the result will
not be what you may expect. I believe is is good practice to avoid these
sort of errors, even if the object renders OK to an stl, say.The principle I tried to explain, avoids z-fighting on the cylinder
boundaries, since there are no boundaries, and the flat faces, which I
tested, seem OK too. I think, that generally I use differences for
forming shapes into an object, but unions to generate the external shape.On 05/03/2022 12:24, Adrian Mariano wrote:
Does z-fighting from unions matter for rendering? Since OP is blind I
would assume he doesn't care if the preview looks bad, but only if the
render is correct.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
On Sat, 2022-03-05 at 14:29 +0000, Raymond West wrote:
My understanding is that 'z fighting' indicates a situation where
there is some indecision as to which of the two or more of the
'fighting faces' should be used. In the physical world, it is the
same, you would not bore a hole exactly the same depth as the
workpiece, the result will not be what you may expect. I believe is
is good practice to avoid these sort of errors, even if the object
renders OK to an stl, say.
This brings to mind a puzzle I read when I was a teenager.
If you bore a hole through the center of a sphere such that the length
of the hole is 6", what is the volume of the remaining material?
To avoid any quibbles, here is an unlabelled picture of the result.
The 6" is the Z height of the figure.
There is a mathematical way to determine the answer, but there's a
logical way to do it.
And yes, the question has all the information required.
If you know the answer from having seen the puzzle before, don't give
it out too soon.
I get 36 PI
On Sun, 6 Mar 2022 at 16:37, larry lar3ry@sasktel.net wrote:
On Sat, 2022-03-05 at 14:29 +0000, Raymond West wrote:
My understanding is that 'z fighting' indicates a situation where
there is some indecision as to which of the two or more of the
'fighting faces' should be used. In the physical world, it is the
same, you would not bore a hole exactly the same depth as the
workpiece, the result will not be what you may expect. I believe is
is good practice to avoid these sort of errors, even if the object
renders OK to an stl, say.
This brings to mind a puzzle I read when I was a teenager.
If you bore a hole through the center of a sphere such that the length
of the hole is 6", what is the volume of the remaining material?
To avoid any quibbles, here is an unlabelled picture of the result.
The 6" is the Z height of the figure.
There is a mathematical way to determine the answer, but there's a
logical way to do it.
And yes, the question has all the information required.
If you know the answer from having seen the puzzle before, don't give
it out too soon.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Do not read if you are still pondering the puzzle...
It is the volume of a sphere that is the same diameter as the height of the
drilled cylinder.
For a 6 inch height, it is 36(pi) inches.
I found the answer by considering the limit whereby the diameter of the
cylinder approaches zero.
On Sun, Mar 6, 2022 at 19:40 nop head nop.head@gmail.com wrote:
I get 36 PI
On Sun, 6 Mar 2022 at 16:37, larry lar3ry@sasktel.net wrote:
On Sat, 2022-03-05 at 14:29 +0000, Raymond West wrote:
My understanding is that 'z fighting' indicates a situation where
there is some indecision as to which of the two or more of the
'fighting faces' should be used. In the physical world, it is the
same, you would not bore a hole exactly the same depth as the
workpiece, the result will not be what you may expect. I believe is
is good practice to avoid these sort of errors, even if the object
renders OK to an stl, say.
This brings to mind a puzzle I read when I was a teenager.
If you bore a hole through the center of a sphere such that the length
of the hole is 6", what is the volume of the remaining material?
To avoid any quibbles, here is an unlabelled picture of the result.
The 6" is the Z height of the figure.
There is a mathematical way to determine the answer, but there's a
logical way to do it.
And yes, the question has all the information required.
If you know the answer from having seen the puzzle before, don't give
it out too soon.
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
On 07/03/2022 08:35, FF Systems wrote:
Do not read if you are still pondering the puzzle...
It is the volume of a sphere that is the same diameter as the height
of the drilled cylinder.
Not in my reasoning since op said
To avoid any quibbles, here is an unlabelled picture of the result.
The 6" is the Z height of the figure.
The diameter of the sphere is not the height of the drilled cylinder.
The diameter of the sphere is the 'diagonal' of the cylinder.