R Under development (unstable) (2024-03-03 r86036 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(rgl) > tet <- tetrahedron3d() > > open3d() wgl 1 > segments3d(t(tet$vb[1:3,]), indices = c(1,2,1,3,1,4,2,3,2,4,3,4)) > > open3d() wgl 2 > text3d(t(tet$vb[1:3,]), text=1:4) > triangles3d(t(tet$vb[1:3,]), indices = c(1,2,3,1,4,2,1,3,4,2,4,3), + col = "red") > > # This displayed a triangle for the red quad (issue #154) > > quad <- cbind(x = c(-1, 1, 1, -1), + y = c( 0, 0, 0, 0), + z = c(-1, -1, 1, 1))/2 > open3d() wgl 3 > triangles3d(quad, alpha = 0.5, col = "red", indices=c(1,2,3,1,3,4)) > id <- triangles3d(quad+1, col = "blue", indices=c(1,2,3,1,3,4)) > > # These signalled errors or warnings > > tri <- as.triangles3d(id) > m <- as.mesh3d(id) > > filename <- tempfile(fileext = ".ply") > writePLY(filename) > unlink(filename) > > filename <- tempfile(fileext = ".obj") > writeOBJ(filename, separateObjects = FALSE) > readOBJ(filename) mesh3d object with 8 vertices, 4 triangles. > unlink(filename) > > filename <- tempfile(fileext = ".stl") > writeSTL(filename) > readSTL(filename) > unlink(filename) > > proc.time() user system elapsed 0.31 0.18 0.48