summaryrefslogtreecommitdiff
path: root/testdata/scad/features/resize-2d-tests.scad
blob: 76da09eb747a190e92020b385391a49e39001296 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// red = reference

$fn=10;

// two simple holes
module shape(){
	difference() {
		square([5,5]);
		translate([1,1]) square();
		translate([3,3]) circle();
	}
}

// holes that have problems (duplicate vertex)
module shape2(){
	difference() {
		square([5,5]);
		translate([1,1]) square();
		translate([2,2]) square();
	}
}

// one square split into two by another
module shape3(){
	difference() {
		square([5,5]);
		translate([0,2.5]) square([5,1]);
	}
}

translate([0,0]) resize([15,15]) shape();
translate([0,16]) resize([15,15,0]) shape2();
translate([0,32]) resize([15,15]) shape3();

color("red") {
translate([-16,0]) scale([3,3]) shape();
translate([-16,16]) scale([3,3]) shape2();
translate([-16,32]) scale([3,3]) shape3();
}

color("green"){
translate([16,0]) resize([15,0],auto=true) shape();
translate([16,16]) resize([0,15],auto=true) shape2();
translate([16,32]) resize([0,0,15],auto=true) shape3();
}
contact: Jan Huwald // Impressum