Merge pull request #1489 from thehans/master
resolve remaining tests, add new test, and updated example
|
|
@ -1,8 +1,8 @@
|
|||
echo(version=version());
|
||||
|
||||
// rotate_extrude() always rotates the 2D shape 360 degrees
|
||||
// around the Z axis. Note that the 2D shape must be either
|
||||
// completely on the positive or negative side of the X axis.
|
||||
// rotate_extrude() rotates a 2D shape around the Z axis.
|
||||
// Note that the 2D shape must be either completely on the
|
||||
// positive or negative side of the X axis.
|
||||
color("red")
|
||||
rotate_extrude()
|
||||
translate([10, 0])
|
||||
|
|
@ -23,6 +23,26 @@ color("green")
|
|||
polygon( points=[[0,0],[8,4],[4,8],[4,12],[12,16],[0,20]] );
|
||||
|
||||
|
||||
// By default rotate_extrude forms a full 360 degree circle,
|
||||
// but a partial rotation can be performed by using the angle parameter.
|
||||
// Positive angles create an arc starting from the X axis, going counter-clockwise.
|
||||
// Negative angles generate an arc in the clockwise direction.
|
||||
color("magenta")
|
||||
translate([40,40]){
|
||||
rotate_extrude(angle=180)
|
||||
translate([12.5,0])
|
||||
square(5);
|
||||
translate([7.5,0])
|
||||
rotate_extrude(angle=180)
|
||||
translate([5,0])
|
||||
square(5);
|
||||
translate([-7.5,0])
|
||||
rotate_extrude(angle=-180)
|
||||
translate([5,0])
|
||||
square(5);
|
||||
}
|
||||
|
||||
|
||||
// Written in 2015 by Torsten Paul <Torsten.Paul@gmx.de>
|
||||
//
|
||||
// To the extent possible under law, the author(s) have dedicated all
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ AbstractNode *RotateExtrudeModule::instantiate(const Context *ctx, const ModuleI
|
|||
RotateExtrudeNode *node = new RotateExtrudeNode(inst);
|
||||
|
||||
AssignmentList args;
|
||||
args += Assignment("file"), Assignment("layer"), Assignment("origin"), Assignment("scale"), Assignment("angle");
|
||||
args += Assignment("file"), Assignment("layer"), Assignment("origin"), Assignment("scale");
|
||||
|
||||
Context c(ctx);
|
||||
c.setVariables(args, evalctx);
|
||||
|
|
@ -115,8 +115,8 @@ std::string RotateExtrudeNode::toString() const
|
|||
;
|
||||
}
|
||||
stream <<
|
||||
"convexity = " << this->convexity << ", "
|
||||
"angle = " << this->angle << ", "
|
||||
"convexity = " << this->convexity << ", "
|
||||
"$fn = " << this->fn << ", $fa = " << this->fa << ", $fs = " << this->fs << ")";
|
||||
|
||||
return stream.str();
|
||||
|
|
|
|||
40
testdata/scad/3D/features/rotate_extrude-angle.scad
vendored
Normal file
|
|
@ -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
|
||||
BIN
tests/regression/cgalpngtest/rotate_extrude-angle-expected.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 12 KiB |
|
|
@ -3,25 +3,25 @@ group() {
|
|||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -10], [0, 0, 0, 1]]) {
|
||||
group() {
|
||||
difference() {
|
||||
rotate_extrude(convexity = 3, $fn = 0, $fa = 12, $fs = 2) {
|
||||
import(file = "example007.dxf", layer = "dorn", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
|
||||
rotate_extrude(angle = 360, convexity = 3, $fn = 0, $fa = 12, $fs = 2) {
|
||||
import(file = "example007.dxf", layer = "dorn", 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, 0], [0, 0, 0, 1]]) {
|
||||
group() {
|
||||
intersection() {
|
||||
multmatrix([[1, 0, 0, 0], [0, 0, -1, 0], [0, 1, 0, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -50], [0, 0, 0, 1]]) {
|
||||
linear_extrude(height = 100, center = false, convexity = 1, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2) {
|
||||
import(file = "example007.dxf", layer = "cutout1", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
|
||||
import(file = "example007.dxf", layer = "cutout1", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2, timestamp = 1447128393);
|
||||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[0, -1, 0, 0], [1, 0, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 0, -1, 0], [0, 1, 0, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[6.12323e-17, -1, 0, 0], [1, 6.12323e-17, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -50], [0, 0, 0, 1]]) {
|
||||
linear_extrude(height = 100, center = false, convexity = 2, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2) {
|
||||
import(file = "example007.dxf", layer = "cutout2", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
|
||||
import(file = "example007.dxf", layer = "cutout2", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2, timestamp = 1447128393);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -29,21 +29,21 @@ group() {
|
|||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[0, -1, 0, 0], [1, 0, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[6.12323e-17, -1, 0, 0], [1, 6.12323e-17, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
group() {
|
||||
intersection() {
|
||||
multmatrix([[1, 0, 0, 0], [0, 0, -1, 0], [0, 1, 0, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -50], [0, 0, 0, 1]]) {
|
||||
linear_extrude(height = 100, center = false, convexity = 1, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2) {
|
||||
import(file = "example007.dxf", layer = "cutout1", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
|
||||
import(file = "example007.dxf", layer = "cutout1", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2, timestamp = 1447128393);
|
||||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[0, -1, 0, 0], [1, 0, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 0, -1, 0], [0, 1, 0, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[6.12323e-17, -1, 0, 0], [1, 6.12323e-17, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -50], [0, 0, 0, 1]]) {
|
||||
linear_extrude(height = 100, center = false, convexity = 2, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2) {
|
||||
import(file = "example007.dxf", layer = "cutout2", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
|
||||
import(file = "example007.dxf", layer = "cutout2", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2, timestamp = 1447128393);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,12 +15,12 @@ group() {
|
|||
square(size = [6, 10], center = true);
|
||||
}
|
||||
}
|
||||
multmatrix([[-0.5, -0.86602540378, 0, 0], [0.86602540378, -0.5, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[-0.5, -0.866025, 0, 0], [0.866025, -0.5, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 36], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
square(size = [6, 10], center = true);
|
||||
}
|
||||
}
|
||||
multmatrix([[-0.5, 0.86602540378, 0, 0], [-0.86602540378, -0.5, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[-0.5, 0.866025, 0, 0], [-0.866025, -0.5, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 36], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
square(size = [6, 10], center = true);
|
||||
}
|
||||
|
|
@ -41,12 +41,12 @@ group() {
|
|||
square(size = [6, 15], center = true);
|
||||
}
|
||||
}
|
||||
multmatrix([[-0.5, -0.86602540378, 0, 0], [0.86602540378, -0.5, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[-0.5, -0.866025, 0, 0], [0.866025, -0.5, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 88.5], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
square(size = [6, 15], center = true);
|
||||
}
|
||||
}
|
||||
multmatrix([[-0.5, 0.86602540378, 0, 0], [-0.86602540378, -0.5, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[-0.5, 0.866025, 0, 0], [-0.866025, -0.5, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 88.5], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
square(size = [6, 15], center = true);
|
||||
}
|
||||
|
|
@ -60,7 +60,7 @@ group() {
|
|||
group() {
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 102], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[0, 0, -1, 0], [-1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[2.22045e-16, 2.22045e-16, -1, 0], [-1, 0, -2.22045e-16, 0], [0, 1, 2.22045e-16, 0], [0, 0, 0, 1]]) {
|
||||
linear_extrude(height = 6, center = true, convexity = 10, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2) {
|
||||
group() {
|
||||
union() {
|
||||
|
|
@ -101,9 +101,9 @@ group() {
|
|||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[-0.5, -0.86602540378, 0, 0], [0.86602540378, -0.5, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[-0.5, -0.866025, 0, 0], [0.866025, -0.5, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 102], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[0, 0, -1, 0], [-1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[2.22045e-16, 2.22045e-16, -1, 0], [-1, 0, -2.22045e-16, 0], [0, 1, 2.22045e-16, 0], [0, 0, 0, 1]]) {
|
||||
linear_extrude(height = 6, center = true, convexity = 10, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2) {
|
||||
group() {
|
||||
union() {
|
||||
|
|
@ -144,9 +144,9 @@ group() {
|
|||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[-0.5, 0.86602540378, 0, 0], [-0.86602540378, -0.5, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[-0.5, 0.866025, 0, 0], [-0.866025, -0.5, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 102], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[0, 0, -1, 0], [-1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[2.22045e-16, 2.22045e-16, -1, 0], [-1, 0, -2.22045e-16, 0], [0, 1, 2.22045e-16, 0], [0, 0, 0, 1]]) {
|
||||
linear_extrude(height = 6, center = true, convexity = 10, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2) {
|
||||
group() {
|
||||
union() {
|
||||
|
|
@ -191,7 +191,7 @@ group() {
|
|||
}
|
||||
% multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 12], [0, 0, 0, 1]]) {
|
||||
group() {
|
||||
rotate_extrude(convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
square(size = [25, 68], center = false);
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 68], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
intersection() {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
group() {
|
||||
group();
|
||||
color([1, 0, 0, 1]) {
|
||||
rotate_extrude(convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
multmatrix([[1, 0, 0, 10], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
square(size = [5, 5], center = false);
|
||||
}
|
||||
|
|
@ -9,16 +9,39 @@ group() {
|
|||
}
|
||||
color([0, 1, 1, 1]) {
|
||||
multmatrix([[1, 0, 0, 40], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
rotate_extrude(convexity = 2, $fn = 80, $fa = 12, $fs = 2) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 80, $fa = 12, $fs = 2) {
|
||||
text(text = " J", size = 10, spacing = 1, font = "", direction = "ltr", language = "en", script = "Latn", halign = "left", valign = "baseline", $fn = 80, $fa = 12, $fs = 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
color([0, 0.501961, 0, 1]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 30], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
rotate_extrude(convexity = 2, $fn = 80, $fa = 12, $fs = 2) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 80, $fa = 12, $fs = 2) {
|
||||
polygon(points = [[0, 0], [8, 4], [4, 8], [4, 12], [12, 16], [0, 20]], paths = undef, convexity = 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
color([1, 0, 1, 1]) {
|
||||
multmatrix([[1, 0, 0, 40], [0, 1, 0, 40], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
rotate_extrude(angle = 180, convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
multmatrix([[1, 0, 0, 12.5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
square(size = [5, 5], center = false);
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 7.5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
rotate_extrude(angle = 180, convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
multmatrix([[1, 0, 0, 5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
square(size = [5, 5], center = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, -7.5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
rotate_extrude(angle = -180, convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
multmatrix([[1, 0, 0, 5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
square(size = [5, 5], center = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@ group() {
|
|||
intersection();
|
||||
linear_extrude(height = 100, center = false, convexity = 1, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2);
|
||||
linear_extrude(height = 100, center = false, convexity = 1, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2);
|
||||
rotate_extrude(convexity = 2, $fn = 0, $fa = 12, $fs = 2);
|
||||
rotate_extrude(convexity = 2, $fn = 0, $fa = 12, $fs = 2);
|
||||
import(file = "", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
|
||||
import(file = "", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
|
||||
import(file = "", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
|
||||
import(file = "", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 12, $fs = 2);
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 12, $fs = 2);
|
||||
import(file = "", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2, timestamp = 0);
|
||||
import(file = "", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2, timestamp = 0);
|
||||
import(file = "", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2, timestamp = 0);
|
||||
import(file = "", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2, timestamp = 0);
|
||||
group();
|
||||
cube(size = [1, 1, 1], center = false);
|
||||
sphere($fn = 0, $fa = 12, $fs = 2, r = 1);
|
||||
|
|
@ -32,7 +32,7 @@ group() {
|
|||
polygon(points = undef, paths = undef, convexity = 1);
|
||||
projection(cut = false, convexity = 0);
|
||||
render(convexity = 1);
|
||||
surface(file = "", center = false, invert = false);
|
||||
surface(file = "", center = false, invert = false, timestamp = 0);
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]);
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]);
|
||||
multmatrix([[-1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
group() {
|
||||
rotate_extrude(convexity = 2, $fn = 0, $fa = 12, $fs = 2);
|
||||
rotate_extrude(convexity = 2, $fn = 0, $fa = 12, $fs = 2);
|
||||
rotate_extrude(convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 12, $fs = 2);
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 12, $fs = 2);
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
cube(size = [1, 1, 1], center = false);
|
||||
}
|
||||
linear_extrude(height = 10, center = false, convexity = 1, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2) {
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
group() {
|
||||
group() {
|
||||
linear_extrude(height = 100, center = false, convexity = 1, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2) {
|
||||
import(file = "localfile.dxf", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
|
||||
import(file = "localfile.dxf", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2, timestamp = 1447128393);
|
||||
}
|
||||
multmatrix([[1, 0, 0, -250], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
linear_extrude(file = "localfile.dxf", layer = "", origin = [0, 0], height = 100, center = false, convexity = 1, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2);
|
||||
linear_extrude(file = "localfile.dxf", layer = "", origin = [0, 0], timestamp = 1447128393, height = 100, center = false, convexity = 1, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2);
|
||||
}
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 350], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
rotate_extrude(file = "localfile.dxf", layer = "", origin = [0, 0], scale = 1, convexity = 2, $fn = 0, $fa = 12, $fs = 2);
|
||||
rotate_extrude(file = "localfile.dxf", layer = "", origin = [0, 0], scale = 1, timestamp = 1447128393, angle = 360, convexity = 2, $fn = 0, $fa = 12, $fs = 2);
|
||||
}
|
||||
multmatrix([[1, 0, 0, 250], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[200, 0, 0, 0], [0, 200, 0, 0], [0, 0, 50, 0], [0, 0, 0, 1]]) {
|
||||
surface(file = "localfile.dat", center = false, invert = false);
|
||||
surface(file = "localfile.dat", center = false, invert = false, timestamp = 1447128393);
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, -200], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
group() {
|
||||
group() {
|
||||
linear_extrude(height = 100, center = false, convexity = 1, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2) {
|
||||
import(file = "localfiles_dir/localfile.dxf", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
|
||||
import(file = "localfiles_dir/localfile.dxf", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2, timestamp = 1447128393);
|
||||
}
|
||||
multmatrix([[1, 0, 0, -250], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
linear_extrude(file = "localfiles_dir/localfile.dxf", layer = "", origin = [0, 0], height = 100, center = false, convexity = 1, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2);
|
||||
linear_extrude(file = "localfiles_dir/localfile.dxf", layer = "", origin = [0, 0], timestamp = 1447128393, height = 100, center = false, convexity = 1, scale = [1, 1], $fn = 0, $fa = 12, $fs = 2);
|
||||
}
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 350], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
rotate_extrude(file = "localfiles_dir/localfile.dxf", layer = "", origin = [0, 0], scale = 1, convexity = 2, $fn = 0, $fa = 12, $fs = 2);
|
||||
rotate_extrude(file = "localfiles_dir/localfile.dxf", layer = "", origin = [0, 0], scale = 1, timestamp = 1447128393, angle = 360, convexity = 2, $fn = 0, $fa = 12, $fs = 2);
|
||||
}
|
||||
multmatrix([[1, 0, 0, 250], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
multmatrix([[200, 0, 0, 0], [0, 200, 0, 0], [0, 0, 50, 0], [0, 0, 0, 1]]) {
|
||||
surface(file = "localfiles_dir/localfile.dat", center = false, invert = false);
|
||||
surface(file = "localfiles_dir/localfile.dat", center = false, invert = false, timestamp = 1447128393);
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, -200], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
|
|
|
|||
166
tests/regression/dumptest/rotate_extrude-angle-expected.csg
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
group() {
|
||||
rotate_extrude(angle = 45, convexity = 2, $fn = 0, $fa = 15, $fs = 4) {
|
||||
group() {
|
||||
multmatrix([[1, 0, 0, 10], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
difference() {
|
||||
square(size = [10, 10], center = true);
|
||||
square(size = [5, 5], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
rotate_extrude(angle = 45, convexity = 2, $fn = 0, $fa = 15, $fs = 4) {
|
||||
group() {
|
||||
multmatrix([[1, 0, 0, -10], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
difference() {
|
||||
square(size = [10, 10], center = true);
|
||||
square(size = [5, 5], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
rotate_extrude(angle = -45, convexity = 2, $fn = 0, $fa = 15, $fs = 4) {
|
||||
group() {
|
||||
multmatrix([[1, 0, 0, 21], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
difference() {
|
||||
square(size = [10, 10], center = true);
|
||||
square(size = [5, 5], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
rotate_extrude(angle = -45, convexity = 2, $fn = 0, $fa = 15, $fs = 4) {
|
||||
group() {
|
||||
multmatrix([[1, 0, 0, -21], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
difference() {
|
||||
square(size = [10, 10], center = true);
|
||||
square(size = [5, 5], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[2.22045e-16, -1, 0, 0], [1, 2.22045e-16, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
rotate_extrude(angle = 5, convexity = 2, $fn = 0, $fa = 15, $fs = 4) {
|
||||
group() {
|
||||
multmatrix([[1, 0, 0, 10], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
difference() {
|
||||
square(size = [10, 10], center = true);
|
||||
square(size = [5, 5], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
rotate_extrude(angle = 5, convexity = 2, $fn = 0, $fa = 15, $fs = 4) {
|
||||
group() {
|
||||
multmatrix([[1, 0, 0, -10], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
difference() {
|
||||
square(size = [10, 10], center = true);
|
||||
square(size = [5, 5], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
rotate_extrude(angle = -5, convexity = 2, $fn = 0, $fa = 15, $fs = 4) {
|
||||
group() {
|
||||
multmatrix([[1, 0, 0, 21], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
difference() {
|
||||
square(size = [10, 10], center = true);
|
||||
square(size = [5, 5], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
rotate_extrude(angle = -5, convexity = 2, $fn = 0, $fa = 15, $fs = 4) {
|
||||
group() {
|
||||
multmatrix([[1, 0, 0, -21], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
difference() {
|
||||
square(size = [10, 10], center = true);
|
||||
square(size = [5, 5], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
rotate_extrude(angle = 0, convexity = 2, $fn = 0, $fa = 15, $fs = 4) {
|
||||
group() {
|
||||
multmatrix([[1, 0, 0, 5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
difference() {
|
||||
square(size = [10, 10], center = true);
|
||||
square(size = [5, 5], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, -40], [0, 1, 0, 40], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 15, $fs = 4) {
|
||||
group() {
|
||||
multmatrix([[1, 0, 0, 5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
square(size = [5, 5], center = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 40], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 15, $fs = 4) {
|
||||
group() {
|
||||
multmatrix([[1, 0, 0, 5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
square(size = [5, 5], center = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 40], [0, 1, 0, 40], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 15, $fs = 4) {
|
||||
group() {
|
||||
multmatrix([[1, 0, 0, 5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
square(size = [5, 5], center = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, -40], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 15, $fs = 4) {
|
||||
group() {
|
||||
multmatrix([[1, 0, 0, 5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
square(size = [5, 5], center = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 40], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 15, $fs = 4) {
|
||||
group() {
|
||||
multmatrix([[1, 0, 0, 5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
square(size = [5, 5], center = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, -40], [0, 1, 0, -40], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 15, $fs = 4) {
|
||||
group() {
|
||||
multmatrix([[1, 0, 0, 5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
square(size = [5, 5], center = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, -40], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 15, $fs = 4) {
|
||||
group() {
|
||||
multmatrix([[1, 0, 0, 5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
square(size = [5, 5], center = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 40], [0, 1, 0, -40], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 15, $fs = 4) {
|
||||
group() {
|
||||
multmatrix([[1, 0, 0, 5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
square(size = [5, 5], center = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,17 +1,17 @@
|
|||
group() {
|
||||
rotate_extrude(convexity = 2, $fn = 0, $fa = 12, $fs = 2);
|
||||
rotate_extrude(convexity = 2, $fn = 0, $fa = 12, $fs = 2);
|
||||
rotate_extrude(convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 12, $fs = 2);
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 12, $fs = 2);
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
cube(size = [1, 1, 1], center = false);
|
||||
}
|
||||
rotate_extrude(convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
circle($fn = 0, $fa = 12, $fs = 2, r = 10);
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 50], [0, 1, 0, -20], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
difference() {
|
||||
rotate_extrude(convexity = 4, $fn = 0, $fa = 12, $fs = 2) {
|
||||
rotate_extrude(angle = 360, convexity = 4, $fn = 0, $fa = 12, $fs = 2) {
|
||||
multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
difference() {
|
||||
circle($fn = 0, $fa = 12, $fs = 2, r = 10);
|
||||
|
|
@ -27,12 +27,12 @@ group() {
|
|||
multmatrix([[1, 0, 0, 50], [0, 1, 0, 50], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
difference() {
|
||||
difference() {
|
||||
rotate_extrude(convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
circle($fn = 0, $fa = 12, $fs = 2, r = 10);
|
||||
}
|
||||
}
|
||||
rotate_extrude(convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
circle($fn = 0, $fa = 12, $fs = 2, r = 8);
|
||||
}
|
||||
|
|
@ -44,14 +44,14 @@ group() {
|
|||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, -60], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
rotate_extrude(convexity = 2, $fn = 1, $fa = 12, $fs = 2) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 1, $fa = 12, $fs = 2) {
|
||||
multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
circle($fn = 1, $fa = 12, $fs = 2, r = 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 60], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
rotate_extrude(convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
rotate_extrude(angle = 360, convexity = 2, $fn = 0, $fa = 12, $fs = 2) {
|
||||
multmatrix([[1, 0, 0, -20], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
|
||||
square(size = [10, 10], center = false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
group() {
|
||||
rotate_extrude(file = "../../../dxf/open-polyline.dxf", layer = "", origin = [0, 0], scale = 1, convexity = 2, $fn = 0, $fa = 12, $fs = 2);
|
||||
rotate_extrude(file = "../../../dxf/open-polyline.dxf", layer = "", origin = [0, 0], scale = 1, timestamp = 1447128393, angle = 360, convexity = 2, $fn = 0, $fa = 12, $fs = 2);
|
||||
}
|
||||
|
|
|
|||
BIN
tests/regression/opencsgtest/rotate_extrude-angle-expected.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 9.2 KiB |