mirror of
https://github.com/Pomax/BezierInfo-2.git
synced 2025-08-30 03:30:34 +02:00
full regeneration
This commit is contained in:
@@ -12,11 +12,13 @@ draw() {
|
||||
curve.drawCurve();
|
||||
curve.drawPoints();
|
||||
|
||||
// Similar to aligning, we transform the curve first
|
||||
let translated = this.translatePoints(curve.points);
|
||||
let rotated = this.rotatePoints(translated);
|
||||
let rtcurve = new Bezier(this, rotated);
|
||||
let extrema = rtcurve.extrema();
|
||||
|
||||
// and the we run the regular bounding box code
|
||||
let minx = Number.MAX_SAFE_INTEGER,
|
||||
miny = minx,
|
||||
maxx = Number.MIN_SAFE_INTEGER,
|
||||
@@ -37,6 +39,8 @@ draw() {
|
||||
noFill();
|
||||
setStroke(`#0F0`);
|
||||
|
||||
// But, crucially, we now need to reverse-transform the bbox corners:
|
||||
|
||||
let tx = curve.points[0].x;
|
||||
let ty = curve.points[0].y;
|
||||
let a = rotated[0].a;
|
||||
|
Reference in New Issue
Block a user