Skip to content

Commit d88c75b

Browse files
authored
Merge pull request #483 from dmurdoch/offset
Add polygon_offset arg.
2 parents 6f91107 + 06c6bb8 commit d88c75b

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: rgl
2-
Version: 1.3.27
2+
Version: 1.3.28
33
Title: 3D Visualization Using OpenGL
44
Authors@R: c(person("Duncan", "Murdoch", role = c("aut", "cre"),
55
email = "[email protected]"),

NEWS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# rgl 1.3.27
1+
# rgl 1.3.28
22

33
* Support for classes defined in the `tripack` package
44
has been dropped at the request of CRAN.
55
* Added the `latex3d()` function to draw LaTeX text using the
66
`xdvir` package.
77
* Both `plotmath3d()` and `latex3d()` now use default
8-
`cex = par3d("cex")`.
8+
`cex = par3d("cex")`, and have new argument `polygon_offset`.
99

1010
# rgl 1.3.24
1111

R/latex3d.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ latex3d <- function(x, y = NULL, z = NULL,
55
fixedSize = TRUE,
66
startsize = 480, initCex = 5,
77
margin = "", floating = FALSE, tag = "",
8+
polygon_offset = material3d("polygon_offset"),
89
verbose = FALSE,
910
...) {
1011
if (!requireNamespace("xdvir"))
@@ -72,7 +73,8 @@ latex3d <- function(x, y = NULL, z = NULL,
7273
col = "white", lit = FALSE, radius = cex[i]*size/initCex/20,
7374
adj = adj, pos = posi, offset = offseti,
7475
fixedSize = fixedSize,
75-
margin = margin, floating = floating, tag = tag))
76+
margin = margin, floating = floating, tag = tag,
77+
polygon_offset = polygon_offset))
7678
}
7779
lowlevel(result)
7880
}

R/plotmath3d.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plotmath3d <- function(x, y = NULL, z = NULL,
55
fixedSize = TRUE,
66
startsize = 480, initCex = 5,
77
margin = "", floating = FALSE, tag = "",
8+
polygon_offset = material3d("polygon_offset"),
89
...) {
910
xyz <- xyz.coords(x, y, z, recycle = TRUE)
1011
n <- length(xyz$x)
@@ -52,7 +53,8 @@ plotmath3d <- function(x, y = NULL, z = NULL,
5253
col = "white", lit = FALSE, radius = cex[i]*size/initCex/20,
5354
adj = adj, pos = posi, offset = offseti,
5455
fixedSize = fixedSize,
55-
margin = margin, floating = floating, tag = tag))
56+
margin = margin, floating = floating, tag = tag,
57+
polygon_offset = polygon_offset))
5658
}
5759
lowlevel(result)
5860
}

man/plotmath3d.Rd

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ the same approach to display it in \pkg{rgl}.
1515
plotmath3d(x, y = NULL, z = NULL, text, cex = par3d("cex"),
1616
adj = 0.5, pos = NULL, offset = 0.5,
1717
fixedSize = TRUE, startsize = 480, initCex = 5,
18-
margin = "", floating = FALSE, tag = "", ...)
18+
margin = "", floating = FALSE, tag = "",
19+
polygon_offset = material3d("polygon_offset"), ...)
1920
latex3d(x, y = NULL, z = NULL, text, cex = par3d("cex"),
2021
adj = 0.5, pos = NULL, offset = 0.5,
2122
fixedSize = TRUE, startsize = 480, initCex = 5,
22-
margin = "", floating = FALSE, tag = "",
23+
margin = "", floating = FALSE, tag = "",
24+
polygon_offset = material3d("polygon_offset"),
2325
verbose = FALSE, ...)
2426
}
2527
\arguments{
@@ -51,7 +53,7 @@ are cut off. \code{initCex} is the size of text used
5153
to form the bitmap. Increase this if letters look too blurry
5254
at the desired size.
5355
}
54-
\item{margin, floating, tag}{
56+
\item{margin, floating, tag, polygon_offset}{
5557
\code{\link{material3d}} properties for the sprites.
5658
}
5759
\item{verbose}{If \code{TRUE}, \code{latex3d} will print
@@ -89,14 +91,15 @@ open3d()
8991
plotmath3d(1:3, 1:3, 1:3, expression(x[1] == 1, x[2] == 2, x[3] == 3))
9092
# This lets the text resize with the plot
9193
text3d(4, 4, 4, "resizeable text", usePlotmath = TRUE, fixedSize = FALSE)
92-
94+
\donttest{
9395
if (requireNamespace("xdvir")) {
9496

95-
# Do the same plot using latex3d()
97+
# Do the same plot using latex3d(). This example runs slowly!
9698

9799
open3d()
98100
latex3d(1:3, 1:3, 1:3, c("$x_1 = 1$", "$x_2 = 2$", "$x_3 = 3$"))
99101
latex3d(4, 4, 4, "resizeable text", fixedSize = FALSE)
100102

101103
}
102104
}
105+
}

0 commit comments

Comments
 (0)