Running examples in 'cgalPolygons-Ex.R' failed
The error most likely occurred in:

> ### Name: cgalPolygonWithHoles
> ### Title: R6 class to represent a CGAL polygon with holes
> ### Aliases: cgalPolygonWithHoles
> 
> ### ** Examples
> 
> 
> ## ------------------------------------------------
> ## Method `cgalPolygonWithHoles$new`
> ## ------------------------------------------------
> 
> library(cgalPolygons)
> pwh <- cgalPolygonWithHoles$new(
+   squareWithHole[["outerSquare"]], list(squareWithHole[["innerSquare"]])
+ )
> pwh
Polygon with one hole.
> 
> ## ------------------------------------------------
> ## Method `cgalPolygonWithHoles$area`
> ## ------------------------------------------------
> 
> library(cgalPolygons)
> pwh <- cgalPolygonWithHoles$new(
+   squareWithHole[["outerSquare"]], list(squareWithHole[["innerSquare"]])
+ )
> pwh$area() # should be 12
[1] 12
> 
> ## ------------------------------------------------
> ## Method `cgalPolygonWithHoles$boundingBox`
> ## ------------------------------------------------
> 
> library(cgalPolygons)
> pwh <- cgalPolygonWithHoles$new(
+   squareWithHole[["outerSquare"]], list(squareWithHole[["innerSquare"]])
+ )
> pwh$boundingBox()
    [,1] [,2]
