tylermorganwall / rayrender

A pathtracer for R. Build and render complex scenes and 3D data visualizations directly from R
http://www.rayrender.net
622 stars 42 forks source link

Code runs under macOS; segfault under Ubuntu and Windows #41

Closed tteo closed 1 year ago

tteo commented 1 year ago

Hi Tyler, posting the issue as requested. Am working with a PLY object and getting a segfault under Ubuntu and Windows but not macOS. Attempted to troubleshoot and think I may have narrowed the segfault (memory not mapped) down to ply_model. OBJ works fine, as do all native rayrender objects.

tylermorganwall commented 1 year ago

Can you provide the ply model that makes it crash?

tteo commented 1 year ago

Sure, here's a link to the model: https://tteo.github.io/rayrender/heart.ply

Edit to add code: add_object(ply_model("heart.ply", scale = 0.25, x = 0, y = -0.5, z = 1, angle = c(-90, 0, 0))) |> render_scene()

tylermorganwall commented 1 year ago

I just got around to hunting for the cause of this (I've confirmed it still happens on Ubuntu). It appears to be an issue with the underlying miniply library, so it might take a little longer to figure out.

tylermorganwall commented 1 year ago

@tteo, I believe this is fixed: can you install the latest version of the plyfix branch and confirm? Thanks!

remotes::install_github(“tylermorganwall/rayrender@plyfix”)
tylermorganwall commented 1 year ago

I have merged the fix after re-running some local tests and confirming the crash doesn't occur--if you find out that it still does on your machine, post here and I'll reopen the issue.