-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
I noticed a bug or an error when I try to use small 'MaxArea' in the package.
I tested it with the following code:
library(RTriangle)
p <- pslg(P=rbind(c(0, 0), c(0, 1), c(0.5, 0.5), c(1, 1), c(1, 0)) * 1000,
S=rbind(c(1, 2), c(2, 3), c(3, 4), c(4, 5), c(5, 1)))
ia <- 30 * (6:1)
nc <-ia * 0
nx <- length(ia)
par(mfrow=c(3,2))
for(i in 1:nx){
## Triangulate it
tp <- triangulate(p, a=ia[i])
plot(tp, type='n')
nc[i] <- nrow(tp$T)
mtext(paste('a= ', ia[i], ' n=', nc[i]))
}
print(nc)
Printed results are:
6549 7816 9788 11469 12597 10026
When the MaxArea is larger than 120, the results are correct.
When the MaxArea is less than 120, there are some triangles whose area is larger than the threshold.
The number of triangles should become more and more, along with the increasing MaxArea threshold.
I guess that is the issue from the size of 'int' in the code. But I cannot fix it yet.
Any thoughts or suggestions? Thank you.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels