zarquon42b / Rvcg

R-package providing mesh manipulation routines from VCGLIB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Namespace resolve issue

marvinschmitt opened this issue · comments

Calling Rvcg::vcgBary(mesh) throws

Error in .Call("Rbarycenter", mesh) : 
  "Rbarycenter" not resolved from current namespace (Rvcg)

on MacOS 12.1 (M1 chip). Installing from the GitHub source instead of CRAN did not solve the issue. This issue is sometimes resolved after re-installing Rvcg, but only during that R session (reoccurs for a new R session).

Reproducible example:

library(rgl)
library(Rvcg)

B = matrix(c(
  0,  0,
  1, 0,
  0.5,  sqrt(3)/2),
  ncol=2, byrow=TRUE
)
b = rgl::tmesh3d(t(cbind(B, 0, 1)),
                 indices = 1:3)
b_subdivision = rgl::subdivision3d(b, depth=3, deform=FALSE, normalize=TRUE)
b_subdivision_center_coordinates = Rvcg::vcgBary(b_subdivision)

Hi @marvinschmitt ,
I cannot reproduce this error on Ubuntu or Windows and do not have access to an OSX installation. I guess this has something to do with the way, R links to the packages on your machine. Do the other functions work or do you get the same error?
As the package passes the OSX tests without issues (running all the examples) https://cran.r-project.org/web/checks/check_results_Rvcg.html , I guess this is something related to your specific setup.

This issue is sometimes resolved after re-installing Rvcg, but only during that R session (reoccurs for a new R session).

BTW: This is a pretty strong indicator that something is fishy with your setup/installation because either it gets exported correctly or not at all. Maybe you have different versions of the package or R itself installed at the same time?

Thanks for your reply and help. I'll investigate the issue in more detail and see if it's some weirdness in my setup :-)

In fact, the issue has disappeared and I could not reproduce it properly. Sorry for the inconvenience. Thank you for developing this super useful package!

I'll close the issue.

Hi @marvinschmitt ,
great that it works now. No problem I am still grateful for people reporting (potential) bugs as it helps to improve the package.