Skip to content

Commit 8777195

Browse files
Changed all \dontrun{} to \donttest{} per CRAN instructions
1 parent 00707a5 commit 8777195

30 files changed

+138
-138
lines changed

R/add_object.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#' material=lambertian(noise=5,noisecolor="purple",color="black",noisephase=45),
1414
#' angle=c(0,-30,0))) %>%
1515
#' add_object(sphere(x=-0.7,radius=0.5,material=metal(color="gold")))
16-
#' \dontrun{
16+
#' \donttest{
1717
#' render_scene(scene,parallel=TRUE)
1818
#' }
1919
add_object = function(scene, objects) {
@@ -22,4 +22,4 @@ add_object = function(scene, objects) {
2222
attr(newscene,"cornell") = TRUE
2323
}
2424
return(newscene)
25-
}
25+
}

R/generate_cornell.R

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,30 @@
1515
#' @examples
1616
#' #Generate and render the default Cornell box.
1717
#' scene = generate_cornell()
18-
#' \dontrun{
18+
#' \donttest{
1919
#' render_scene(scene, samples=200,aperture=0, fov=40, ambient_light=FALSE, parallel=TRUE)
2020
#' }
2121
#'
2222
#' #Make a much smaller light in the center of the room.
2323
#' scene = generate_cornell(lightwidth=200,lightdepth=200)
24-
#' \dontrun{
24+
#' \donttest{
2525
#' render_scene(scene, samples=200,aperture=0, fov=40, ambient_light=FALSE, parallel=TRUE)
2626
#' }
2727
#'
2828
#' #Place a sphere in the middle of the box.
2929
#' scene = scene %>%
3030
#' add_object(sphere(x=555/2,y=555/2,z=555/2,radius=555/4))
31-
#' \dontrun{
31+
#' \donttest{
3232
#' render_scene(scene, samples=200,aperture=0, fov=40, ambient_light=FALSE, parallel=TRUE)
3333
#' }
3434
#'
3535
#' #Reduce "fireflies" by setting a clamp_value in render_scene()
36-
#' \dontrun{
36+
#' \donttest{
3737
#' render_scene(scene, samples=200,aperture=0, fov=40, ambient_light=FALSE,
3838
#' parallel=TRUE,clamp_value=3)
3939
#' }
4040
#' # Change the color scheme of the cornell box
41-
#' \dontrun{
41+
#' \donttest{
4242
#' new_cornell = generate_cornell(leftcolor="purple", rightcolor="yellow")
4343
#' render_scene(new_cornell, samples=200,aperture=0, fov=40, ambient_light=FALSE,
4444
#' parallel=TRUE,clamp_value=3)
@@ -65,4 +65,4 @@ generate_cornell = function(light = TRUE, lightintensity = 5,
6565
}
6666
attr(scene,"cornell") = TRUE
6767
scene
68-
}
68+
}

R/generate_ground.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#' material = lambertian(noise=1,noisecolor="blue",noisephase=10)) %>%
1919
#' add_object(cube(x=0.7,material=lambertian(color="red"),angle=c(0,-15,0))) %>%
2020
#' add_object(sphere(x=-0.7,radius=0.5,material=dielectric(color="white")))
21-
#' \dontrun{
21+
#' \donttest{
2222
#' render_scene(scene, parallel=TRUE,lookfrom=c(0,2,10))
2323
#' }
2424
#'
@@ -27,9 +27,9 @@
2727
#' material = lambertian(checkercolor="grey50")) %>%
2828
#' add_object(cube(x=0.7,material=lambertian(color="red"),angle=c(0,-15,0))) %>%
2929
#' add_object(sphere(x=-0.7,radius=0.5,material=dielectric(color="white")))
30-
#' \dontrun{
30+
#' \donttest{
3131
#' render_scene(scene, parallel=TRUE,lookfrom=c(0,1,10))
3232
#' }
3333
generate_ground = function(depth = -1, spheresize = 1000, material = lambertian(color = "#ccff00")) {
3434
sphere(x = 0, y = -spheresize + depth, z = 0, radius = spheresize, material=material)
35-
}
35+
}

