Skip to content

Commit

Permalink
new sketches for ptpx
Browse files Browse the repository at this point in the history
  • Loading branch information
rolyatmax committed Dec 24, 2023
1 parent 3812a14 commit c2403bb
Show file tree
Hide file tree
Showing 12 changed files with 3,452 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .sketch-template.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import * as canvasSketch from 'canvas-sketch'
import * as random from 'canvas-sketch-util/random'
import { GUI } from 'dat-gui'

const WIDTH = 2048
const HEIGHT = 2048

const settings = {
seed: 1
}

type SketchArgs = { context: CanvasRenderingContext2D, viewportWidth: number, viewportHeight: number }

canvasSketch(({ render }) => {
const gui = new GUI()
gui.add(settings, 'seed', 0, 9999).step(1).onChange(render)

return (args: SketchArgs) => {
const { context, viewportWidth, viewportHeight } = args
const width = viewportWidth
const height = viewportHeight

const rand = random.createRandom(settings.seed)

context.fillStyle = 'white'
context.fillRect(0, 0, width, height)
}
}, {
dimensions: [WIDTH, HEIGHT],
animate: true
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"build": "node scripts/build.js",
"start": "echo \"open localhost:8080 in a browser\" && cd docs && python -m SimpleHTTPServer 8080",
"lint": "standard",
"new": "canvas-sketch --new --output=tmp --template=./.sketch-template.js -- --p tsify",
"new": "filename=$(date +\"sketches/%Y.%m.%d-%H.%M.%S.ts\") && cp ./.sketch-template.ts $filename && npm run dev -- $filename",
"dev": "run(){ canvas-sketch --output=tmp $1 -- -p tsify; }; run"
},
"author": "Taylor Baldwin",
Expand Down
3 changes: 2 additions & 1 deletion plots/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
## Useful commands for axidraw:

axicli -m manual -d 30 -u 60 -M raise_pen
axicli -m manual -d 30 -u 60 -M lower_pen
axicli SVGPLOT -d 30 -u 60 -a 18 -z 20 -b

Ex:

axicli 2022.12.14-19.57.40-plot-hash-9215.svg -d 30 -u 60 -a 18 -z 20 -b
axicli 2023.12.11-20.09.04-plot-hash-867.svg -d 30 -u 60 -a 18 -z 20 -b

## Plot server:

Expand Down
Loading

0 comments on commit c2403bb

Please sign in to comment.