From aae5ceb5a190cc108f094c5516e8f4bf07b18eb8 Mon Sep 17 00:00:00 2001 From: Frederic Date: Mon, 22 Apr 2019 13:52:31 +0200 Subject: [PATCH] use meaningful file names, prepare parametrization --- chaostest/chaostest3.html | 115 --------------------------------- chaostest/connected-lines.html | 52 +++++++++++++++ chaostest/connected-lines.js | 64 ++++++++++++++++++ 3 files changed, 116 insertions(+), 115 deletions(-) delete mode 100644 chaostest/chaostest3.html create mode 100644 chaostest/connected-lines.html create mode 100644 chaostest/connected-lines.js diff --git a/chaostest/chaostest3.html b/chaostest/chaostest3.html deleted file mode 100644 index 3adf2e0..0000000 --- a/chaostest/chaostest3.html +++ /dev/null @@ -1,115 +0,0 @@ - -JavaScript <=> PaperScript example - - - - - - - - - - - - - - - - diff --git a/chaostest/connected-lines.html b/chaostest/connected-lines.html new file mode 100644 index 0000000..06f2230 --- /dev/null +++ b/chaostest/connected-lines.html @@ -0,0 +1,52 @@ + +JavaScript <=> PaperScript example + + + + + + + + + + + + + +
+ + + + + + diff --git a/chaostest/connected-lines.js b/chaostest/connected-lines.js new file mode 100644 index 0000000..3ebdcfc --- /dev/null +++ b/chaostest/connected-lines.js @@ -0,0 +1,64 @@ + +function connected_lines_get_rnd_params() { + return { + start: new Point(Math.random(), Math.random()), + offs: new Point(0.05, 0.05), + num_steps: 5, + }; +} + + +function connected_lines(params) { + if(typeof params == 'undefined') { + var params = connected_lines_get_rnd_params(); + } + + var lines = []; + for(var i=0; i<2; i++) { + var x = params.start.x + i*params.offs.x; + var y = params.start.y + i*params.offs.y; + var path = new paper.Path({strokeWidth: 5, strokeColor: 'black'}); + for(var s=0; s