Skip to content

Commit

Permalink
Add sketch, sample to gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimmons committed Jan 18, 2019
1 parent e279233 commit ac6a2ca
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/gallery.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
<p align="center"><img width="75%" src="sample10.svg"></p>
<p align="center"><img width="75%" src="sample11.svg"></p>
<p align="center"><img width="75%" src="sample12.svg"></p>
<p align="center"><img width="75%" src="sample13.svg"></p>
1 change: 1 addition & 0 deletions docs/sample13.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions sketches/sketch019.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const {makeSketch} = require('./util');

makeSketch({x: 128, y: 128, z: 128}, {padFrac: 0.1}, (scene, ops) => {
function wormsFrom(pos) {
for (let i = 0; i < 96; i++) {
ops.worm(scene, pos, 1+Math.floor(5*Math.random()), 2+Math.floor(2*Math.random()));
}
}

const OFFSET = 8;
wormsFrom({x: OFFSET, y: OFFSET, z: OFFSET});
wormsFrom({x: scene.size.x-1-OFFSET, y: OFFSET, z: OFFSET});
wormsFrom({x: OFFSET, y: scene.size.y-1-OFFSET, z: OFFSET});
wormsFrom({x: scene.size.x-1-OFFSET, y: scene.size.y-1-OFFSET, z: OFFSET});
// wormsFrom({x: OFFSET, y: OFFSET, z: scene.size.z-1-OFFSET}); // FRONT CORNER
wormsFrom({x: scene.size.x-1-OFFSET, y: OFFSET, z: scene.size.z-1-OFFSET});
wormsFrom({x: OFFSET, y: scene.size.y-1-OFFSET, z: scene.size.z-1-OFFSET});
wormsFrom({x: scene.size.x-1-OFFSET, y: scene.size.y-1-OFFSET, z: scene.size.z-1-OFFSET});
});

0 comments on commit ac6a2ca

Please sign in to comment.