discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Question about Volumes

JB
Jordan Brown
Sat, Jun 4, 2022 10:33 PM

I simplified your latticework a little, making it smaller and so easier
to look at and render, and took away the enclosing cylinder so that I
can look at the edges of the lattice.

In particular, where you have this:

//difference() {
//    cylinder(d=33,h=23,$fn=120);
//    difference() {
//        translate([0,0,-1]) cylinder(d=30,h=25,$fn=120);
//        cubicXlattice(4,[-5,5],[-5,5],[-1,7],0.1);
//    }
//}

I now have this:

    intersection() {
        translate([0,0,-1]) cylinder(d=20,h=25,$fn=120);
        cubicXlattice(4,[-3,3],[-3,3],[-1,2],0.1);
    }

so what I have is this lattice:

I see a couple of things that could be related to your unexpected number
of volumes.

Notice, for instance, this little tidbit of lattice that's all by
itself, because of the way that the cylinder happened to cut it:

Can you end up with one of these "orphans" floating free of both the
lattice and the cylinder?  I'm not sure, but as you start chopping the
cylinder up with cross-sections, it wouldn't surprise me at all.

Nearby (just to the left of the orphaned piece), look at this intersection:

If I make the cylinder just a tiny bit smaller (d=18.7), take a look at it:

See that tiny void between the four struts?  It looks like the four
struts are all fully in contact with the cylinder, leaving that tiny
void between them, enclosed on five (or maybe six) sides by struts and
the cylinder.  That would count as a separate volume.

Are there any such voids in your original lattice and cylinder?  No
idea, but it certainly looks like there could be.

Anyhow, that would be my guess as to how you're ending up with something
that isn't exactly two volumes.

I simplified your latticework a little, making it smaller and so easier to look at and render, and took away the enclosing cylinder so that I can look at the edges of the lattice. In particular, where you have this: //difference() { // cylinder(d=33,h=23,$fn=120); // difference() { // translate([0,0,-1]) cylinder(d=30,h=25,$fn=120); // cubicXlattice(4,[-5,5],[-5,5],[-1,7],0.1); // } //} I now have this: intersection() { translate([0,0,-1]) cylinder(d=20,h=25,$fn=120); cubicXlattice(4,[-3,3],[-3,3],[-1,2],0.1); } so what I have is this lattice: I see a couple of things that could be related to your unexpected number of volumes. Notice, for instance, this little tidbit of lattice that's all by itself, because of the way that the cylinder happened to cut it: Can you end up with one of these "orphans" floating free of both the lattice and the cylinder?  I'm not sure, but as you start chopping the cylinder up with cross-sections, it wouldn't surprise me at all. Nearby (just to the left of the orphaned piece), look at this intersection: If I make the cylinder just a tiny bit smaller (d=18.7), take a look at it: See that tiny void between the four struts?  It looks like the four struts are all fully in contact with the cylinder, leaving that tiny void between them, enclosed on five (or maybe six) sides by struts and the cylinder.  That would count as a separate volume. Are there any such voids in your original lattice and cylinder?  No idea, but it certainly looks like there could be. Anyhow, that would be my guess as to how you're ending up with something that isn't exactly two volumes.