R/group_objects.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#' scene = generate_cornell() %>%
1818
#' add_object(cube(x=555/2,y=555/8,z=555/2,width=555/4)) %>%
1919
#' add_object(cube(x=555/2,y=555/4+555/16,z=555/2,width=555/8))
20-
#' \dontrun{
20+
#' \donttest{
2121
#' render_scene(scene,lookfrom=c(278,278,-800),lookat = c(278,278,0), aperture=0,
2222
#' samples=500, fov=50, parallel=TRUE, clamp_value=5)
2323
#' }
@@ -29,7 +29,7 @@
2929
#' add_object(cube(x=555/2,y=555/8,z=555/2,width=555/4)) %>%
3030
#' add_object(cube(x=555/2,y=555/4+555/16,z=555/2,width=555/8))
3131
#'
32-
#' \dontrun{
32+
#' \donttest{
3333
#' render_scene(scene2,lookfrom=c(278,278,-800),lookat = c(278,278,0), aperture=0,
3434
#' samples=500, fov=50, parallel=TRUE, clamp_value=5)
3535
#' }
@@ -39,7 +39,7 @@
3939
#' add_object(cube(x=555/2, y=555/4 + 555/16, z=555/2, width=555/8))
4040
#' scene3 = generate_cornell() %>%
4141
#' add_object(group_objects(twocubes, group_translate = c(0,50,0),group_angle = c(0,45,0)))
42-
#' \dontrun{
42+
#' \donttest{
4343
#' render_scene(scene3,lookfrom=c(278,278,-800),lookat = c(278,278,0), aperture=0,
4444
#' samples=500, fov=50, parallel=TRUE, clamp_value=5)
4545
#' }
@@ -48,7 +48,7 @@
4848
#' scene4 = generate_cornell() %>%
4949
#' add_object(group_objects(twocubes, group_translate = c(0,-40,0),
5050
#' group_angle = c(0,45,0), group_scale = c(2,0.5,1)))
51-
#' \dontrun{
51+
#' \donttest{
5252
#' render_scene(scene4,lookfrom=c(278,278,-800),lookat = c(278,278,0), aperture=0,
5353
#' samples=500, fov=50, parallel=TRUE, clamp_value=5)
5454
#' }
@@ -68,4 +68,4 @@ group_objects = function(scene, pivot_point=c(0,0,0), group_translate = c(0,0,0)
6868
scene$group_order_rotation = list(group_order_rotation)
6969
scene$group_scale = list(group_scale)
7070
return(scene)
71-
}
71+
}

R/materials.R

