More phone-cord-looking very stress-testy nested examples

This commit is contained in:
Chris Hodapp 2020-04-20 22:27:41 -04:00
parent 3c707aff9b
commit 6857fb6aee
3 changed files with 15 additions and 7 deletions

View File

@ -62,3 +62,5 @@
- Take a square. Wrap it around to a torus. Now add a twist (about
the axis that is normal to the square). This is simple, but it looks
pretty cool.
- How can I take tangled things like the cinquefoil and produce more
'iterative' versions that still weave around?

View File

@ -165,7 +165,9 @@ pub fn twisty_torus() -> Rule<TorusCtxt> {
let rad = 1.0;
let rad2 = 8.0;
let dx = 0.01;
let rad3 = 24.0;
let rz3 = 0.0004;
let dx = 0.00;
let rx = 0.01;
let rz = 0.30;
let ang = 0.1;
@ -181,10 +183,9 @@ pub fn twisty_torus() -> Rule<TorusCtxt> {
init: false,
count: count + 1,
stack: [
Transform::new().translate(dx, 0.0, 0.0).rotate(x, rx) * stack[0],
// stack[0], //Transform::new().rotate(z, 0.05 * (count as f32)).translate(0.0, rad2, 0.0),
Transform::new().rotate(z, rz) * stack[1],
stack[2],
Transform::new().rotate(z, rz3) * stack[0],
Transform::new().translate(dx, 0.0, 0.0).rotate(x, rx) * stack[1],
Transform::new().rotate(z, rz) * stack[2],
],
},
};
@ -227,9 +228,9 @@ pub fn twisty_torus() -> Rule<TorusCtxt> {
init: true,
count: 0,
stack: [
Transform::new().translate(0.0, rad3, 0.0),
Transform::new().translate(0.0, rad2, 0.0),
Transform::new().translate(rad, 0.0, 0.0),
Transform::new(), // .translate(dx0, 0.0, 0.0),
],
},
}

View File

@ -77,7 +77,12 @@ mod tests {
#[test]
fn twisty_torus() {
run_test(examples::twisty_torus(), 400, "twisty_torus", false);
run_test(examples::twisty_torus(), 3000, "twisty_torus", false);
}
#[test]
fn twisty_torus_full() {
run_test(examples::twisty_torus(), 40000, "twisty_torus_full", false);
}
fn wind_chime_mistake_thing() {