P <- rbind(c(1,1), c(2,1), c(2,-1),
c(1,-1), c(1,-2), c(-1,-2),
c(-1,-1), c(-2,-1),c(-2,1),
c(-1,1), c(-1,2), c(1,2))
o <- TriangulatedOutline$new(P)
o$addTear(c(3, 4, 5))
o$addTear(c(6, 7, 8))
o$addTear(c(9, 10, 11))
o$addTear(c(12, 1, 2))
flatplot(o)
P <- list(rbind(c(1,1), c(2,1), c(2.5,2), c(3,1), c(4,1), c(1,4)),
rbind(c(-1,1), c(-1,4), c(-2,3), c(-2,2), c(-3,2), c(-4,1)),
rbind(c(-4,-1), c(-1,-1), c(-1,-4)),
rbind(c(1,-1), c(2,-1), c(2.5,-2), c(3,-1), c(4,-1), c(1,-4)))
o <- TriangulatedOutline$new(P)
##' o$addTear(c(2, 3, 4))
o$addTear(c(17, 18, 19))
o$addTear(c(9, 10, 11))
o$addFullCut(c(1, 5, 16, 20))
flatplot(o)
Run the code above in your browser using DataLab