plotly wire3d() no longer working after upgrading from nat 1.8.22 to 1.10.4
Jsalas424 opened this issue · comments
I recently started a new R project and as usual updated my packages beforehand. I've no found that I can no longer perform a routine in 1.10.4 that I am perfectly able to do in 1.8.22.
Here's what that looks like:
options(nat.plotengine = 'plotly')
wire3d(mesh$getMesh(),
add = FALSE) |>
add_trace(
name = "Original Faces",
type = "mesh3d",
data = mesh_faces,
x = mesh_vertices$surf_x, y = mesh_vertices$surf_y, z = mesh_vertices$surf_z,
i = ~v1-1, j = ~v2-1, k = ~v3-1,
flatshading = TRUE, # we don't want smoothing
showlegend=T
)
which produces the following photo when I'm in a version controlled project running v1.8.22:
![image](https://private-user-images.githubusercontent.com/51519895/257967575-cca95cf9-e618-48ca-a0a3-133d30a86529.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzMjMxMzIsIm5iZiI6MTcyMDMyMjgzMiwicGF0aCI6Ii81MTUxOTg5NS8yNTc5Njc1NzUtY2NhOTVjZjktZTYxOC00OGNhLWEwYTMtMTMzZDMwYTg2NTI5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA3VDAzMjcxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAxN2QyMjk1MWVmNDYwYmZhZmFmZmI2MWE2OTM0OTJjODBiODFiZjFmMzk1NzgyNWFiNTAyNzEwNzliNWIzOTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ztdEiJ0uQqY5psvZhc6UUI8Mpc0ZYn59X1mcl606O6s)
When the same data is run in v1.10.4 I get the following: Error: Don't know how to add traces to an object of class: rglLowlevelrglIdnumeric
I realized that if I just the following code I can get my mesh in v.1.8 but get nothing at all in v1.10. So here is the problem:
options(nat.plotengine = 'plotly')
wire3d(mesh$getMesh(),
add = FALSE)
![image](https://private-user-images.githubusercontent.com/51519895/257968344-eaac0a92-d5b1-4bf8-a690-b11465a961db.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzMjMxMzIsIm5iZiI6MTcyMDMyMjgzMiwicGF0aCI6Ii81MTUxOTg5NS8yNTc5NjgzNDQtZWFhYzBhOTItZDViMS00YmY4LWE2OTAtYjExNDY1YTk2MWRiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA3VDAzMjcxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE5NjhhZDNmOTc4YzQyNTZjOWM4OTAzNDg3ZDZlNzY0YjVhYTg5Y2VjNzljYjU5ZDgxNTBhMTYwOTFkNjc0ZDkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.E3OAPixBOH_PRvMkiESulwTz1oMuzze6CSJH0rXnitU)
The mesh$getMesh() is from cgalMeshes which contructs an R6 object that hold all the mesh data for some context. Here is the dput output ofmesh$get_mesh() which is just vertices and indices as expected: https://pastebin.com/YFcwqmzU
God bless version control!
"R version 4.3.1 (2023-06-16) Beagle Scouts"
"RStudio Version 2023.6.1.524 Mountain Hydrangea"
I read the version outputs backwards, once I got everything up to 1.10.4 with natmanager::install(pkgs = 'nat')
I was back in business. All I showed here is that 1.8.22 isn't compatible with my setup.
Glad that it worked out. Thanks for your interest in nat.