Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1478 from openscad/rotate_extrude-angle
Angle parameter for rotate_extrude
- Loading branch information
Showing
22 changed files
with
381 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
$fa=15; | ||
$fs=4; | ||
|
||
module face(x) { | ||
translate([x,0]) difference() { | ||
square(10,center=true); | ||
square(5,center=true); | ||
} | ||
} | ||
|
||
module face2() { | ||
translate([5,0]) square(5); | ||
} | ||
|
||
// test negative partial angles and geometries on -X side | ||
rotate_extrude(angle=45) face(10); | ||
rotate_extrude(angle=45) face(-10); | ||
rotate_extrude(angle=-45) face(21); | ||
rotate_extrude(angle=-45) face(-21); | ||
|
||
// test small angles, angle < $fa, render a single segment | ||
rotate([0,0,90]) { | ||
rotate_extrude(angle=5) face(10); | ||
rotate_extrude(angle=5) face(-10); | ||
rotate_extrude(angle=-5) face(21); | ||
rotate_extrude(angle=-5) face(-21); | ||
} | ||
|
||
// show nothing | ||
rotate_extrude(angle=0) face(5); // 0 angle | ||
|
||
// various angles treated as full circle | ||
translate([-40,40]) rotate_extrude() face2(); // unspecified | ||
translate([0,40]) rotate_extrude(angle=0/0) face2(); // NaN | ||
translate([40,40]) rotate_extrude(angle=1/0) face2(); // Infinity | ||
translate([-40,0]) rotate_extrude(angle=-1/0) face2(); // -Infinity | ||
translate([40,0]) rotate_extrude(angle=360) face2(); // 360 | ||
translate([-40,-40]) rotate_extrude(angle=-360) face2(); // -360 | ||
translate([0,-40]) rotate_extrude(angle=1000) face2(); // > 360 | ||
translate([40,-40]) rotate_extrude(angle=-1000) face2(); // < -360 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
group() { | ||
group(); | ||
% linear_extrude(height = 22, center = true, convexity = 10, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2) { | ||
import(file = "example009.dxf", layer = "body", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2); | ||
import(file = "example009.dxf", layer = "body", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2, timestamp = 1447128393); | ||
} | ||
% group() { | ||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 12], [0, 0, 0, 1]]) { | ||
linear_extrude(height = 2, center = true, convexity = 10, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2) { | ||
import(file = "example009.dxf", layer = "plate", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2); | ||
import(file = "example009.dxf", layer = "plate", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2, timestamp = 1447128393); | ||
} | ||
} | ||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -12], [0, 0, 0, 1]]) { | ||
linear_extrude(height = 2, center = true, convexity = 10, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2) { | ||
import(file = "example009.dxf", layer = "plate", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2); | ||
import(file = "example009.dxf", layer = "plate", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2, timestamp = 1447128393); | ||
} | ||
} | ||
} | ||
intersection() { | ||
linear_extrude(height = 20, center = true, convexity = 10, twist = -57.5288, slices = 4, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2) { | ||
import(file = "example009.dxf", layer = "fan_top", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2); | ||
import(file = "example009.dxf", layer = "fan_top", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2, timestamp = 1447128393); | ||
} | ||
rotate_extrude(convexity = 10, $fn = 0, $fa = 12, $fs = 2) { | ||
import(file = "example009.dxf", layer = "fan_side", origin = [0, -40], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2); | ||
rotate_extrude(angle = 360, convexity = 10, $fn = 0, $fa = 12, $fs = 2) { | ||
import(file = "example009.dxf", layer = "fan_side", origin = [0, -40], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2, timestamp = 1447128393); | ||
} | ||
} | ||
} |
Oops, something went wrong.