Skip to content

Commit

Permalink
Add note about stroke-width to README
Browse files Browse the repository at this point in the history
Per issue #1
  • Loading branch information
rsimmons authored Dec 21, 2020
1 parent 478ba11 commit 0a3797c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $ node sketch001.js
[output written to out.svg, which you can open directly in a browser]
```

There are a number of demo "sketches", found in `sketches/sketchNNN.js`. The format should be relatively obvious, but a sketch is implemented as a call to `makeSketch` that provides a callback function to fill/define the voxels of the scene. The `padFrac` argument is the (fractional) padding around the edges of the render. The `ops` argument to the callback is an object with a handful of useful voxel operations (defined in `core/scene.js`, `const ops = {...`). Note that many of the ops have a random element; re-run the sketch to get a new variation.
There are a number of demo "sketches", found in `sketches/sketchNNN.js`. The format should be relatively obvious, but a sketch is implemented as a call to `makeSketch` that provides a callback function to fill/define the voxels of the scene. The `padFrac` argument is the (fractional) padding around the edges of the render. The `ops` argument to the callback is an object with a handful of useful voxel operations (defined in `core/scene.js`, `const ops = {...`). Note that many of the ops have a random element; re-run the sketch to get a new variation. The width of the lines in the SVG is currently hard-coded, but it's easy to modify by hand. It appears in one place at the top of the SVG file (the `stroke-width` attribute of the `<g>` element), and is defined in `core/render.js`.

To understand the available ops, it's useful to look at the demo sketches, but here is some brief documentation. Voxel coordinates arguments are given as plain old JS objects, like `{x: 1, y: 2, z: 3}`, with axes defined per the Math/Tech Notes section above. The `fill` argument of ops is to be 0 or 1, corresponding to empty or solid.

Expand Down

0 comments on commit 0a3797c

Please sign in to comment.