1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-27 10:15:05 +02:00

full regeneration

This commit is contained in:
Pomax
2020-09-19 18:34:03 -07:00
parent ad872f83c5
commit 4c0e71cd4a
234 changed files with 1468 additions and 1376 deletions

View File

@@ -18,6 +18,9 @@ draw() {
curve.drawCurve();
curve.drawPoints();
// Start with complete nonsense min/max values, where
// min is huge and max is tiny, so we can bring them
// down and up, respectively.
let minx = Number.MAX_SAFE_INTEGER,
miny = minx,
@@ -28,6 +31,7 @@ draw() {
noFill();
setStroke(`red`);
// For each extremum, see if that changes the bbox values.
[0, ...extrema.x, ...extrema.y, 1].forEach(t => {
let p = curve.get(t);
if (p.x < minx) minx = p.x;
@@ -37,6 +41,7 @@ draw() {
if (t > 0 && t< 1) circle(p.x, p.y, 3);
});
// And we're done.
setStroke(`#0F0`);
rect(minx, miny, maxx - minx, maxy - miny);
}