vtkr

The goal of vtkr is to read data from files in Visualization Toolkit format.

Currently very much in-development, but in time we can read in these models as rgl mesh forms.

The format is describe at these sites:

Other VTK readers for R

I don’t know many VTK readers that’s of use to R. If you do please let me know!

One is by Chris Black:

Should also check this out: https://github.com/Chrismarsh/mesher

TODO

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
# devtools::install_github("hypertidy/vtkr")
install.packages("vtkr", repos = c('https://hypertidy.r-universe.dev', 'https://cloud.r-project.org'))

Example

This is a basic example to read an in-built VTK file.

library(vtkr)
f <- system.file("extdata/STRUCTURED_GRID/volcano_points.vtk", package = "vtkr", mustWork = TRUE)
xyz <- read_vtk_points(f)
str(xyz)
#>  num [1:5307, 1:3] 1 2 3 4 5 6 7 8 9 10 ...

Currently, we can only read

No CELL attributes are yet read.

Please get in touch! I’m especially keen if you have example files that aren’t supported yet.


Please note that the ‘vtkr’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.