as.tmesh3d: Convert object to a triangular mesh

View source: R/clipMesh3d.R

as.tmesh3dR Documentation

Convert object to a triangular mesh

Description

Converts the quads in a mesh version of an object to triangles by splitting them up. Optionally drops any point or segment components.

Usage

as.tmesh3d(x, ...)
## Default S3 method:
as.tmesh3d(x, drop = FALSE, ...)
## S3 method for class 'mesh3d'
as.tmesh3d(x, drop = FALSE, keepTags = FALSE, ...)

Arguments

x

An object from which to create a triangular mesh object.

drop

If TRUE, drop any point or segment components.

keepTags

Whether to include the "tags" component in the output.

...

Ignored in the mesh3d method, passed to as.mesh3d in the default method.

Details

The default method simply calls as.mesh3d(x, ...) and passes the result to the "mesh3d" method.

Value

A "mesh3d" object containing no quads. If drop = TRUE, it will only contain triangles.

If keepTags = TRUE, a "tags" element will be added to the result. For details, see the clipMesh3d help page.

Note

Older versions of rgl had a "tmesh3d" class for meshes of triangles. That class is no longer used: as.tmesh3d and tmesh3d both produce "mesh3d" objects.

Author(s)

Duncan Murdoch

See Also

as.triangles3d to get just the coordinates.

Examples

x <- cuboctahedron3d()
x             # has quads and triangles
as.tmesh3d(x) # has only triangles

rgl documentation built on Oct. 28, 2024, 5:07 p.m.