working lib
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?v=stop-s"></script>
|
||||
<script src="../../lib/WallPlotter.js?v=bounds-px"></script>
|
||||
<script src="sketch.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
let wp;
|
||||
|
||||
let area = 400;
|
||||
let area = 120;
|
||||
|
||||
function setup() {
|
||||
const canvas = createCanvas(windowWidth, windowHeight);
|
||||
@@ -42,15 +42,13 @@ async function drawArt(testOnly) {
|
||||
wp.move(-area, -area);
|
||||
//wp.wait(1000 * 10);
|
||||
|
||||
let step = area / 4.001;
|
||||
let step = area / 2;
|
||||
|
||||
for (let y = -area; y < area; y+=step){
|
||||
for (let x = -area; x < area; x+=step){
|
||||
//if(random(1) < 0.8){
|
||||
wp.draw(x, y);
|
||||
for (let y = -area; y <= area; y+=step){
|
||||
for (let x = -area; x <= area; x+=step){
|
||||
wp.move(x+step, y);
|
||||
wp.draw(x, y+step);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await wp.runPath(testOnly);
|
||||
|
||||
+6
-7
@@ -929,15 +929,14 @@ class WallPlotter {
|
||||
line(tl.x, 0, br.x, 0);
|
||||
line(0, tl.y, 0, br.y);
|
||||
|
||||
// Size labels in cm along bottom and right edges
|
||||
// Size labels in cm + screen pixels along bottom and right edges
|
||||
const widthCm = (bounds.xMax - bounds.xMin) / 10;
|
||||
const heightCm = (bounds.yMax - bounds.yMin) / 10;
|
||||
const widthLabel = Number.isInteger(widthCm)
|
||||
? `${widthCm} cm`
|
||||
: `${widthCm.toFixed(1)} cm`;
|
||||
const heightLabel = Number.isInteger(heightCm)
|
||||
? `${heightCm} cm`
|
||||
: `${heightCm.toFixed(1)} cm`;
|
||||
const widthPx = Math.round(Math.abs(w));
|
||||
const heightPx = Math.round(Math.abs(h));
|
||||
const fmtCm = (cm) => (Number.isInteger(cm) ? `${cm}` : cm.toFixed(1));
|
||||
const widthLabel = `${fmtCm(widthCm)} cm · ${widthPx} px`;
|
||||
const heightLabel = `${fmtCm(heightCm)} cm · ${heightPx} px`;
|
||||
noStroke();
|
||||
fill(bounds.preview ? 140 : 160);
|
||||
textFont('monospace', 12);
|
||||
|
||||
Reference in New Issue
Block a user