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

virtualMeshScan

remove all parts of a triangular mesh, not visible from a set of viewpoints


Description

remove all parts of a triangular mesh, not visible from a set of viewpoints

Usage

virtualMeshScan(x, viewpoints, offset = 0.001, cores = 1)

Arguments

x

triangular mesh of class 'mesh3d'

viewpoints

vector or k x 3 matrix containing a set of viewpoints

offset

value to generate an offset at the meshes surface (see notes)

cores

integer: number of cores to use (not working on windows)

Value

returns a list containing subsets of the original mesh

visible

the parts visible from at least one of the viewpoints

invisible

the parts not visible from the viewpoints

Note

The function tries to filter out all vertices where the line connecting each vertex with the viewpoints intersects with the mesh itself. As, technically speaking this always occurs at a distance of value=0, a mesh with a tiny offset is generated to avoid these false hits.

Examples

SCP1 <- file2mesh(system.file("extdata","SCP1.ply",package="Morpho"))
viewpoints <- read.fcsv(system.file("extdata","SCP1_Endo.fcsv",package="Morpho"))
## Create a quick endocast
quickEndo <- virtualMeshScan(SCP1,viewpoints)
## Not run: 
rgl::shade3d(quickEndo$visible,col="orange")
rgl::shade3d(SCP1,col="white",alpha=0.5)

## 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.