Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

data2platonic

creates 3D shapes from data to be saved as triangular meshes


Description

creates 3D shapes from 3-dimensional data that can be saved as triangular meshes

Usage

data2platonic(datamatrix, shape = Rvcg::vcgSphere(), col = "red",
  scale = FALSE, scalefactor = 1)

Arguments

datamatrix

k x 3 data matrix

shape

a 3D shape

col

color value

scale

logical: whether to scale the data to unit sd.

scalefactor

scale the resulting shapes.

Value

returns all shapes merged into a single mesh

Examples

mymesh <- data2platonic(iris[iris$Species=="setosa",1:3],scalefactor=0.1)
mymesh <- mergeMeshes(mymesh,data2platonic(iris[iris$Species=="versicolor",1:3],
                      shape=Rvcg::vcgIcosahedron(),scalefactor=0.1,col="green"))
mymesh <- mergeMeshes(mymesh,data2platonic(iris[iris$Species=="virginica",1:3],
                      shape=Rvcg::vcgTetrahedron(),scalefactor=0.1,col="blue"))
## Not run: 
rgl::shade3d(mymesh)
## save to disk
Rvcg::vcgPlyWrite(mymesh,filename="3D_Data.ply")

## End(Not run)

Morpho

Calculations and Visualisations Related to Geometric Morphometrics

v2.8
GPL-2
Authors
Stefan Schlager [aut, cre, cph], Gregory Jefferis [ctb], Dryden Ian [cph]
Initial release
2020-02-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.