Title: | Read a Limited Subset of Visualization Toolkit Formats |
---|---|
Description: | Read some VTK formats. VTK is the Visualization Toolkit <https://en.wikipedia.org/wiki/VTK>. |
Authors: | Michael Sumner [aut, cre] |
Maintainer: | Michael Sumner <[email protected]> |
License: | GPL-3 |
Version: | 0.0.0.9000 |
Built: | 2024-10-27 05:50:17 UTC |
Source: | https://github.com/hypertidy/vtkr |
Read a VTK (Visualization Toolkit ) STRUCTURED GRID of POINTS.
read_vtk_points(x, ..., quiet = FALSE)
read_vtk_points(x, ..., quiet = FALSE)
x |
VTK file name |
... |
ignored |
quiet |
if 'FALSE' (the default), refrain from reporting extra information |
Only BINARY supported for now.
Note that we currently do not recreate the matrix of data, just return the points. The header is printed if 'verbose = TRUE' so the dimensions reported there may be used.
Specification of the format found at https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf on 2019-10-09.
matrix of x, y, z coordinates
f <- system.file("extdata/STRUCTURED_GRID/volcano_points.vtk", package = "vtkr", mustWork = TRUE) xyz <- read_vtk_points(f)
f <- system.file("extdata/STRUCTURED_GRID/volcano_points.vtk", package = "vtkr", mustWork = TRUE) xyz <- read_vtk_points(f)
Read a VTK (Visualization Toolkit ) UNSTRUCTURED GRID of POINTS with triangle CELLS.
read_vtk_triangles(x, ..., quiet = FALSE)
read_vtk_triangles(x, ..., quiet = FALSE)
x |
VTK file name |
... |
ignored |
quiet |
if 'FALSE' (the default), refrain from reporting extra information |
Note that we currently do not recreate the matrix of data, just return the points and the triangle. The header is printed if 'verbose = TRUE'.
Specification of the format found at https://people.sc.fsu.edu/~jburkardt/data/vtk/vtk.html on 2019-10-09.
list, with 'xyz' matrix of x, y, z coordinates, and 'tri' matrix of triangle index (1-based)
f <- system.file("extdata/UNSTRUCTURED_GRID/rbc_001.vtk", package = "vtkr", mustWork = TRUE) mesh0 <- read_vtk_triangles(f) #library(rgl) #tm <- tmesh3d(t(mesh0$xyz), t(mesh0$tri), homogeneous = FALSE) #shade3d(tm, col = "grey") #rglwidget()
f <- system.file("extdata/UNSTRUCTURED_GRID/rbc_001.vtk", package = "vtkr", mustWork = TRUE) mesh0 <- read_vtk_triangles(f) #library(rgl) #tm <- tmesh3d(t(mesh0$xyz), t(mesh0$tri), homogeneous = FALSE) #shade3d(tm, col = "grey") #rglwidget()