Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

render_polygons demo error #324

Open
CarsonPruitt-NOAA opened this issue Nov 1, 2024 · 1 comment
Open

render_polygons demo error #324

CarsonPruitt-NOAA opened this issue Nov 1, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@CarsonPruitt-NOAA
Copy link

CarsonPruitt-NOAA commented Nov 1, 2024

Describe the bug
Any attempt at using render_polygons() produces the following error on both Windows 10 and Ubuntu 22.04.
Error in t.default(mesh$vertices) : argument is not a matrix

Session Info
Windows

R version 4.3.2 (2023-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default


locale:
[1] LC_COLLATE=English_United States.utf8
[2] LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8

time zone: America/Chicago
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] sessioninfo_1.2.2 rayshader_0.37.3

loaded via a namespace (and not attached):
 [1] rgl_1.3.1          jsonlite_1.8.9     compiler_4.3.2     crayon_1.5.3
 [5] Rcpp_1.0.13        magick_2.8.5       parallel_4.3.2     progress_1.2.3
 [9] scales_1.3.0       png_0.1-8          fastmap_1.2.0      lattice_0.21-9
[13] R6_2.5.1           classInt_0.4-10    sf_1.0-18          knitr_1.48
[17] decido_0.3.0       iterators_1.0.14   htmlwidgets_1.6.4  units_0.8-5
[21] munsell_0.5.1      DBI_1.2.3          pillar_1.9.0       rlang_1.1.4
[25] sp_2.1-4           utf8_1.2.4         terra_1.8-0        xfun_0.48
[29] doParallel_1.0.17  cli_3.6.3          magrittr_2.0.3     class_7.3-22
[33] digest_0.6.37      foreach_1.5.2      grid_4.3.2         base64enc_0.1-3
[37] hms_1.1.3          lifecycle_1.0.4    rayrender_0.34.3   prettyunits_1.2.0
[41] vctrs_0.6.5        KernSmooth_2.23-22 proxy_0.4-27       glue_1.8.0
[45] raster_3.6-30      codetools_0.2-19   fansi_1.0.6        e1071_1.7-16
[49] colorspace_2.1-1   tools_4.3.2        pkgconfig_2.0.3    htmltools_0.5.8.1

Ubuntu

R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rayshader_0.37.3

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.13        compiler_4.1.2     pillar_1.9.0       rayrender_0.34.3  
 [5] prettyunits_1.2.0  base64enc_0.1-3    iterators_1.0.14   class_7.3-20      
 [9] tools_4.1.2        progress_1.2.3     digest_0.6.37      lattice_0.20-45   
[13] jsonlite_1.8.9     lifecycle_1.0.4    pkgconfig_2.0.3    png_0.1-8         
[17] rlang_1.1.4        foreach_1.5.2      cli_3.6.3          DBI_1.2.3         
[21] parallel_4.1.2     xfun_0.49          fastmap_1.2.0      terra_1.7-83      
[25] e1071_1.7-16       raster_3.6-30      knitr_1.48         vctrs_0.6.5       
[29] htmlwidgets_1.6.4  hms_1.1.3          classInt_0.4-10    grid_4.1.2        
[33] glue_1.8.0         sf_1.0-18          R6_2.5.1           fansi_1.0.6       
[37] rgl_1.3.12         decido_0.3.0       sp_2.1-4           magrittr_2.0.3    
[41] scales_1.3.0       codetools_0.2-18   htmltools_0.5.8.1  units_0.8-5       
[45] rayimage_0.11.0    colorspace_2.1-1   utf8_1.2.4         KernSmooth_2.23-20
[49] proxy_0.4-27       doParallel_1.0.17  munsell_0.5.1      crayon_1.5.3      

Reproducible Example
This is straight from the render_polygons demo. https://www.rayshader.com/reference/render_polygons.html

library(rayshader)
library(sf)

montereybay %>%
    sphere_shade(texture = "desert") %>%
    add_shadow(ray_shade(montereybay,zscale = 50)) %>%
    plot_3d(montereybay, water = TRUE, windowsize = 800, watercolor = "dodgerblue")
render_camera(theta = 140,  phi = 55, zoom = 0.85, fov = 30)

sf::sf_use_s2(FALSE)

mont_county_buff = sf::st_simplify(sf::st_buffer(monterey_counties_sf,-0.003), dTolerance=0.001)

render_polygons(mont_county_buff, 
                extent = attr(montereybay,"extent"), top = 10,
                parallel = FALSE)
@CarsonPruitt-NOAA CarsonPruitt-NOAA added the bug Something isn't working label Nov 1, 2024
@tylermorganwall
Copy link
Owner

Update rayrender to the latest version on github and see if you still have an issue--I believe that is your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants