From 2746369547cf2b4c04dcccf08fdb4a3e7c1fddc3 Mon Sep 17 00:00:00 2001 From: Prince-Polka Date: Fri, 8 Sep 2017 19:12:59 +0200 Subject: [PATCH 1/4] Update PGraphics.java At row 3214 changed public float bezierPoint(float a, float b, float c, float d, float t) { float t1 = 1.0f - t; return a*t1*t1*t1 + 3*b*t*t1*t1 + 3*c*t*t*t1 + d*t*t*t; } to float bezierPoint (float a, float b, float c, float d, float t) { float t1 = t-1.0f; return t * ( 3*t1*(b*t1-c*t) + d*t*t ) - a*t1*t1*t1; } , works the same but faster --- core/src/processing/core/PGraphics.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index a4425e1d8..70ad6c21b 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -3211,12 +3211,10 @@ public class PGraphics extends PImage implements PConstants { * @see PGraphics#bezierVertex(float, float, float, float, float, float) * @see PGraphics#curvePoint(float, float, float, float, float) */ - public float bezierPoint(float a, float b, float c, float d, float t) { - float t1 = 1.0f - t; - return a*t1*t1*t1 + 3*b*t*t1*t1 + 3*c*t*t*t1 + d*t*t*t; + float bezierPoint (float a, float b, float c, float d, float t) { + float t1 = t-1.0f; + return t * ( 3*t1*(b*t1-c*t) + d*t*t ) - a*t1*t1*t1; } - - /** * ( begin auto-generated from bezierTangent.xml ) * From 3052c1f38414b76c91d70f606703b6f88abe2726 Mon Sep 17 00:00:00 2001 From: Prince-Polka Date: Fri, 8 Sep 2017 19:15:09 +0200 Subject: [PATCH 2/4] Update PGraphics.java --- core/src/processing/core/PGraphics.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index 70ad6c21b..92ea583d0 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -3211,7 +3211,7 @@ public class PGraphics extends PImage implements PConstants { * @see PGraphics#bezierVertex(float, float, float, float, float, float) * @see PGraphics#curvePoint(float, float, float, float, float) */ - float bezierPoint (float a, float b, float c, float d, float t) { + public float bezierPoint (float a, float b, float c, float d, float t) { float t1 = t-1.0f; return t * ( 3*t1*(b*t1-c*t) + d*t*t ) - a*t1*t1*t1; } From 4dd1f29cb8eea6c6c0013141327ff0ac1bd0184e Mon Sep 17 00:00:00 2001 From: Prince-Polka Date: Fri, 8 Sep 2017 19:16:33 +0200 Subject: [PATCH 3/4] Update PGraphics.java --- core/src/processing/core/PGraphics.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index 92ea583d0..47a919540 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -3211,7 +3211,7 @@ public class PGraphics extends PImage implements PConstants { * @see PGraphics#bezierVertex(float, float, float, float, float, float) * @see PGraphics#curvePoint(float, float, float, float, float) */ - public float bezierPoint (float a, float b, float c, float d, float t) { + public float bezierPoint(float a, float b, float c, float d, float t) { float t1 = t-1.0f; return t * ( 3*t1*(b*t1-c*t) + d*t*t ) - a*t1*t1*t1; } From 6a018b7a94ae30964dfb8df78e7bddb4b8eb1f40 Mon Sep 17 00:00:00 2001 From: Prince-Polka Date: Wed, 20 Sep 2017 17:18:50 +0200 Subject: [PATCH 4/4] Update PGraphics.java --- core/src/processing/core/PGraphics.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index 47a919540..ede34ca38 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -3212,8 +3212,8 @@ public class PGraphics extends PImage implements PConstants { * @see PGraphics#curvePoint(float, float, float, float, float) */ public float bezierPoint(float a, float b, float c, float d, float t) { - float t1 = t-1.0f; - return t * ( 3*t1*(b*t1-c*t) + d*t*t ) - a*t1*t1*t1; + float t1 = 1.0f - t; + return (a*t1 + 3*b*t)*t1*t1 + (3*c*t1 + d*t)*t*t; } /** * ( begin auto-generated from bezierTangent.xml )