vertex: some little helpers for vertex operations on triangular...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

some little helpers for vertex operations on triangular meshes

Usage

1
2
3
4
5
6
7
unrefVertex(mesh)

rmVertex(mesh, index, keep = FALSE)

vert2points(mesh)

rmUnrefVertex(mesh, silent = FALSE)

Arguments

mesh

triangular mesh of class mesh3d.

index

vector containing indices of vertices to be removed.

keep

logical: if TRUE, the vertices specified by index are kept and the rest is removed.

silent

logical: suppress output about info on removed vertices.

Details

extract vertex coordinates from meshes, find and/or remove (unreferenced) vertices from triangular meshes

unrefVertex finds unreferenced vertices in triangular meshes of class mesh3d or tmesh3d.

rmVertex removes specified vertices from triangular meshes.

vert2points extacts vertex coordinates from triangular meshes.

rmUnrefVertex removes unreferenced vertices from triangular meshes.

Value

unrefVertex: vector with indices of unreferenced vertices.

rmVertex: returns mesh with specified vertices removed and faces and normals updated.

vert2points: k x 3 matrix containing vertex coordinates.

rmUnrefVertex: mesh with unreferenced vertices removed.

Author(s)

Stefan Schlager

See Also

ply2mesh, file2mesh

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
require(rgl)
data(nose)
testmesh <- rmVertex(shortnose.mesh,1:50) ## remove first 50 vertices
## Not run: 
shade3d(testmesh,col=3)### view result

## End(Not run)
testmesh$vb <- cbind(testmesh$vb,shortnose.mesh$vb[,1:50]) ## add some unreferenced vertices
## Not run: 
points3d(vert2points(testmesh),col=2)## see the vertices in the holes?

## End(Not run)
cleanmesh <- rmUnrefVertex(testmesh)## remove those lonely vertices!
## Not run: 
rgl.pop()
points3d(vert2points(cleanmesh),col=2) ### now the holes are empty!!

## End(Not run)

Morpho documentation built on Sept. 9, 2021, 9:07 a.m.