From a6a3f44a73c9eafa34f1242dc53427872286f406 Mon Sep 17 00:00:00 2001 From: Stefan Schlager Date: Wed, 23 Oct 2024 16:42:26 +0200 Subject: [PATCH] raysearchMulti: fix examples --- R/vcgRaySearch.r | 5 +++-- man/raysearchMulti.Rd | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/R/vcgRaySearch.r b/R/vcgRaySearch.r index 3d00c678..3a295d4d 100644 --- a/R/vcgRaySearch.r +++ b/R/vcgRaySearch.r @@ -106,17 +106,18 @@ setRays <- function(coords, dirs) { #' humface1 <- scalemesh(humface,size=1.1) #' mesh <- mergeMeshes(humface,humface1) #get normals of landmarks #' x <- vcgClost(humface.lm, humface) - # offset landmarks along their normals for a negative amount of -5mm +#' # offset landmarks along their normals for a negative amount of -5mm #' x$vb[1:3,] <- x$vb[1:3,]+x$normals[1:3,]*-5 #' #' myint <- raysearchMulti(x,mesh) #' wire3d(mesh,col="white") #' spheres3d(vert2points(x),radius=0.5,col=3) #' plotNormals(x,length=55,lwd=2) -#' for (i in 1:length(myintersects$intersects)) +#' for (i in 1:length(myint$intersects)) { #' spheres3d(vert2points(myint$intersects[[i]])[which(as.logical(myint$intersects[[i]]$quality)),] #' ,col=i) #' } +#' } #' @seealso \code{\link{vcgRaySearch}} #' @export raysearchMulti <- function(x,mesh, maxtol=1e15,threads=1,offset=1e-3) { diff --git a/man/raysearchMulti.Rd b/man/raysearchMulti.Rd index 01d637c3..6111dc23 100644 --- a/man/raysearchMulti.Rd +++ b/man/raysearchMulti.Rd @@ -35,17 +35,19 @@ data(humface) humface1 <- scalemesh(humface,size=1.1) mesh <- mergeMeshes(humface,humface1) #get normals of landmarks x <- vcgClost(humface.lm, humface) +# offset landmarks along their normals for a negative amount of -5mm x$vb[1:3,] <- x$vb[1:3,]+x$normals[1:3,]*-5 myint <- raysearchMulti(x,mesh) wire3d(mesh,col="white") spheres3d(vert2points(x),radius=0.5,col=3) plotNormals(x,length=55,lwd=2) -for (i in 1:length(myintersects$intersects)) +for (i in 1:length(myint$intersects)) { spheres3d(vert2points(myint$intersects[[i]])[which(as.logical(myint$intersects[[i]]$quality)),] ,col=i) } } +} \seealso{ \code{\link{vcgRaySearch}} }