R/internal.R

Defines functions isBoolean isStrictPositiveInteger isPositiveInteger isNonNegativeNumber isPositiveNumber isAtomicVector makeTriangle isFalsy

isFalsy <- function(x){
  isFALSE(x) || is.null(x) || is.na(x)
}

makeTriangle <- function(vertices, indices){
  vertices[indices, ]
}

isAtomicVector <- function(x){
  is.atomic(x) && is.vector(x)
}

isPositiveNumber <- function(x){
  is.numeric(x) && length(x) == 1L && x > 0 && !is.na(x)
}

isNonNegativeNumber <- function(x){
  is.numeric(x) && length(x) == 1L && x >= 0 && !is.na(x)
}

isPositiveInteger <- function(x){
  is.numeric(x) && length(x) == 1L && !is.na(x) && floor(x) == x
}

isStrictPositiveInteger <- function(x){
  isPositiveInteger(x) && x > 0
}

isBoolean <- function(x){
  is.logical(x) && length(x) == 1L && !is.na(x)
}

Try the SurfaceReconstruction package in your browser

Any scripts or data that you put into this service are public.

SurfaceReconstruction documentation built on Aug. 9, 2022, 5:12 p.m.