min   -2   -2
max    2    2
> 
> ## ------------------------------------------------
> ## Method `cgalPolygonWithHoles$convexParts`
> ## ------------------------------------------------
> 
> library(cgalPolygons)
> pwh <- cgalPolygonWithHoles$new(
+   squareWithHole[["outerSquare"]], list(squareWithHole[["innerSquare"]])
+ )
> cxparts <- pwh$convexParts()
Found 8 convex parts.
> pwh$plot(list(), density = 10)
> invisible(
+   lapply(cxparts, function(cxpart) {
+     polygon(cxpart, lwd = 2)
+   })
+ )
> 
> ## ------------------------------------------------
> ## Method `cgalPolygonWithHoles$intersection`
> ## ------------------------------------------------
> 
> library(cgalPolygons)
> # function creating a circle
> circle <- function(x, y, r) {
+   t <- seq(0, 2, length.out = 100)[-1L]
+   t(c(x, y) + r * rbind(cospi(t), sinpi(t)))
+ }
> # take two circles with a hole
> plg1 <- cgalPolygonWithHoles$new(
+   circle(-1, 0, 1.5), holes = list(circle(-1, 0, 0.8))
+ )
> plg2 <- cgalPolygonWithHoles$new(
+   circle(1, 0, 1.5), holes = list(circle(1, 0, 0.8))
+ )
> # intersection
> plgList <- plg1$intersection(plg2)
The intersection consists in one polygon.
It doesn't have any hole.
> plg <- plgList[[1]]
> # plot
> opar <- par(mar = c(0, 0, 0, 0))
> plot(
+   NULL, xlim = c(-2.6, 2.6), ylim = c(-1.6, 1.6), asp = 1, 
+   xlab = NA, ylab = NA, axes = FALSE
+ )
> plg1$plot(list(lwd = 2), lwd = 2, density = 10, new = FALSE)
> plg2$plot(list(lwd = 2), lwd = 2, density = 10, new = FALSE)
> plg$plot(lwd = 4, col = "red", new = FALSE)
> par(opar)
> 
> ## ------------------------------------------------
> ## Method `cgalPolygonWithHoles$minkowskiSum`
> ## ------------------------------------------------
> 
> library(cgalPolygons)
> plg1 <- cgalPolygonWithHoles$new(decagram)
> plg2 <- cgalPolygonWithHoles$new(star)
> minko <- plg1$minkowskiSum(plg2)
No hole in the Minkowski sum.
> minko$plot(lwd = 2, col = "limegreen")
> 
> ## ------------------------------------------------
> ## Method `cgalPolygonWithHoles$plot`
> ## ------------------------------------------------
> 
> library(cgalPolygons)
> pwh <- cgalPolygonWithHoles$new(
+   squareWithHole[["outerSquare"]], list(squareWithHole[["innerSquare"]])
+ )
> pwh$plot(
+   outerpars = list(lwd = 2), density = 10
+ )
> 
> ## ------------------------------------------------
> ## Method `cgalPolygonWithHoles$subtract`
> ## ------------------------------------------------
> 
> library(cgalPolygons)
> # function creating a circle
> circle <- function(x, y, r) {
+   t <- seq(0, 2, length.out = 100)[-1L]
+   t(c(x, y) + r * rbind(cospi(t), sinpi(t)))
+ }
> # take two circles with a hole
> plg1 <- cgalPolygonWithHoles$new(
+   circle(-1, 0, 1.5), holes = list(circle(-1, 0, 0.8))
+ )
> plg2 <- cgalPolygonWithHoles$new(
+   circle(1, 0, 1.5), holes = list(circle(1, 0, 0.8))
+ )
> # difference
> plgList <- plg1$subtract(plg2)
The difference consists in 2 polygons.
Polygon 1 has no hole.
Polygon 2 has no hole.
> # plot
> opar <- par(mar = c(0, 0, 0, 0))
> plot(
+   NULL, xlim = c(-2.6, 2.6), ylim = c(-1.6, 1.6), asp = 1, 
+   xlab = NA, ylab = NA, axes = FALSE
+ )
> plgList[[1]]$plot(lwd = 4, col = "red", new = FALSE)
> plgList[[2]]$plot(lwd = 4, col = "red", new = FALSE)
> par(opar)
> 
> ## ------------------------------------------------
> ## Method `cgalPolygonWithHoles$symdiff`
> ## ------------------------------------------------
> 
> library(cgalPolygons)
> # function creating a circle
> circle <- function(x, y, r) {
+   t <- seq(0, 2, length.out = 100)[-1L]
+   t(c(x, y) + r * rbind(cospi(t), sinpi(t)))
+ }
> # take two circles with a hole
> plg1 <- cgalPolygonWithHoles$new(
+   circle(-1, 0, 1.5), holes = list(circle(-1, 0, 0.8))
+ )
> plg2 <- cgalPolygonWithHoles$new(
+   circle(1, 0, 1.5), holes = list(circle(1, 0, 0.8))
+ )
> # symmetric difference
> plgList <- plg1$symdiff(plg2)
The symmetric difference consists in one polygon.
It has 3 holes.
> plg <- plgList[[1L]]
> # plot
> opar <- par(mar = c(0, 0, 0, 0))
> plg$plot(list(lwd = 4, col = "red"), lwd = 4, col = "white")
> par(opar)
> 
> ## ------------------------------------------------
> ## Method `cgalPolygonWithHoles$union`
> ## ------------------------------------------------
> 
> library(cgalPolygons)
> # function creating a circle
> circle <- function(x, y, r) {
+   t <- seq(0, 2, length.out = 100)[-1L]
+   t(c(x, y) + r * rbind(cospi(t), sinpi(t)))
+ }
> # take two circles with a hole
> plg1 <- cgalPolygonWithHoles$new(
+   circle(-1, 0, 1.5), holes = list(circle(-1, 0, 0.8))
+ )
> plg2 <- cgalPolygonWithHoles$new(
+   circle(1, 0, 1.5), holes = list(circle(1, 0, 0.8))
+ )
> # union
> plgList <- plg1$union(plg2)
The union consists in one polygon.
It has 2 holes.
> plg <- plgList[[1]]
> # plot
> opar <- par(mar = c(0, 0, 0, 0))
> plg$plot(list(lwd = 4, col = "red"), lwd = 4, col = "white")
> par(opar)
> 
> 
> 
> graphics::par(get("par.postscript", pos = 'CheckExEnv'))
> ### * <FOOTER>
> ###
> cleanEx()
> options(digits = 7L)
> base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n")
Time elapsed:  1.69 0.05 1.73 NA NA 
> grDevices::dev.off()
null device 
          1 
> ###
> ### Local variables: ***
> ### mode: outline-minor ***
> ### outline-regexp: "\\(> \\)?### [*]+" ***
> ### End: ***
> quit('no')