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

unrefVertexR Documentation

some little helpers for vertex operations on triangular meshes

Description

some little helpers for vertex operations on triangular meshes

Usage

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


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: 
pop3d()
points3d(vert2points(cleanmesh),col=2) ### now the holes are empty!!

## End(Not run)


Morpho documentation built on June 22, 2024, 7:19 p.m.