Split projection tests into cut vs. project
|
@ -0,0 +1,15 @@
|
|||
// 2D child
|
||||
projection(cut=true) { square(); }
|
||||
|
||||
projection(cut=true) translate([20,0,0]) cube(10, center=true);
|
||||
|
||||
// Boundary case: clipping the top of a cube
|
||||
translate([0,20,0]) projection(cut=true) translate([0,0,-4.999999]) cube(10, center=true);
|
||||
|
||||
// holes
|
||||
translate([0,-10,0]) projection(cut=true) {
|
||||
union() {
|
||||
difference() { cube(5,center=true); cube(4,center=true); }
|
||||
translate([2.1,2.1]) difference() { cube(5,center=true); cube(4,center=true); }
|
||||
}
|
||||
}
|
|
@ -3,17 +3,25 @@ projection();
|
|||
// No children
|
||||
projection() { }
|
||||
// 2D child
|
||||
projection(cut=true) { square(); }
|
||||
projection() { square(); }
|
||||
|
||||
// Simple
|
||||
projection(cut=false) cube(10);
|
||||
projection(cut=true) translate([20,0,0]) cube(10, center=true);
|
||||
// Boundary case: clipping the top of a cube
|
||||
translate([0,20,0]) projection(cut=true) translate([0,0,-4.999999]) cube(10, center=true);
|
||||
|
||||
// holes
|
||||
translate([0,-10,0]) projection(cut=true) {
|
||||
union() {
|
||||
difference() { cube(5,center=true); cube(4,center=true); }
|
||||
translate([2.1,2.1]) difference() { cube(5,center=true); cube(4,center=true); }
|
||||
}
|
||||
// Two children
|
||||
translate([-12,0]) projection(cut=false) {
|
||||
cube(10);
|
||||
difference() {
|
||||
sphere(10);
|
||||
cylinder(h=30, r=5, center=true);
|
||||
}
|
||||
}
|
||||
|
||||
// Holes
|
||||
translate([6,-12]) projection(cut=false) {
|
||||
cube(10);
|
||||
difference() {
|
||||
sphere(10);
|
||||
cylinder(h=30, r=5, center=true);
|
||||
}
|
||||
}
|
||||
|
|
After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.7 KiB |
|
@ -0,0 +1,33 @@
|
|||
group() {
|
||||
projection(cut = true, convexity = 0) {
|
||||
square(size = [1, 1], center = false);
|
||||
}
|
||||
projection(cut = true, convexity = 0) {
|
||||
multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
cube(size = [10, 10, 10], center = true);
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 20], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
projection(cut = true, convexity = 0) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -4.999999], [0, 0, 0, 1]]) {
|
||||
cube(size = [10, 10, 10], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
projection(cut = true, convexity = 0) {
|
||||
union() {
|
||||
difference() {
|
||||
cube(size = [5, 5, 5], center = true);
|
||||
cube(size = [4, 4, 4], center = true);
|
||||
}
|
||||
multmatrix([[1, 0, 0, 2.1], [0, 1, 0, 2.1], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
difference() {
|
||||
cube(size = [5, 5, 5], center = true);
|
||||
cube(size = [4, 4, 4], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,37 +1,27 @@
|
|||
group() {
|
||||
projection(cut = false, convexity = 0);
|
||||
projection(cut = false, convexity = 0);
|
||||
projection(cut = true, convexity = 0) {
|
||||
projection(cut = false, convexity = 0) {
|
||||
square(size = [1, 1], center = false);
|
||||
}
|
||||
projection(cut = false, convexity = 0) {
|
||||
cube(size = [10, 10, 10], center = false);
|
||||
}
|
||||
projection(cut = true, convexity = 0) {
|
||||
multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
cube(size = [10, 10, 10], center = true);
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 20], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
projection(cut = true, convexity = 0) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -4.999999], [0, 0, 0, 1]]) {
|
||||
cube(size = [10, 10, 10], center = true);
|
||||
multmatrix([[1, 0, 0, -12], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
projection(cut = false, convexity = 0) {
|
||||
cube(size = [10, 10, 10], center = false);
|
||||
difference() {
|
||||
sphere($fn = 0, $fa = 12, $fs = 2, r = 10);
|
||||
cylinder($fn = 0, $fa = 12, $fs = 2, h = 30, r1 = 5, r2 = 5, center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
projection(cut = true, convexity = 0) {
|
||||
union() {
|
||||
difference() {
|
||||
cube(size = [5, 5, 5], center = true);
|
||||
cube(size = [4, 4, 4], center = true);
|
||||
}
|
||||
multmatrix([[1, 0, 0, 2.1], [0, 1, 0, 2.1], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
difference() {
|
||||
cube(size = [5, 5, 5], center = true);
|
||||
cube(size = [4, 4, 4], center = true);
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 6], [0, 1, 0, -12], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
projection(cut = false, convexity = 0) {
|
||||
cube(size = [10, 10, 10], center = false);
|
||||
difference() {
|
||||
sphere($fn = 0, $fa = 12, $fs = 2, r = 10);
|
||||
cylinder($fn = 0, $fa = 12, $fs = 2, h = 30, r1 = 5, r2 = 5, center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
After Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.6 KiB |