Quantcast

Fwd: Getting two volumes

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: Getting two volumes

Nuno Cruz
So I have this code and I was thinking that I would just output one volume, so the I could export it to STL, but instead it's coming with two volumes.

Can someone help me?


union() {

translate( [15, 57, 2] ) cube( size = [4, 1, 2], center = false);
translate( [21, 57, 2] ) cube( size = [5, 1, 2], center = false);
translate( [14, 56, 2] ) cube( size = [12, 1, 2], center = false);
translate( [14, 55, 2] ) cube( size = [4, 1, 2], center = false);
translate( [19, 55, 2] ) cube( size = [7, 1, 2], center = false);
translate( [13, 54, 2] ) cube( size = [4, 1, 2], center = false);
translate( [19, 54, 2] ) cube( size = [7, 1, 2], center = false);
translate( [18, 53, 2] ) cube( size = [8, 1, 2], center = false);
translate( [31, 53, 2] ) cube( size = [2, 1, 2], center = false);
translate( [12, 52, 2] ) cube( size = [4, 1, 2], center = false);
translate( [17, 52, 2] ) cube( size = [9, 1, 2], center = false);
translate( [31, 52, 2] ) cube( size = [2, 1, 2], center = false);
translate( [19, 51, 2] ) cube( size = [7, 1, 2], center = false);
translate( [44, 51, 2] ) cube( size = [4, 1, 2], center = false);
translate( [20, 50, 2] ) cube( size = [6, 1, 2], center = false);
translate( [44, 50, 2] ) cube( size = [4, 1, 2], center = false);
translate( [8, 49, 2] ) cube( size = [2, 1, 2], center = false);
translate( [11, 49, 2] ) cube( size = [3, 1, 2], center = false);
translate( [20, 49, 2] ) cube( size = [6, 1, 2], center = false);
translate( [43, 49, 2] ) cube( size = [6, 1, 2], center = false);
translate( [8, 48, 2] ) cube( size = [4, 1, 2], center = false);
translate( [13, 48, 2] ) cube( size = [3, 1, 2], center = false);
translate( [20, 48, 2] ) cube( size = [6, 1, 2], center = false);
translate( [40, 48, 2] ) cube( size = [10, 1, 2], center = false);
translate( [52, 48, 2] ) cube( size = [2, 1, 2], center = false);
translate( [2, 47, 2] ) cube( size = [3, 1, 2], center = false);
translate( [9, 47, 2] ) cube( size = [3, 1, 2], center = false);
translate( [13, 47, 2] ) cube( size = [5, 1, 2], center = false);
translate( [20, 47, 2] ) cube( size = [5, 1, 2], center = false);
translate( [40, 47, 2] ) cube( size = [16, 1, 2], center = false);
translate( [2, 46, 2] ) cube( size = [8, 1, 2], center = false);
translate( [16, 46, 2] ) cube( size = [2, 1, 2], center = false);
translate( [20, 46, 2] ) cube( size = [4, 1, 2], center = false);
translate( [32, 46, 2] ) cube( size = [3, 1, 2], center = false);
translate( [39, 46, 2] ) cube( size = [19, 1, 2], center = false);
translate( [2, 45, 2] ) cube( size = [13, 1, 2], center = false);
translate( [20, 45, 2] ) cube( size = [2, 1, 2], center = false);
translate( [33, 45, 2] ) cube( size = [25, 1, 2], center = false);
translate( [2, 44, 2] ) cube( size = [12, 1, 2], center = false);
translate( [15, 44, 2] ) cube( size = [2, 1, 2], center = false);
translate( [20, 44, 2] ) cube( size = [2, 1, 2], center = false);
translate( [30, 44, 2] ) cube( size = [28, 1, 2], center = false);
translate( [6, 43, 2] ) cube( size = [8, 1, 2], center = false);
translate( [30, 43, 2] ) cube( size = [2, 1, 2], center = false);
translate( [33, 43, 2] ) cube( size = [22, 1, 2], center = false);
translate( [7, 42, 2] ) cube( size = [7, 1, 2], center = false);
translate( [16, 42, 2] ) cube( size = [3, 1, 2], center = false);
translate( [33, 42, 2] ) cube( size = [19, 1, 2], center = false);
translate( [8, 41, 2] ) cube( size = [7, 1, 2], center = false);
translate( [16, 41, 2] ) cube( size = [3, 1, 2], center = false);
translate( [27, 41, 2] ) cube( size = [2, 1, 2], center = false);
translate( [30, 41, 2] ) cube( size = [22, 1, 2], center = false);
translate( [8, 40, 2] ) cube( size = [11, 1, 2], center = false);
translate( [29, 40, 2] ) cube( size = [23, 1, 2], center = false);
translate( [8, 39, 2] ) cube( size = [9, 1, 2], center = false);
translate( [27, 39, 2] ) cube( size = [3, 1, 2], center = false);
translate( [31, 39, 2] ) cube( size = [2, 1, 2], center = false);
translate( [38, 39, 2] ) cube( size = [13, 1, 2], center = false);
translate( [8, 38, 2] ) cube( size = [9, 1, 2], center = false);
translate( [27, 38, 2] ) cube( size = [3, 1, 2], center = false);
translate( [33, 38, 2] ) cube( size = [16, 1, 2], center = false);
translate( [8, 37, 2] ) cube( size = [8, 1, 2], center = false);
translate( [29, 37, 2] ) cube( size = [2, 1, 2], center = false);
translate( [35, 37, 2] ) cube( size = [14, 1, 2], center = false);
translate( [9, 36, 2] ) cube( size = [6, 1, 2], center = false);
translate( [27, 36, 2] ) cube( size = [23, 1, 2], center = false);
translate( [11, 35, 2] ) cube( size = [3, 1, 2], center = false);
translate( [26, 35, 2] ) cube( size = [23, 1, 2], center = false);
translate( [11, 34, 2] ) cube( size = [3, 1, 2], center = false);
translate( [26, 34, 2] ) cube( size = [9, 1, 2], center = false);
translate( [36, 34, 2] ) cube( size = [3, 1, 2], center = false);
translate( [41, 34, 2] ) cube( size = [7, 1, 2], center = false);
translate( [12, 33, 2] ) cube( size = [4, 1, 2], center = false);
translate( [26, 33, 2] ) cube( size = [10, 1, 2], center = false);
translate( [14, 32, 2] ) cube( size = [6, 1, 2], center = false);
translate( [27, 32, 2] ) cube( size = [11, 1, 2], center = false);
translate( [16, 31, 2] ) cube( size = [4, 1, 2], center = false);
translate( [31, 31, 2] ) cube( size = [6, 1, 2], center = false);
translate( [15, 30, 2] ) cube( size = [7, 1, 2], center = false);
translate( [31, 30, 2] ) cube( size = [5, 1, 2], center = false);
translate( [16, 29, 2] ) cube( size = [7, 1, 2], center = false);
translate( [32, 29, 2] ) cube( size = [4, 1, 2], center = false);
translate( [16, 28, 2] ) cube( size = [7, 1, 2], center = false);
translate( [32, 28, 2] ) cube( size = [4, 1, 2], center = false);
translate( [50, 28, 2] ) cube( size = [2, 1, 2], center = false);
translate( [17, 27, 2] ) cube( size = [4, 1, 2], center = false);
translate( [32, 27, 2] ) cube( size = [3, 1, 2], center = false);
translate( [48, 27, 2] ) cube( size = [6, 1, 2], center = false);
translate( [17, 26, 2] ) cube( size = [3, 1, 2], center = false);
translate( [32, 26, 2] ) cube( size = [2, 1, 2], center = false);
translate( [48, 26, 2] ) cube( size = [7, 1, 2], center = false);
translate( [17, 25, 2] ) cube( size = [3, 1, 2], center = false);
translate( [32, 25, 2] ) cube( size = [2, 1, 2], center = false);
translate( [48, 25, 2] ) cube( size = [2, 1, 2], center = false);
translate( [51, 25, 2] ) cube( size = [4, 1, 2], center = false);
translate( [17, 24, 2] ) cube( size = [3, 1, 2], center = false);
translate( [52, 24, 2] ) cube( size = [2, 1, 2], center = false);
translate( [17, 23, 2] ) cube( size = [2, 1, 2], center = false);
translate( [36, 15, 2] ) cube( size = [5, 1, 2], center = false);
translate( [42, 15, 2] ) cube( size = [13, 1, 2], center = false);
translate( [17, 14, 2] ) cube( size = [2, 1, 2], center = false);
translate( [28, 14, 2] ) cube( size = [4, 1, 2], center = false);
translate( [33, 14, 2] ) cube( size = [23, 1, 2], center = false);
translate( [16, 13, 2] ) cube( size = [3, 1, 2], center = false);
translate( [26, 13, 2] ) cube( size = [31, 1, 2], center = false);
translate( [12, 12, 2] ) cube( size = [7, 1, 2], center = false);
translate( [26, 12, 2] ) cube( size = [30, 1, 2], center = false);
translate( [6, 11, 2] ) cube( size = [13, 1, 2], center = false);
translate( [25, 11, 2] ) cube( size = [31, 1, 2], center = false);
translate( [5, 10, 2] ) cube( size = [15, 1, 2], center = false);
translate( [25, 10, 2] ) cube( size = [31, 1, 2], center = false);
translate( [2, 9, 2] ) cube( size = [56, 1, 2], center = false);
translate( [0, 8, 2] ) cube( size = [58, 1, 2], center = false);
translate( [1, 7, 2] ) cube( size = [58, 1, 2], center = false);
translate( [1, 6, 2] ) cube( size = [58, 1, 2], center = false);
translate( [1, 5, 2] ) cube( size = [58, 1, 2], center = false);
translate( [1, 4, 2] ) cube( size = [58, 1, 2], center = false);
translate( [1, 3, 2] ) cube( size = [58, 1, 2], center = false);
translate( [1, 2, 2] ) cube( size = [58, 1, 2], center = false);
translate( [1, 1, 2] ) cube( size = [58, 1, 2], center = false);
cube( size = [60, 60, 2], center = false);
}



