discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

nested difference to subtract from solid

RW
Raymond West
Sat, Mar 5, 2022 12:17 PM

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

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
AM
Adrian Mariano
Sat, Mar 5, 2022 12:24 PM

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

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
BC
Bob Carter
Sat, Mar 5, 2022 12:50 PM

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

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
RW
Raymond West
Sat, Mar 5, 2022 2:29 PM

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.

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. > >
AM
Adrian Mariano
Sat, Mar 5, 2022 2:39 PM

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

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
AM
Adrian Mariano
Sat, Mar 5, 2022 2:50 PM

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

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
L
larry
Sun, Mar 6, 2022 4:37 PM

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.

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.
NH
nop head
Mon, Mar 7, 2022 1:39 AM

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

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 >
FS
FF Systems
Mon, Mar 7, 2022 8:35 AM

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

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 >
RW
Raymond West
Mon, Mar 7, 2022 1:18 PM

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.

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.