diff --git a/build.xml.template b/build.xml.template
index 1e5cf11..9e50e74 100644
--- a/build.xml.template
+++ b/build.xml.template
@@ -32,25 +32,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -78,7 +59,39 @@
This is the R mode for Processing, powered by github.com/gaocegege
-
+
+
+
+
+
+
+
+
+
+
+
+ The OS platform is Linux X86_64, download corresponding jars from remote.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/Basics/ThreeDimensionalCube/ThreeDimensionalCube.rpde b/examples/Basics/ThreeDimensionalCube/ThreeDimensionalCube.rpde
index f39d365..8eb0c64 100644
--- a/examples/Basics/ThreeDimensionalCube/ThreeDimensionalCube.rpde
+++ b/examples/Basics/ThreeDimensionalCube/ThreeDimensionalCube.rpde
@@ -1,5 +1,3 @@
-PI <- 3.1415
-
settings <- function() {
size(500, 500, "processing.opengl.PGraphics3D")
}
diff --git a/examples/reference/ambientLight/ambientLight1/ambientLight1.rpde b/examples/reference/ambientLight/ambientLight1/ambientLight1.rpde
index 17ca611..117f757 100644
--- a/examples/reference/ambientLight/ambientLight1/ambientLight1.rpde
+++ b/examples/reference/ambientLight/ambientLight1/ambientLight1.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/examples/reference/applyMatrix/applyMatrix0/applyMatrix0.rpde b/examples/reference/applyMatrix/applyMatrix0/applyMatrix0.rpde
index 7eb80c7..2da3f45 100644
--- a/examples/reference/applyMatrix/applyMatrix0/applyMatrix0.rpde
+++ b/examples/reference/applyMatrix/applyMatrix0/applyMatrix0.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/examples/reference/arc/arc1/arc1.rpde b/examples/reference/arc/arc1/arc1.rpde
index f98c6eb..f827973 100644
--- a/examples/reference/arc/arc1/arc1.rpde
+++ b/examples/reference/arc/arc1/arc1.rpde
@@ -1,11 +1,5 @@
# arc 1 https://processing.org/reference/arc_.html
-# TODO: replace with built-in constants
-PI <- 3.1415
-HALF_PI <- PI/2
-QUARTER_PI <- PI/4
-TWO_PI <- PI * 2
-
arc(50, 55, 50, 50, 0, HALF_PI)
noFill()
arc(50, 55, 60, 60, HALF_PI, PI)
diff --git a/examples/reference/arc/arc2/arc2.rpde b/examples/reference/arc/arc2/arc2.rpde
index bbdff06..7733f88 100644
--- a/examples/reference/arc/arc2/arc2.rpde
+++ b/examples/reference/arc/arc2/arc2.rpde
@@ -1,12 +1,3 @@
# arc 2 https://processing.org/reference/arc_.html
-# TODO: replace with built-in constants
-PI <- 3.1415
-QUARTER_PI <- PI/4
-
-# TODO: Fix double to int casts
-OPEN <- as.integer(1)
-CHORD <- as.integer(2)
-PIE <- as.integer(3)
-
arc(50, 50, 80, 80, 0, PI + QUARTER_PI, OPEN)
diff --git a/examples/reference/arc/arc3/arc3.rpde b/examples/reference/arc/arc3/arc3.rpde
index 057cef6..ef3d7ca 100644
--- a/examples/reference/arc/arc3/arc3.rpde
+++ b/examples/reference/arc/arc3/arc3.rpde
@@ -1,12 +1,3 @@
# arc 3 https://processing.org/reference/arc_.html
-# TODO: replace with built-in constants
-PI <- 3.1415
-QUARTER_PI <- PI/4
-
-# TODO: Fix double to int casts
-OPEN <- as.integer(1)
-CHORD <- as.integer(2)
-PIE <- as.integer(3)
-
arc(50, 50, 80, 80, 0, PI + QUARTER_PI, CHORD)
diff --git a/examples/reference/arc/arc4/arc4.rpde b/examples/reference/arc/arc4/arc4.rpde
index 6d7463f..7fb9b59 100644
--- a/examples/reference/arc/arc4/arc4.rpde
+++ b/examples/reference/arc/arc4/arc4.rpde
@@ -1,14 +1,3 @@
# arc 4 https://processing.org/reference/arc_.html
-# TODO: replace with built-in constants
-PI <- 3.1415
-HALF_PI <- PI/2
-QUARTER_PI <- PI/4
-TWO_PI <- PI * 2
-
-# TODO: Fix double to int casts
-OPEN <- as.integer(1)
-CHORD <- as.integer(2)
-PIE <- as.integer(3)
-
arc(50, 50, 80, 80, 0, PI + QUARTER_PI, PIE)
diff --git a/examples/reference/beginCamera/beginCamera0/beginCamera0.rpde b/examples/reference/beginCamera/beginCamera0/beginCamera0.rpde
index 31ff7b6..bbd4944 100644
--- a/examples/reference/beginCamera/beginCamera0/beginCamera0.rpde
+++ b/examples/reference/beginCamera/beginCamera0/beginCamera0.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/examples/reference/beginContour/beginContour1/beginContour1.rpde b/examples/reference/beginContour/beginContour1/beginContour1.rpde
index b993d66..c9df423 100644
--- a/examples/reference/beginContour/beginContour1/beginContour1.rpde
+++ b/examples/reference/beginContour/beginContour1/beginContour1.rpde
@@ -1,7 +1,5 @@
# beginContour 1 https://processing.org/reference/beginContour_.html
-CLOSE <- as.integer(2)
-
size(100, 100)
translate(50, 50)
stroke(255, 0, 0)
diff --git a/examples/reference/beginShape/beginShape1/beginShape1.rpde b/examples/reference/beginShape/beginShape1/beginShape1.rpde
index 6158d62..5bb34ba 100644
--- a/examples/reference/beginShape/beginShape1/beginShape1.rpde
+++ b/examples/reference/beginShape/beginShape1/beginShape1.rpde
@@ -1,10 +1,5 @@
# beginShape 1 https://processing.org/reference/beginShape_.html
-OPEN <- as.integer(1)
-CLOSE <- as.integer(2)
-POINTS <- as.integer(3)
-LINES <- as.integer(5)
-
beginShape()
vertex(30, 20)
vertex(85, 20)
diff --git a/examples/reference/beginShape/beginShape2/beginShape2.rpde b/examples/reference/beginShape/beginShape2/beginShape2.rpde
index f5cc042..b4fedfd 100644
--- a/examples/reference/beginShape/beginShape2/beginShape2.rpde
+++ b/examples/reference/beginShape/beginShape2/beginShape2.rpde
@@ -1,10 +1,5 @@
# beginShape 2 https://processing.org/reference/beginShape_.html
-OPEN <- as.integer(1)
-CLOSE <- as.integer(2)
-POINTS <- as.integer(3)
-LINES <- as.integer(5)
-
beginShape(POINTS)
vertex(30, 20)
vertex(85, 20)
diff --git a/examples/reference/beginShape/beginShape3/beginShape3.rpde b/examples/reference/beginShape/beginShape3/beginShape3.rpde
index 7101002..8331f3b 100644
--- a/examples/reference/beginShape/beginShape3/beginShape3.rpde
+++ b/examples/reference/beginShape/beginShape3/beginShape3.rpde
@@ -1,10 +1,5 @@
# beginShape 3 https://processing.org/reference/beginShape_.html
-OPEN <- as.integer(1)
-CLOSE <- as.integer(2)
-POINTS <- as.integer(3)
-LINES <- as.integer(5)
-
beginShape(LINES)
vertex(30, 20)
vertex(85, 20)
diff --git a/examples/reference/beginShape/beginShape5/beginShape5.rpde b/examples/reference/beginShape/beginShape5/beginShape5.rpde
index 439fdd4..d412d80 100644
--- a/examples/reference/beginShape/beginShape5/beginShape5.rpde
+++ b/examples/reference/beginShape/beginShape5/beginShape5.rpde
@@ -1,10 +1,5 @@
# beginShape 5 https://processing.org/reference/beginShape_.html
-OPEN <- as.integer(1)
-CLOSE <- as.integer(2)
-POINTS <- as.integer(3)
-LINES <- as.integer(5)
-
noFill()
beginShape()
vertex(30, 20)
diff --git a/examples/reference/bezierTangent/bezierTangent1/bezierTangent1.rpde b/examples/reference/bezierTangent/bezierTangent1/bezierTangent1.rpde
index 9c88475..6a22e41 100644
--- a/examples/reference/bezierTangent/bezierTangent1/bezierTangent1.rpde
+++ b/examples/reference/bezierTangent/bezierTangent1/bezierTangent1.rpde
@@ -1,7 +1,5 @@
# bezierTangent 1 https://processing.org/reference/bezierTangent_.html
-PI <- 3.1415
-
noFill()
bezier(85, 20, 10, 10, 90, 90, 15, 80)
steps <- 6
diff --git a/examples/reference/bezierTangent/bezierTangent2/bezierTangent2.rpde b/examples/reference/bezierTangent/bezierTangent2/bezierTangent2.rpde
index 946337c..2805990 100644
--- a/examples/reference/bezierTangent/bezierTangent2/bezierTangent2.rpde
+++ b/examples/reference/bezierTangent/bezierTangent2/bezierTangent2.rpde
@@ -1,10 +1,5 @@
# bezierTangent 2 https://processing.org/reference/bezierTangent_.html
-PI <- 3.1415
-HALF_PI <- PI/2
-QUARTER_PI <- PI/4
-TWO_PI <- PI * 2
-
noFill()
bezier(85, 20, 10, 10, 90, 90, 15, 80)
stroke(255, 102, 0)
diff --git a/examples/reference/camera/camera0/camera0.rpde b/examples/reference/camera/camera0/camera0.rpde
index ba29de5..f76c6d8 100644
--- a/examples/reference/camera/camera0/camera0.rpde
+++ b/examples/reference/camera/camera0/camera0.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/examples/reference/curvePoint/curvePoint1/curvePoint1.rpde b/examples/reference/curvePoint/curvePoint1/curvePoint1.rpde
index 1d22b35..2cd69f8 100644
--- a/examples/reference/curvePoint/curvePoint1/curvePoint1.rpde
+++ b/examples/reference/curvePoint/curvePoint1/curvePoint1.rpde
@@ -1,7 +1,5 @@
# curvePoint 1 https://processing.org/reference/curvePoint_.html
-CENTER <- as.integer(3)
-
noFill()
curve(5, 26, 5, 26, 73, 24, 73, 61)
curve(5, 26, 73, 24, 73, 61, 15, 65)
diff --git a/examples/reference/curveTangent/curveTangent1/curveTangent1.rpde b/examples/reference/curveTangent/curveTangent1/curveTangent1.rpde
index 1510774..c3281d1 100644
--- a/examples/reference/curveTangent/curveTangent1/curveTangent1.rpde
+++ b/examples/reference/curveTangent/curveTangent1/curveTangent1.rpde
@@ -1,8 +1,5 @@
# curveTangent 1 https://processing.org/reference/curveTangent_.html
-PI <- 3.1415
-HALF_PI <- PI/2
-
noFill()
curve(5, 26, 73, 24, 73, 61, 15, 65)
steps <- 6
diff --git a/examples/reference/ellipseMode/ellipseMode0/ellipseMode0.rpde b/examples/reference/ellipseMode/ellipseMode0/ellipseMode0.rpde
index 93c8d11..a692a8b 100644
--- a/examples/reference/ellipseMode/ellipseMode0/ellipseMode0.rpde
+++ b/examples/reference/ellipseMode/ellipseMode0/ellipseMode0.rpde
@@ -1,6 +1,3 @@
-RADIUS <- as.integer(2)
-CENTER <- as.integer(3)
-
ellipseMode(RADIUS) # Set ellipseMode to RADIUS
fill(255) # Set fill to white
ellipse(50, 50, 30, 30) # Draw white ellipse using RADIUS mode
diff --git a/examples/reference/ellipseMode/ellipseMode1/ellipseMode1.rpde b/examples/reference/ellipseMode/ellipseMode1/ellipseMode1.rpde
index 96cedd3..fb28014 100644
--- a/examples/reference/ellipseMode/ellipseMode1/ellipseMode1.rpde
+++ b/examples/reference/ellipseMode/ellipseMode1/ellipseMode1.rpde
@@ -1,6 +1,3 @@
-CORNERS <- as.integer(1)
-CORNER <- as.integer(0)
-
ellipseMode(CORNER) # Set ellipseMode is CORNER
fill(255) # Set fill to white
ellipse(25, 25, 50, 50) # Draw white ellipse using CORNER mode
diff --git a/examples/reference/endCamera/endCamera0/endCamera0.rpde b/examples/reference/endCamera/endCamera0/endCamera0.rpde
index 31ff7b6..bbd4944 100644
--- a/examples/reference/endCamera/endCamera0/endCamera0.rpde
+++ b/examples/reference/endCamera/endCamera0/endCamera0.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/examples/reference/endContour/endContour0/endContour0.rpde b/examples/reference/endContour/endContour0/endContour0.rpde
index 172724d..0f928c9 100644
--- a/examples/reference/endContour/endContour0/endContour0.rpde
+++ b/examples/reference/endContour/endContour0/endContour0.rpde
@@ -1,5 +1,3 @@
-CLOSE <- as.integer(2)
-
size(100, 100)
translate(50, 50)
stroke(255, 0, 0)
diff --git a/examples/reference/endShape/endShape0/endShape0.rpde b/examples/reference/endShape/endShape0/endShape0.rpde
index bd8be5d..2a18c71 100644
--- a/examples/reference/endShape/endShape0/endShape0.rpde
+++ b/examples/reference/endShape/endShape0/endShape0.rpde
@@ -1,5 +1,3 @@
-CLOSE <- as.integer(2)
-
noFill()
beginShape()
diff --git a/examples/reference/frustum/frustum0/frustum0.rpde b/examples/reference/frustum/frustum0/frustum0.rpde
index 41cda9d..526770a 100644
--- a/examples/reference/frustum/frustum0/frustum0.rpde
+++ b/examples/reference/frustum/frustum0/frustum0.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/examples/reference/lightFalloff/lightFalloff0/lightFalloff0.rpde b/examples/reference/lightFalloff/lightFalloff0/lightFalloff0.rpde
index aa78cb3..9ece715 100644
--- a/examples/reference/lightFalloff/lightFalloff0/lightFalloff0.rpde
+++ b/examples/reference/lightFalloff/lightFalloff0/lightFalloff0.rpde
@@ -1,5 +1,3 @@
-CLOSE <- as.integer(2)
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/examples/reference/normal/normal0/normal0.rpde b/examples/reference/normal/normal0/normal0.rpde
index e9ae135..2d95898 100644
--- a/examples/reference/normal/normal0/normal0.rpde
+++ b/examples/reference/normal/normal0/normal0.rpde
@@ -1,5 +1,3 @@
-CLOSE <- as.integer(2)
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/examples/reference/ortho/ortho0/ortho0.rpde b/examples/reference/ortho/ortho0/ortho0.rpde
index a45d01a..1755140 100644
--- a/examples/reference/ortho/ortho0/ortho0.rpde
+++ b/examples/reference/ortho/ortho0/ortho0.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/examples/reference/perspective/perspective0/perspective0.rpde b/examples/reference/perspective/perspective0/perspective0.rpde
index 227e50c..22b709d 100644
--- a/examples/reference/perspective/perspective0/perspective0.rpde
+++ b/examples/reference/perspective/perspective0/perspective0.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/examples/reference/rectMode/rectMode0/rectMode0.rpde b/examples/reference/rectMode/rectMode0/rectMode0.rpde
index c9ef6e7..158e677 100644
--- a/examples/reference/rectMode/rectMode0/rectMode0.rpde
+++ b/examples/reference/rectMode/rectMode0/rectMode0.rpde
@@ -1,6 +1,3 @@
-CORNERS <- as.integer(1)
-CORNER <- as.integer(0)
-
rectMode(CORNER) # Default rectMode is CORNER
fill(255) # Set fill to white
rect(25, 25, 50, 50) # Draw white rect using CORNER mode
diff --git a/examples/reference/rectMode/rectMode1/rectMode1.rpde b/examples/reference/rectMode/rectMode1/rectMode1.rpde
index 9db808d..3f0e743 100644
--- a/examples/reference/rectMode/rectMode1/rectMode1.rpde
+++ b/examples/reference/rectMode/rectMode1/rectMode1.rpde
@@ -1,6 +1,3 @@
-RADIUS <- as.integer(2)
-CENTER <- as.integer(3)
-
rectMode(RADIUS) # Set rectMode to RADIUS
fill(255) # Set fill to white
rect(50, 50, 30, 30) # Draw white rect using RADIUS mode
diff --git a/examples/reference/rotate/rotate0/rotate0.rpde b/examples/reference/rotate/rotate0/rotate0.rpde
index 1e09bf1..f34924b 100644
--- a/examples/reference/rotate/rotate0/rotate0.rpde
+++ b/examples/reference/rotate/rotate0/rotate0.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
translate(width/2, height/2)
rotate(PI/3)
rect(-26, -26, 52, 52)
diff --git a/examples/reference/rotateX/rotateX0/rotateX0.rpde b/examples/reference/rotateX/rotateX0/rotateX0.rpde
index 1c4bf45..9484f4b 100644
--- a/examples/reference/rotateX/rotateX0/rotateX0.rpde
+++ b/examples/reference/rotateX/rotateX0/rotateX0.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/examples/reference/rotateX/rotateX1/rotateX1.rpde b/examples/reference/rotateX/rotateX1/rotateX1.rpde
index 2fa052a..f622521 100644
--- a/examples/reference/rotateX/rotateX1/rotateX1.rpde
+++ b/examples/reference/rotateX/rotateX1/rotateX1.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/examples/reference/rotateY/rotateY0/rotateY0.rpde b/examples/reference/rotateY/rotateY0/rotateY0.rpde
index ef93c46..5608e6b 100644
--- a/examples/reference/rotateY/rotateY0/rotateY0.rpde
+++ b/examples/reference/rotateY/rotateY0/rotateY0.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/examples/reference/rotateY/rotateY1/rotateY1.rpde b/examples/reference/rotateY/rotateY1/rotateY1.rpde
index 95b5653..9162ee5 100644
--- a/examples/reference/rotateY/rotateY1/rotateY1.rpde
+++ b/examples/reference/rotateY/rotateY1/rotateY1.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/examples/reference/rotateZ/rotateZ0/rotateZ0.rpde b/examples/reference/rotateZ/rotateZ0/rotateZ0.rpde
index 3dff5b5..4a7edc1 100644
--- a/examples/reference/rotateZ/rotateZ0/rotateZ0.rpde
+++ b/examples/reference/rotateZ/rotateZ0/rotateZ0.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/examples/reference/rotateZ/rotateZ1/rotateZ1.rpde b/examples/reference/rotateZ/rotateZ1/rotateZ1.rpde
index 31e1bb7..297e992 100644
--- a/examples/reference/rotateZ/rotateZ1/rotateZ1.rpde
+++ b/examples/reference/rotateZ/rotateZ1/rotateZ1.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/examples/reference/shapeMode/shapeMode0/shapeMode0.rpde b/examples/reference/shapeMode/shapeMode0/shapeMode0.rpde
index a71f4eb..8a59605 100644
--- a/examples/reference/shapeMode/shapeMode0/shapeMode0.rpde
+++ b/examples/reference/shapeMode/shapeMode0/shapeMode0.rpde
@@ -1,6 +1,3 @@
-CENTER <- as.integer(3)
-CORNER <- as.integer(0)
-
setup <- function() {
size(100, 100)
bot = loadShape("https://raw.githubusercontent.com/processing/processing-docs/master/content/examples/Basics/Shape/LoadDisplaySVG/data/bot1.svg")
diff --git a/examples/reference/shearX/shearX0/shearX0.rpde b/examples/reference/shearX/shearX0/shearX0.rpde
index 21ae3b2..1a4c237 100644
--- a/examples/reference/shearX/shearX0/shearX0.rpde
+++ b/examples/reference/shearX/shearX0/shearX0.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
settings <- function() {
size(100, 100)
}
diff --git a/examples/reference/shearY/shearY0/shearY0.rpde b/examples/reference/shearY/shearY0/shearY0.rpde
index 472fc17..3985f29 100644
--- a/examples/reference/shearY/shearY0/shearY0.rpde
+++ b/examples/reference/shearY/shearY0/shearY0.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
settings <- function() {
size(100, 100)
}
diff --git a/examples/reference/spotLight/spotLight0/spotLight0.rpde b/examples/reference/spotLight/spotLight0/spotLight0.rpde
index 52aa250..9215a87 100644
--- a/examples/reference/spotLight/spotLight0/spotLight0.rpde
+++ b/examples/reference/spotLight/spotLight0/spotLight0.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/examples/reference/spotLight/spotLight1/spotLight1.rpde b/examples/reference/spotLight/spotLight1/spotLight1.rpde
index 1073c4b..53f38ae 100644
--- a/examples/reference/spotLight/spotLight1/spotLight1.rpde
+++ b/examples/reference/spotLight/spotLight1/spotLight1.rpde
@@ -1,5 +1,3 @@
-PI <- pi
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/examples/reference/vertex/vertex0/vertex0.rpde b/examples/reference/vertex/vertex0/vertex0.rpde
index add1200..d8dccd1 100644
--- a/examples/reference/vertex/vertex0/vertex0.rpde
+++ b/examples/reference/vertex/vertex0/vertex0.rpde
@@ -1,5 +1,3 @@
-POINTS <- as.integer(3)
-
beginShape(POINTS)
vertex(30, 20)
vertex(85, 20)
diff --git a/examples/reference/vertex/vertex1/vertex1.rpde b/examples/reference/vertex/vertex1/vertex1.rpde
index d9009c9..cf41279 100644
--- a/examples/reference/vertex/vertex1/vertex1.rpde
+++ b/examples/reference/vertex/vertex1/vertex1.rpde
@@ -1,5 +1,3 @@
-POINTS <- as.integer(3)
-
settings <- function() {
size(100, 100, P3D)
}
diff --git a/src/rprocessing/r/core.R b/src/rprocessing/r/core.R
index 560c53d..b6ecea8 100644
--- a/src/rprocessing/r/core.R
+++ b/src/rprocessing/r/core.R
@@ -229,3 +229,58 @@ FX2D = RLangPApplet$FX2D
PDF = RLangPApplet$PDF
SVG = RLangPApplet$SVG
DXF = RLangPApplet$DXF
+
+PI = RLangPApplet$PI
+HALF_PI = RLangPApplet$HALF_PI
+THIRD_PI = RLangPApplet$THIRD_PI
+QUARTER_PI = RLangPApplet$QUARTER_PI
+TWO_PI = RLangPApplet$TWO_PI
+TAU = RLangPApplet$TAU
+DEG_TO_RAD = RLangPApplet$DEG_TO_RAD
+RAD_TO_DEG = RLangPApplet$RAD_TO_DEG
+
+OPEN = RLangPApplet$OPEN
+CLOSE = RLangPApplet$CLOSE
+
+CHORD = RLangPApplet$CHORD
+PIE = RLangPApplet$PIE
+
+CORNER = RLangPApplet$CORNER
+CORNERS = RLangPApplet$CORNERS
+RADIUS = RLangPApplet$RADIUS
+CENTER = RLangPApplet$CENTER
+DIAMETER = RLangPApplet$DIAMETER
+SQUARE = RLangPApplet$SQUARE
+ROUND = RLangPApplet$ROUND
+PROJECT = RLangPApplet$PROJECT
+MITER = RLangPApplet$MITER
+BEVEL = RLangPApplet$BEVEL
+
+GROUP = RLangPApplet$GROUP
+
+POINT = RLangPApplet$POINT
+POINTS = RLangPApplet$POINTS
+
+LINE = RLangPApplet$LINE
+LINES = RLangPApplet$LINES
+LINE_STRIP = RLangPApplet$LINE_STRIP
+LINE_LOOP = RLangPApplet$LINE_LOOP
+
+TRIANGLE = RLangPApplet$TRIANGLE
+TRIANGLES = RLangPApplet$TRIANGLES
+TRIANGLE_STRIP = RLangPApplet$TRIANGLE_STRIP
+TRIANGLE_FAN = RLangPApplet$TRIANGLE_FAN
+
+QUAD = RLangPApplet$QUAD
+QUADS = RLangPApplet$QUADS
+QUAD_STRIP = RLangPApplet$QUAD_STRIP
+
+POLYGON = RLangPApplet$POLYGON
+PATH = RLangPApplet$PATH
+
+RECT = RLangPApplet$RECT
+ELLIPSE = RLangPApplet$ELLIPSE
+ARC = RLangPApplet$ARC
+
+SPHERE = RLangPApplet$SPHERE
+BOX = RLangPApplet$BOX
diff --git a/src/test/e2e/core/function/AmbientLight1Test.java b/src/test/e2e/core/function/AmbientLight1Test.java
index 5c3345b..66e2ac9 100644
--- a/src/test/e2e/core/function/AmbientLight1Test.java
+++ b/src/test/e2e/core/function/AmbientLight1Test.java
@@ -9,7 +9,7 @@
public class AmbientLight1Test extends E2eTestBase {
public AmbientLight1Test() {
- coreCodeTemplate = "PI <- pi\n\nsettings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n background(0)\n noStroke()\n directionalLight(126, 126, 126, 0, 0, -1)\n ambientLight(102, 102, 102)\n translate(32, 50, 0)\n rotateY(PI/5)\n box(40)\n translate(60, 0, 0)\n sphere(30)\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "settings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n background(0)\n noStroke()\n directionalLight(126, 126, 126, 0, 0, -1)\n ambientLight(102, 102, 102)\n translate(32, 50, 0)\n rotateY(PI/5)\n box(40)\n translate(60, 0, 0)\n sphere(30)\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/ambientLight_1.png";
}
diff --git a/src/test/e2e/core/function/ApplyMatrix0Test.java b/src/test/e2e/core/function/ApplyMatrix0Test.java
index 06decb4..09f4877 100644
--- a/src/test/e2e/core/function/ApplyMatrix0Test.java
+++ b/src/test/e2e/core/function/ApplyMatrix0Test.java
@@ -9,7 +9,7 @@
public class ApplyMatrix0Test extends E2eTestBase {
public ApplyMatrix0Test() {
- coreCodeTemplate = "PI <- pi\n\nsettings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n noFill()\n translate(50, 50, 0)\n rotateY(PI/6)\n stroke(153)\n box(35)\n # Set rotation angles\n ct = cos(PI/9)\n st = sin(PI/9)\n # Matrix for rotation around the Y axis\n applyMatrix(ct, 0, st, 0, 0, 1, 0, 0, -st, 0, ct, 0, 0, 0, 0, 1)\n stroke(255)\n box(50)\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "settings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n noFill()\n translate(50, 50, 0)\n rotateY(PI/6)\n stroke(153)\n box(35)\n # Set rotation angles\n ct = cos(PI/9)\n st = sin(PI/9)\n # Matrix for rotation around the Y axis\n applyMatrix(ct, 0, st, 0, 0, 1, 0, 0, -st, 0, ct, 0, 0, 0, 0, 1)\n stroke(255)\n box(50)\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/applyMatrix_.png";
}
diff --git a/src/test/e2e/core/function/Arc1Test.java b/src/test/e2e/core/function/Arc1Test.java
index 381e1e9..353e51a 100644
--- a/src/test/e2e/core/function/Arc1Test.java
+++ b/src/test/e2e/core/function/Arc1Test.java
@@ -9,7 +9,7 @@
public class Arc1Test extends E2eTestBase {
public Arc1Test() {
- coreCodeTemplate = "# arc 1 https://processing.org/reference/arc_.html\n\n# TODO: replace with built-in constants\nPI <- 3.1415\nHALF_PI <- PI/2\nQUARTER_PI <- PI/4\nTWO_PI <- PI * 2\n\narc(50, 55, 50, 50, 0, HALF_PI)\nnoFill()\narc(50, 55, 60, 60, HALF_PI, PI)\narc(50, 55, 70, 70, PI, PI + QUARTER_PI)\narc(50, 55, 80, 80, PI + QUARTER_PI, TWO_PI)\n\nsaveFrame(\"%s\")\nexit()\n";
+ coreCodeTemplate = "# arc 1 https://processing.org/reference/arc_.html\n\narc(50, 55, 50, 50, 0, HALF_PI)\nnoFill()\narc(50, 55, 60, 60, HALF_PI, PI)\narc(50, 55, 70, 70, PI, PI + QUARTER_PI)\narc(50, 55, 80, 80, PI + QUARTER_PI, TWO_PI)\n\nsaveFrame(\"%s\")\nexit()\n";
referenceURI = "https://processing.org/reference/images/arc_.png";
}
diff --git a/src/test/e2e/core/function/Arc2Test.java b/src/test/e2e/core/function/Arc2Test.java
index 7a3a7cc..caba034 100644
--- a/src/test/e2e/core/function/Arc2Test.java
+++ b/src/test/e2e/core/function/Arc2Test.java
@@ -9,7 +9,7 @@
public class Arc2Test extends E2eTestBase {
public Arc2Test() {
- coreCodeTemplate = "# arc 2 https://processing.org/reference/arc_.html\n\n# TODO: replace with built-in constants\nPI <- 3.1415\nQUARTER_PI <- PI/4\n\n# TODO: Fix double to int casts\nOPEN <- as.integer(1)\nCHORD <- as.integer(2)\nPIE <- as.integer(3)\n\narc(50, 50, 80, 80, 0, PI + QUARTER_PI, OPEN)\n\nsaveFrame(\"%s\")\nexit()\n";
+ coreCodeTemplate = "# arc 2 https://processing.org/reference/arc_.html\n\narc(50, 50, 80, 80, 0, PI + QUARTER_PI, OPEN)\n\nsaveFrame(\"%s\")\nexit()\n";
referenceURI = "https://processing.org/reference/images/arc_2.png";
}
diff --git a/src/test/e2e/core/function/Arc3Test.java b/src/test/e2e/core/function/Arc3Test.java
index 8dd849b..fbc4e60 100644
--- a/src/test/e2e/core/function/Arc3Test.java
+++ b/src/test/e2e/core/function/Arc3Test.java
@@ -9,7 +9,7 @@
public class Arc3Test extends E2eTestBase {
public Arc3Test() {
- coreCodeTemplate = "# arc 3 https://processing.org/reference/arc_.html\n\n# TODO: replace with built-in constants\nPI <- 3.1415\nQUARTER_PI <- PI/4\n\n# TODO: Fix double to int casts\nOPEN <- as.integer(1)\nCHORD <- as.integer(2)\nPIE <- as.integer(3)\n\narc(50, 50, 80, 80, 0, PI + QUARTER_PI, CHORD)\n\nsaveFrame(\"%s\")\nexit()\n";
+ coreCodeTemplate = "# arc 3 https://processing.org/reference/arc_.html\n\narc(50, 50, 80, 80, 0, PI + QUARTER_PI, CHORD)\n\nsaveFrame(\"%s\")\nexit()\n";
referenceURI = "https://processing.org/reference/images/arc_3.png";
}
diff --git a/src/test/e2e/core/function/Arc4Test.java b/src/test/e2e/core/function/Arc4Test.java
index 5c8cff9..9dbfbcc 100644
--- a/src/test/e2e/core/function/Arc4Test.java
+++ b/src/test/e2e/core/function/Arc4Test.java
@@ -9,7 +9,7 @@
public class Arc4Test extends E2eTestBase {
public Arc4Test() {
- coreCodeTemplate = "# arc 4 https://processing.org/reference/arc_.html\n\n# TODO: replace with built-in constants\nPI <- 3.1415\nHALF_PI <- PI/2\nQUARTER_PI <- PI/4\nTWO_PI <- PI * 2\n\n# TODO: Fix double to int casts\nOPEN <- as.integer(1)\nCHORD <- as.integer(2)\nPIE <- as.integer(3)\n\narc(50, 50, 80, 80, 0, PI + QUARTER_PI, PIE)\n\nsaveFrame(\"%s\")\nexit()\n";
+ coreCodeTemplate = "# arc 4 https://processing.org/reference/arc_.html\n\narc(50, 50, 80, 80, 0, PI + QUARTER_PI, PIE)\n\nsaveFrame(\"%s\")\nexit()\n";
referenceURI = "https://processing.org/reference/images/arc_4.png";
}
diff --git a/src/test/e2e/core/function/BeginCamera0Test.java b/src/test/e2e/core/function/BeginCamera0Test.java
index 67528e1..18e0832 100644
--- a/src/test/e2e/core/function/BeginCamera0Test.java
+++ b/src/test/e2e/core/function/BeginCamera0Test.java
@@ -9,7 +9,7 @@
public class BeginCamera0Test extends E2eTestBase {
public BeginCamera0Test() {
- coreCodeTemplate = "PI <- pi\n\nsettings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n noFill()\n \n beginCamera()\n camera()\n rotateX(-PI/6)\n endCamera()\n \n translate(50, 50, 0)\n rotateY(PI/3)\n box(45)\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "settings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n noFill()\n \n beginCamera()\n camera()\n rotateX(-PI/6)\n endCamera()\n \n translate(50, 50, 0)\n rotateY(PI/3)\n box(45)\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/beginCamera_.png";
}
diff --git a/src/test/e2e/core/function/Camera0Test.java b/src/test/e2e/core/function/Camera0Test.java
index ae6d146..a79d66a 100644
--- a/src/test/e2e/core/function/Camera0Test.java
+++ b/src/test/e2e/core/function/Camera0Test.java
@@ -9,7 +9,7 @@
public class Camera0Test extends E2eTestBase {
public Camera0Test() {
- coreCodeTemplate = "PI <- pi\n\nsettings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n size(100, 100, P3D)\n noFill()\n background(204)\n camera(70, 35, 120, 50, 50, 0, 0, 1, 0)\n translate(50, 50, 0)\n rotateX(-PI/6)\n rotateY(PI/3)\n box(45)\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "settings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n size(100, 100, P3D)\n noFill()\n background(204)\n camera(70, 35, 120, 50, 50, 0, 0, 1, 0)\n translate(50, 50, 0)\n rotateX(-PI/6)\n rotateY(PI/3)\n box(45)\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/camera_.png";
}
diff --git a/src/test/e2e/core/function/EllipseMode0Test.java b/src/test/e2e/core/function/EllipseMode0Test.java
index 975d649..a6304e7 100644
--- a/src/test/e2e/core/function/EllipseMode0Test.java
+++ b/src/test/e2e/core/function/EllipseMode0Test.java
@@ -9,7 +9,7 @@
public class EllipseMode0Test extends E2eTestBase {
public EllipseMode0Test() {
- coreCodeTemplate = "RADIUS <- as.integer(2)\nCENTER <- as.integer(3)\n\nellipseMode(RADIUS) # Set ellipseMode to RADIUS\nfill(255) # Set fill to white\nellipse(50, 50, 30, 30) # Draw white ellipse using RADIUS mode\n\nellipseMode(CENTER) # Set ellipseMode to CENTER\nfill(100) # Set fill to gray\nellipse(50, 50, 30, 30) # Draw gray ellipse using CENTER mode\n\nsaveFrame(\"%s\")\nexit()\n";
+ coreCodeTemplate = "ellipseMode(RADIUS) # Set ellipseMode to RADIUS\nfill(255) # Set fill to white\nellipse(50, 50, 30, 30) # Draw white ellipse using RADIUS mode\n\nellipseMode(CENTER) # Set ellipseMode to CENTER\nfill(100) # Set fill to gray\nellipse(50, 50, 30, 30) # Draw gray ellipse using CENTER mode\n\nsaveFrame(\"%s\")\nexit()\n";
referenceURI = "https://processing.org/reference/images/ellipseMode_0.png";
}
diff --git a/src/test/e2e/core/function/EllipseMode1Test.java b/src/test/e2e/core/function/EllipseMode1Test.java
index 81dfa07..36899b1 100644
--- a/src/test/e2e/core/function/EllipseMode1Test.java
+++ b/src/test/e2e/core/function/EllipseMode1Test.java
@@ -9,7 +9,7 @@
public class EllipseMode1Test extends E2eTestBase {
public EllipseMode1Test() {
- coreCodeTemplate = "CORNERS <- as.integer(1)\nCORNER <- as.integer(0)\n\nellipseMode(CORNER) # Set ellipseMode is CORNER\nfill(255) # Set fill to white\nellipse(25, 25, 50, 50) # Draw white ellipse using CORNER mode\n\nellipseMode(CORNERS) # Set ellipseMode to CORNERS\nfill(100) # Set fill to gray\nellipse(25, 25, 50, 50) # Draw gray ellipse using CORNERS mode\n\nsaveFrame(\"%s\")\nexit()\n";
+ coreCodeTemplate = "ellipseMode(CORNER) # Set ellipseMode is CORNER\nfill(255) # Set fill to white\nellipse(25, 25, 50, 50) # Draw white ellipse using CORNER mode\n\nellipseMode(CORNERS) # Set ellipseMode to CORNERS\nfill(100) # Set fill to gray\nellipse(25, 25, 50, 50) # Draw gray ellipse using CORNERS mode\n\nsaveFrame(\"%s\")\nexit()\n";
referenceURI = "https://processing.org/reference/images/ellipseMode_1.png";
}
diff --git a/src/test/e2e/core/function/EndCamera0Test.java b/src/test/e2e/core/function/EndCamera0Test.java
index 9c49e6b..51fc7fb 100644
--- a/src/test/e2e/core/function/EndCamera0Test.java
+++ b/src/test/e2e/core/function/EndCamera0Test.java
@@ -9,7 +9,7 @@
public class EndCamera0Test extends E2eTestBase {
public EndCamera0Test() {
- coreCodeTemplate = "PI <- pi\n\nsettings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n noFill()\n \n beginCamera()\n camera()\n rotateX(-PI/6)\n endCamera()\n \n translate(50, 50, 0)\n rotateY(PI/3)\n box(45)\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "settings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n noFill()\n \n beginCamera()\n camera()\n rotateX(-PI/6)\n endCamera()\n \n translate(50, 50, 0)\n rotateY(PI/3)\n box(45)\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/endCamera_.png";
}
diff --git a/src/test/e2e/core/function/EndContour0Test.java b/src/test/e2e/core/function/EndContour0Test.java
index 81aba06..e451e8a 100644
--- a/src/test/e2e/core/function/EndContour0Test.java
+++ b/src/test/e2e/core/function/EndContour0Test.java
@@ -9,7 +9,7 @@
public class EndContour0Test extends E2eTestBase {
public EndContour0Test() {
- coreCodeTemplate = "CLOSE <- as.integer(2)\n\nsize(100, 100)\ntranslate(50, 50)\nstroke(255, 0, 0)\nbeginShape()\n# Exterior part of shape, clockwise winding\nvertex(-40, -40)\nvertex(40, -40)\nvertex(40, 40)\nvertex(-40, 40)\n# Interior part of shape, counter-clockwise winding\nbeginContour()\nvertex(-20, -20)\nvertex(-20, 20)\nvertex(20, 20)\nvertex(20, -20)\nendContour()\nendShape(CLOSE)\n\nsaveFrame(\"%s\")\nexit()\n";
+ coreCodeTemplate = "size(100, 100)\ntranslate(50, 50)\nstroke(255, 0, 0)\nbeginShape()\n# Exterior part of shape, clockwise winding\nvertex(-40, -40)\nvertex(40, -40)\nvertex(40, 40)\nvertex(-40, 40)\n# Interior part of shape, counter-clockwise winding\nbeginContour()\nvertex(-20, -20)\nvertex(-20, 20)\nvertex(20, 20)\nvertex(20, -20)\nendContour()\nendShape(CLOSE)\n\nsaveFrame(\"%s\")\nexit()\n";
referenceURI = "https://processing.org/reference/images/beginContour_0.png";
}
diff --git a/src/test/e2e/core/function/EndShape0Test.java b/src/test/e2e/core/function/EndShape0Test.java
index 59b8f4d..b3242fc 100644
--- a/src/test/e2e/core/function/EndShape0Test.java
+++ b/src/test/e2e/core/function/EndShape0Test.java
@@ -9,7 +9,7 @@
public class EndShape0Test extends E2eTestBase {
public EndShape0Test() {
- coreCodeTemplate = "CLOSE <- as.integer(2)\n\nnoFill()\n\nbeginShape()\nvertex(20, 20)\nvertex(45, 20)\nvertex(45, 80)\nendShape(CLOSE)\n\nbeginShape()\nvertex(50, 20)\nvertex(75, 20)\nvertex(75, 80)\nendShape()\n\nsaveFrame(\"%s\")\nexit()\n";
+ coreCodeTemplate = "noFill()\n\nbeginShape()\nvertex(20, 20)\nvertex(45, 20)\nvertex(45, 80)\nendShape(CLOSE)\n\nbeginShape()\nvertex(50, 20)\nvertex(75, 20)\nvertex(75, 80)\nendShape()\n\nsaveFrame(\"%s\")\nexit()\n";
referenceURI = "https://processing.org/reference/images/endShape_.png";
}
diff --git a/src/test/e2e/core/function/Frustum0Test.java b/src/test/e2e/core/function/Frustum0Test.java
index 3517d2d..d976293 100644
--- a/src/test/e2e/core/function/Frustum0Test.java
+++ b/src/test/e2e/core/function/Frustum0Test.java
@@ -9,7 +9,7 @@
public class Frustum0Test extends E2eTestBase {
public Frustum0Test() {
- coreCodeTemplate = "PI <- pi\n\nsettings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n noFill()\n background(204)\n frustum(-10, 0, 0, 10, 10, 200)\n rotateY(PI/6)\n box(45)\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "settings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n noFill()\n background(204)\n frustum(-10, 0, 0, 10, 10, 200)\n rotateY(PI/6)\n box(45)\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/frustum_.png";
}
diff --git a/src/test/e2e/core/function/LightFalloff0Test.java b/src/test/e2e/core/function/LightFalloff0Test.java
index cc428cb..872c427 100644
--- a/src/test/e2e/core/function/LightFalloff0Test.java
+++ b/src/test/e2e/core/function/LightFalloff0Test.java
@@ -9,7 +9,7 @@
public class LightFalloff0Test extends E2eTestBase {
public LightFalloff0Test() {
- coreCodeTemplate = "CLOSE <- as.integer(2)\n\nsettings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n noStroke()\n background(0)\n lightFalloff(1, 0.001, 0)\n pointLight(150, 250, 150, 50, 50, 50)\n beginShape()\n vertex(0, 0, 0)\n vertex(100, 0, -100)\n vertex(100, 100, -100)\n vertex(0, 100, 0)\n endShape(CLOSE)\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "settings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n noStroke()\n background(0)\n lightFalloff(1, 0.001, 0)\n pointLight(150, 250, 150, 50, 50, 50)\n beginShape()\n vertex(0, 0, 0)\n vertex(100, 0, -100)\n vertex(100, 100, -100)\n vertex(0, 100, 0)\n endShape(CLOSE)\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/lightFalloff_.png";
}
diff --git a/src/test/e2e/core/function/Normal0Test.java b/src/test/e2e/core/function/Normal0Test.java
index c8ffa63..c8a0c00 100644
--- a/src/test/e2e/core/function/Normal0Test.java
+++ b/src/test/e2e/core/function/Normal0Test.java
@@ -9,7 +9,7 @@
public class Normal0Test extends E2eTestBase {
public Normal0Test() {
- coreCodeTemplate = "CLOSE <- as.integer(2)\n\nsettings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n noStroke()\n background(0)\n pointLight(150, 250, 150, 10, 30, 50)\n beginShape()\n normal(0, 0, 1)\n vertex(20, 20, -10)\n vertex(80, 20, 10)\n vertex(80, 80, -10)\n vertex(20, 80, 10)\n endShape(CLOSE)\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "settings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n noStroke()\n background(0)\n pointLight(150, 250, 150, 10, 30, 50)\n beginShape()\n normal(0, 0, 1)\n vertex(20, 20, -10)\n vertex(80, 20, 10)\n vertex(80, 80, -10)\n vertex(20, 80, 10)\n endShape(CLOSE)\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/normal_.png";
}
diff --git a/src/test/e2e/core/function/Ortho0Test.java b/src/test/e2e/core/function/Ortho0Test.java
index bb4e117..9dc5dd0 100644
--- a/src/test/e2e/core/function/Ortho0Test.java
+++ b/src/test/e2e/core/function/Ortho0Test.java
@@ -9,7 +9,7 @@
public class Ortho0Test extends E2eTestBase {
public Ortho0Test() {
- coreCodeTemplate = "PI <- pi\n\nsettings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n noFill()\n ortho(0, width, 0, height) # same as ortho()\n translate(width/2, height/2, 0)\n rotateX(-PI/6)\n rotateY(PI/3)\n box(45)\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "settings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n noFill()\n ortho(0, width, 0, height) # same as ortho()\n translate(width/2, height/2, 0)\n rotateX(-PI/6)\n rotateY(PI/3)\n box(45)\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/ortho_.png";
}
diff --git a/src/test/e2e/core/function/Perspective0Test.java b/src/test/e2e/core/function/Perspective0Test.java
index 5a394a4..c25b766 100644
--- a/src/test/e2e/core/function/Perspective0Test.java
+++ b/src/test/e2e/core/function/Perspective0Test.java
@@ -9,7 +9,7 @@
public class Perspective0Test extends E2eTestBase {
public Perspective0Test() {
- coreCodeTemplate = "PI <- pi\n\nsettings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n noFill()\n fov = PI/3\n cameraZ = (height/2)/tan(fov/2)\n perspective(fov, width/height, cameraZ/10, cameraZ * 10)\n translate(50, 50, 0)\n rotateX(-PI/6)\n rotateY(PI/3)\n box(45)\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "settings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n noFill()\n fov = PI/3\n cameraZ = (height/2)/tan(fov/2)\n perspective(fov, width/height, cameraZ/10, cameraZ * 10)\n translate(50, 50, 0)\n rotateX(-PI/6)\n rotateY(PI/3)\n box(45)\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/perspective_.png";
}
diff --git a/src/test/e2e/core/function/RectMode0Test.java b/src/test/e2e/core/function/RectMode0Test.java
index 46f7e13..00a2c68 100644
--- a/src/test/e2e/core/function/RectMode0Test.java
+++ b/src/test/e2e/core/function/RectMode0Test.java
@@ -9,7 +9,7 @@
public class RectMode0Test extends E2eTestBase {
public RectMode0Test() {
- coreCodeTemplate = "CORNERS <- as.integer(1)\nCORNER <- as.integer(0)\n\nrectMode(CORNER) # Default rectMode is CORNER\nfill(255) # Set fill to white\nrect(25, 25, 50, 50) # Draw white rect using CORNER mode\n\nrectMode(CORNERS) # Set rectMode to CORNERS\nfill(100) # Set fill to gray\nrect(25, 25, 50, 50) # Draw gray rect using CORNERS mode\n\nsaveFrame(\"%s\")\nexit()\n";
+ coreCodeTemplate = "rectMode(CORNER) # Default rectMode is CORNER\nfill(255) # Set fill to white\nrect(25, 25, 50, 50) # Draw white rect using CORNER mode\n\nrectMode(CORNERS) # Set rectMode to CORNERS\nfill(100) # Set fill to gray\nrect(25, 25, 50, 50) # Draw gray rect using CORNERS mode\n\nsaveFrame(\"%s\")\nexit()\n";
referenceURI = "https://processing.org/reference/images/rectMode_0.png";
}
diff --git a/src/test/e2e/core/function/RectMode1Test.java b/src/test/e2e/core/function/RectMode1Test.java
index a4f199e..0bc2832 100644
--- a/src/test/e2e/core/function/RectMode1Test.java
+++ b/src/test/e2e/core/function/RectMode1Test.java
@@ -9,7 +9,7 @@
public class RectMode1Test extends E2eTestBase {
public RectMode1Test() {
- coreCodeTemplate = "RADIUS <- as.integer(2)\nCENTER <- as.integer(3)\n\nrectMode(RADIUS) # Set rectMode to RADIUS\nfill(255) # Set fill to white\nrect(50, 50, 30, 30) # Draw white rect using RADIUS mode\n\nrectMode(CENTER) # Set rectMode to CENTER\nfill(100) # Set fill to gray\nrect(50, 50, 30, 30) # Draw gray rect using CENTER mode\n\nsaveFrame(\"%s\")\nexit()\n";
+ coreCodeTemplate = "rectMode(RADIUS) # Set rectMode to RADIUS\nfill(255) # Set fill to white\nrect(50, 50, 30, 30) # Draw white rect using RADIUS mode\n\nrectMode(CENTER) # Set rectMode to CENTER\nfill(100) # Set fill to gray\nrect(50, 50, 30, 30) # Draw gray rect using CENTER mode\n\nsaveFrame(\"%s\")\nexit()\n";
referenceURI = "https://processing.org/reference/images/rectMode_1.png";
}
diff --git a/src/test/e2e/core/function/Rotate0Test.java b/src/test/e2e/core/function/Rotate0Test.java
index 831fe1d..9ef060a 100644
--- a/src/test/e2e/core/function/Rotate0Test.java
+++ b/src/test/e2e/core/function/Rotate0Test.java
@@ -9,7 +9,7 @@
public class Rotate0Test extends E2eTestBase {
public Rotate0Test() {
- coreCodeTemplate = "PI <- pi\n\ntranslate(width/2, height/2)\nrotate(PI/3)\nrect(-26, -26, 52, 52)\n\nsaveFrame(\"%s\")\nexit()\n";
+ coreCodeTemplate = "translate(width/2, height/2)\nrotate(PI/3)\nrect(-26, -26, 52, 52)\n\nsaveFrame(\"%s\")\nexit()\n";
referenceURI = "https://processing.org/reference/images/rotate_.png";
}
diff --git a/src/test/e2e/core/function/RotateX0Test.java b/src/test/e2e/core/function/RotateX0Test.java
index f408bce..116a656 100644
--- a/src/test/e2e/core/function/RotateX0Test.java
+++ b/src/test/e2e/core/function/RotateX0Test.java
@@ -9,7 +9,7 @@
public class RotateX0Test extends E2eTestBase {
public RotateX0Test() {
- coreCodeTemplate = "PI <- pi\n\nsettings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n translate(width/2, height/2)\n rotateX(PI/3)\n rect(-26, -26, 52, 52)\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "settings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n translate(width/2, height/2)\n rotateX(PI/3)\n rect(-26, -26, 52, 52)\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/rotateX_0.png";
}
diff --git a/src/test/e2e/core/function/RotateY0Test.java b/src/test/e2e/core/function/RotateY0Test.java
index e28a0d1..8425427 100644
--- a/src/test/e2e/core/function/RotateY0Test.java
+++ b/src/test/e2e/core/function/RotateY0Test.java
@@ -9,7 +9,7 @@
public class RotateY0Test extends E2eTestBase {
public RotateY0Test() {
- coreCodeTemplate = "PI <- pi\n\nsettings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n translate(width/2, height/2)\n rotateY(PI/3)\n rect(-26, -26, 52, 52)\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "settings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n translate(width/2, height/2)\n rotateY(PI/3)\n rect(-26, -26, 52, 52)\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/rotateY_0.png";
}
diff --git a/src/test/e2e/core/function/RotateZ0Test.java b/src/test/e2e/core/function/RotateZ0Test.java
index a66744d..368e848 100644
--- a/src/test/e2e/core/function/RotateZ0Test.java
+++ b/src/test/e2e/core/function/RotateZ0Test.java
@@ -9,7 +9,7 @@
public class RotateZ0Test extends E2eTestBase {
public RotateZ0Test() {
- coreCodeTemplate = "PI <- pi\n\nsettings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n translate(width/2, height/2)\n rotateZ(PI/3)\n rect(-26, -26, 52, 52)\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "settings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n translate(width/2, height/2)\n rotateZ(PI/3)\n rect(-26, -26, 52, 52)\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/rotateZ_0.png";
}
diff --git a/src/test/e2e/core/function/ShapeMode0Test.java b/src/test/e2e/core/function/ShapeMode0Test.java
index 3f6c9c9..6da7398 100644
--- a/src/test/e2e/core/function/ShapeMode0Test.java
+++ b/src/test/e2e/core/function/ShapeMode0Test.java
@@ -9,7 +9,7 @@
public class ShapeMode0Test extends E2eTestBase {
public ShapeMode0Test() {
- coreCodeTemplate = "CENTER <- as.integer(3)\nCORNER <- as.integer(0)\n\nsetup <- function() {\n size(100, 100)\n bot = loadShape(\"https://raw.githubusercontent.com/processing/processing-docs/master/content/examples/Basics/Shape/LoadDisplaySVG/data/bot1.svg\")\n}\n\ndraw <- function() {\n shapeMode(CENTER)\n shape(bot, 35, 35, 50, 50)\n shapeMode(CORNER)\n shape(bot, 35, 35, 50, 50)\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "setup <- function() {\n size(100, 100)\n bot = loadShape(\"https://raw.githubusercontent.com/processing/processing-docs/master/content/examples/Basics/Shape/LoadDisplaySVG/data/bot1.svg\")\n}\n\ndraw <- function() {\n shapeMode(CENTER)\n shape(bot, 35, 35, 50, 50)\n shapeMode(CORNER)\n shape(bot, 35, 35, 50, 50)\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/shapeMode_.png";
}
diff --git a/src/test/e2e/core/function/ShearX0Test.java b/src/test/e2e/core/function/ShearX0Test.java
index 03b08ad..02f1967 100644
--- a/src/test/e2e/core/function/ShearX0Test.java
+++ b/src/test/e2e/core/function/ShearX0Test.java
@@ -9,7 +9,7 @@
public class ShearX0Test extends E2eTestBase {
public ShearX0Test() {
- coreCodeTemplate = "PI <- pi\n\nsettings <- function() {\n size(100, 100)\n}\n\ndraw <- function() {\n translate(width/4, height/4)\n shearY(PI/4)\n rect(0, 0, 30, 30)\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "settings <- function() {\n size(100, 100)\n}\n\ndraw <- function() {\n translate(width/4, height/4)\n shearY(PI/4)\n rect(0, 0, 30, 30)\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/shearX_.png";
}
diff --git a/src/test/e2e/core/function/ShearY0Test.java b/src/test/e2e/core/function/ShearY0Test.java
index 6842fe7..cc1669b 100644
--- a/src/test/e2e/core/function/ShearY0Test.java
+++ b/src/test/e2e/core/function/ShearY0Test.java
@@ -9,7 +9,7 @@
public class ShearY0Test extends E2eTestBase {
public ShearY0Test() {
- coreCodeTemplate = "PI <- pi\n\nsettings <- function() {\n size(100, 100)\n}\n\ndraw <- function() {\n translate(width/4, height/4)\n shearX(PI/4)\n rect(0, 0, 30, 30)\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "settings <- function() {\n size(100, 100)\n}\n\ndraw <- function() {\n translate(width/4, height/4)\n shearX(PI/4)\n rect(0, 0, 30, 30)\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/shearY_.png";
}
diff --git a/src/test/e2e/core/function/SpotLight0Test.java b/src/test/e2e/core/function/SpotLight0Test.java
index ce06e3c..5cc116d 100644
--- a/src/test/e2e/core/function/SpotLight0Test.java
+++ b/src/test/e2e/core/function/SpotLight0Test.java
@@ -9,7 +9,7 @@
public class SpotLight0Test extends E2eTestBase {
public SpotLight0Test() {
- coreCodeTemplate = "PI <- pi\n\nsettings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n background(0)\n noStroke()\n spotLight(51, 102, 126, 80, 20, 40, -1, 0, 0, PI/2, 2)\n translate(20, 50, 0)\n sphere(30)\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "settings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n background(0)\n noStroke()\n spotLight(51, 102, 126, 80, 20, 40, -1, 0, 0, PI/2, 2)\n translate(20, 50, 0)\n sphere(30)\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/spotLight_0.png";
}
diff --git a/src/test/e2e/core/function/SpotLight1Test.java b/src/test/e2e/core/function/SpotLight1Test.java
index adf426c..8a6fc5f 100644
--- a/src/test/e2e/core/function/SpotLight1Test.java
+++ b/src/test/e2e/core/function/SpotLight1Test.java
@@ -9,7 +9,7 @@
public class SpotLight1Test extends E2eTestBase {
public SpotLight1Test() {
- coreCodeTemplate = "PI <- pi\n\nsettings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n background(0)\n concentration = 600 # Try 1 -> 10000\n background(0)\n noStroke()\n spotLight(51, 102, 126, 50, 50, 400, 0, 0, -1, PI/16, concentration)\n translate(80, 50, 0)\n sphere(30)\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "settings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n background(0)\n concentration = 600 # Try 1 -> 10000\n background(0)\n noStroke()\n spotLight(51, 102, 126, 50, 50, 400, 0, 0, -1, PI/16, concentration)\n translate(80, 50, 0)\n sphere(30)\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/spotLight_1.png";
}
diff --git a/src/test/e2e/core/function/Vertex0Test.java b/src/test/e2e/core/function/Vertex0Test.java
index ea37c88..54b6d1b 100644
--- a/src/test/e2e/core/function/Vertex0Test.java
+++ b/src/test/e2e/core/function/Vertex0Test.java
@@ -9,7 +9,7 @@
public class Vertex0Test extends E2eTestBase {
public Vertex0Test() {
- coreCodeTemplate = "POINTS <- as.integer(3)\n\nbeginShape(POINTS)\nvertex(30, 20)\nvertex(85, 20)\nvertex(85, 75)\nvertex(30, 75)\nendShape()\n\nsaveFrame(\"%s\")\nexit()\n";
+ coreCodeTemplate = "beginShape(POINTS)\nvertex(30, 20)\nvertex(85, 20)\nvertex(85, 75)\nvertex(30, 75)\nendShape()\n\nsaveFrame(\"%s\")\nexit()\n";
referenceURI = "https://processing.org/reference/images/vertex_0.png";
}
diff --git a/src/test/e2e/core/function/Vertex1Test.java b/src/test/e2e/core/function/Vertex1Test.java
index 6025960..28b047b 100644
--- a/src/test/e2e/core/function/Vertex1Test.java
+++ b/src/test/e2e/core/function/Vertex1Test.java
@@ -9,7 +9,7 @@
public class Vertex1Test extends E2eTestBase {
public Vertex1Test() {
- coreCodeTemplate = "POINTS <- as.integer(3)\n\nsettings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n beginShape(POINTS)\n vertex(30, 20, -50)\n vertex(85, 20, -50)\n vertex(85, 75, -50)\n vertex(30, 75, -50)\n endShape()\n saveFrame(\"%s\")\n exit()\n}\n";
+ coreCodeTemplate = "settings <- function() {\n size(100, 100, P3D)\n}\n\ndraw <- function() {\n beginShape(POINTS)\n vertex(30, 20, -50)\n vertex(85, 20, -50)\n vertex(85, 75, -50)\n vertex(30, 75, -50)\n endShape()\n saveFrame(\"%s\")\n exit()\n}\n";
referenceURI = "https://processing.org/reference/images/vertex_1.png";
}