Cumprimentos
Nuno Cruz

Twitter: twitter.com/nuno_cruz
IM: [hidden email]
Skype: nuno.marques.cruz
webpage: nunocruz.com.pt

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Getting two volumes

Clifford Wolf
Hi,

On Sat, Dec 05, 2009 at 02:12:06AM +0000, Nuno Cruz wrote:
> So I have this code and I was thinking that I would just output one
> volume, so the I could export it to STL, but instead it's coming with
> two volumes.
> Can someone help me?

your problem is not the number of volumes. a design with two volumes
contains one object. the volumes are the inside of the object and the
outside space.

you problem is that your object is not a valid 2-manifold. here is a little
example demonstrating what goes wrong with your design:

        module example1() {
                cube([20, 20, 20]);
                translate([-20, -20, 0]) cube([20, 20, 20]);
                cube([50, 50, 5], center = true);
        }

        module example2() {
                cube([20.1, 20.1, 20]);
                translate([-20, -20, 0]) cube([20.1, 20.1, 20]);
                cube([50, 50, 5], center = true);
        }

the example1 module is not a valid 2-manifold because both cubes are
charing one edge. they touch each other but do not intersect. example2
is a valid 2-manifold because there is an intersection. now the 'each edge
must connect exactly two facets' constraints of 2-manifolds is is met.

yours,
 - clifford

--
"Paranoia is faith in a hidden order behind the visible."
 - pi, the movie

Loading...