# cube example ####
library(MeshesTools)
mesh <- rgl::cube3d()
points <- rbind(
c(0, 0, 0),
c(1, 1, 1)
)
distancesToMesh(mesh, points) # should be 1 and 0
# cyclide example ####
library(MeshesTools)
a <- 100; c <- 30; mu <- 80
mesh <- cyclideMesh(a, c, mu, nu = 100L, nv = 100L)
O2 <- c(c, 0, 0)
# should be a - mu = 20 (see ?cyclideMesh):
distancesToMesh(mesh, O2)
Run the code above in your browser using DataLab