plotter drawing size and stop with key
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
}
|
||||
</style>
|
||||
<script src="https://cdn.jsdelivr.net/npm/p5@1.11.3/lib/p5.min.js"></script>
|
||||
<script src="../../lib/WallPlotter.js"></script>
|
||||
<script src="../../lib/WallPlotter.js?v=stop-s"></script>
|
||||
<script src="sketch.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -6,7 +6,12 @@ function setup() {
|
||||
const canvas = createCanvas(windowWidth, windowHeight);
|
||||
canvas.parent('sketch-host');
|
||||
|
||||
wp = new WallPlotter();
|
||||
wp = new WallPlotter({
|
||||
penUpGcode: 'M280 P0 S120',
|
||||
penDownGcode: 'M280 P0 S30',
|
||||
penUpDelayMs: 250,
|
||||
penDownDelayMs: 150,
|
||||
});
|
||||
wp.setSpeed(10000, 10000);
|
||||
wp.setTimingMultiplier(1); // tune if machine is slower than speed estimate, the higher the slower
|
||||
wp.enableKeyInputs();
|
||||
@@ -35,16 +40,16 @@ async function drawArt(testOnly) {
|
||||
|
||||
|
||||
wp.move(-area, -area);
|
||||
wp.wait(1000 * 10);
|
||||
//wp.wait(1000 * 10);
|
||||
|
||||
let step = area / 20;
|
||||
let step = area / 4.001;
|
||||
|
||||
for (let y = -area; y < area; y+=step){
|
||||
for (let x = -area; x < area; x+=step){
|
||||
if(random(1) < 0.8){
|
||||
wp.move(x, y);
|
||||
//if(random(1) < 0.8){
|
||||
wp.draw(x, y);
|
||||
wp.draw(x, y+step);
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user