tylermorganwall / rayvertex

3D Software Rasterizer for R
https://www.rayvertex.com
65 stars 2 forks source link

feature request: Also allow number of cores to be set by `getOption("Ncpus")` #15

Closed trevorld closed 9 months ago

trevorld commented 11 months ago

Currently rasterize_scene() and rasterize_lines() has:

  if(!is.null(options("cores")[[1]])) {
    numbercores = options("cores")[[1]]
  } else {
    numbercores = parallel::detectCores()
  }
  if(!parallel) {
    numbercores = 1
  }

Perhaps we should update that to match the new logic in {rayrender}:

  numbercores = getOption("cores", default = getOption("Ncpus", default = parallel::detectCores()))
  if(!parallel) {
    numbercores = 1
  }

for similar reasons as in https://github.com/tylermorganwall/rayrender/issues/46

If this change is okay I could put together a PR

tylermorganwall commented 9 months ago

Added in 967a88f