+12-12
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#' #Generate the cornell box and add a single white sphere to the center
2929
#' scene = generate_cornell() %>%
3030
#' add_object(sphere(x=555/2,y=555/2,z=555/2,radius=555/8,material=lambertian()))
31-
#' \dontrun{
31+
#' \donttest{
3232
#' render_scene(scene, lookfrom=c(278,278,-800),lookat = c(278,278,0), samples=500,
3333
#' aperture=0, fov=40, ambient_light=FALSE, parallel=TRUE)
3434
#' }
@@ -37,7 +37,7 @@
3737
#' scene = scene %>%
3838
#' add_object(cube(x=555/2,y=555/8,z=555/2,xwidth=555/2,ywidth=555/4,zwidth=555/2,
3939
#' material = lambertian(checkercolor="purple",checkerperiod=20)))
40-
#' \dontrun{
40+
#' \donttest{
4141
#' render_scene(scene, lookfrom=c(278,278,-800),lookat = c(278,278,0), samples=500,
4242
#' aperture=0, fov=40, ambient_light=FALSE, parallel=TRUE)
4343
#' }
@@ -46,7 +46,7 @@
4646
#' scene = scene %>%
4747
#' add_object(sphere(x=555/2+555/4,y=555/2,z=555/2,radius=555/8,
4848
#' material = lambertian(noise=1/20)))
49-
#' \dontrun{
49+
#' \donttest{
5050
#' render_scene(scene, lookfrom=c(278,278,-800),lookat = c(278,278,0), samples=500,
5151
#' aperture=0, fov=40, ambient_light=FALSE, parallel=TRUE)
5252
#' }
@@ -55,7 +55,7 @@
5555
#' scene = scene %>%
5656
#' add_object(cube(x=555/2-555/4,y=555/2,z=555/2,xwidth=555/4,ywidth=555/4,zwidth=555/4,
5757
#' material = lambertian(fog=TRUE, fogdensity=0.05,color="orange")))
58-
#' \dontrun{
58+
#' \donttest{
5959
#' render_scene(scene, lookfrom=c(278,278,-800),lookat = c(278,278,0), samples=500,
6060
#' aperture=0, fov=40, ambient_light=FALSE, parallel=TRUE)
6161
#' }
@@ -98,23 +98,23 @@ lambertian = function(color = "#ffffff", checkercolor = NA, checkerperiod = 3,
9898
#' #Generate the cornell box with a single metal sphere in the center
9999
#' scene = generate_cornell() %>%
100100
#' add_object(sphere(x=555/2,y=555/2,z=555/2,radius=555/8,material=metal()))
101-
#' \dontrun{
101+
#' \donttest{
102102
#' render_scene(scene, lookfrom=c(278,278,-800),lookat = c(278,278,0), samples=500,
103103
#' aperture=0, fov=40, ambient_light=FALSE, parallel=TRUE)
104104
#' }
105105
#' #Add a rotated shiny metal cube
106106
#' scene = scene %>%
107107
#' add_object(cube(x=380,y=150/2,z=200,xwidth=150,ywidth=150,zwidth=150,
108108
#' material = metal(color="#8B4513"),angle=c(0,45,0)))
109-
#' \dontrun{
109+
#' \donttest{
110110
#' render_scene(scene, lookfrom=c(278,278,-800),lookat = c(278,278,0), samples=500,
111111
#' aperture=0, fov=40, ambient_light=FALSE, parallel=TRUE)
112112
#' }
113113
#' #Add a brushed metal cube (setting the fuzz variable)
114114
#' scene = scene %>%
115115
#' add_object(cube(x=150,y=150/2,z=300,xwidth=150,ywidth=150,zwidth=150,
116116
#' material = metal(color="#FAFAD2",fuzz=0.1),angle=c(0,-30,0)))
117-
#' \dontrun{
117+
#' \donttest{
118118
#' render_scene(scene, lookfrom=c(278,278,-800),lookat = c(278,278,0), samples=500,
119119
#' aperture=0, fov=40, ambient_light=FALSE, parallel=TRUE)
120120
#' }
@@ -143,27 +143,27 @@ metal = function(color = "#ffffff", fuzz = 0, implicit_sample = FALSE) {
143143
#' #Generate a checkered ground
144144
#' scene = generate_ground(depth=-0.5,
145145
#' material=lambertian(color="white", checkercolor="grey30",checkerperiod=2))
146-
#' \dontrun{
146+
#' \donttest{
147147
#' render_scene(scene,parallel=TRUE)
148148
#' }
149149
#'
150150
#' #Add a glass sphere
151-
#' \dontrun{
151+
#' \donttest{
152152
#' scene %>%
153153
#' add_object(sphere(x=-0.5,radius=0.5,material=dielectric())) %>%
154154
#' render_scene(parallel=TRUE,samples=400)
155155
#' }
156156
#'
157157
#' #Add a rotated colored glass cube
158-
#' \dontrun{
158+
#' \donttest{
159159
#' scene %>%
160160
#' add_object(sphere(x=-0.5,radius=0.5,material=dielectric())) %>%
161161
#' add_object(cube(x=0.5,xwidth=0.5,material=dielectric(color="darkgreen"),angle=c(0,-45,0))) %>%
162162
#' render_scene(parallel=TRUE,samples=40)
163163
#' }
164164
#'
165165
#' #Add an area light behind and at an angle and turn off the ambient lighting
166-
#' \dontrun{
166+
#' \donttest{
167167
#' scene %>%
168168
#' add_object(sphere(x=-0.5,radius=0.5,material=dielectric())) %>%
169169
#' add_object(cube(x=0.5,xwidth=0.5,material=dielectric(color="darkgreen"),angle=c(0,-45,0))) %>%
@@ -179,4 +179,4 @@ dielectric = function(color="white", refraction = 1.5, implicit_sample = FALSE)
179179
checkercolor=list(NA), noise=0, noisephase = 0, noiseintensity = 0, noisecolor = list(c(0,0,0)),
180180
image = list(NA), lightintensity = NA,
181181
fog=FALSE, fogdensity=NA, implicit_sample = implicit_sample)
182-
}
182+
}

0 commit comments

Comments
 (0)