exteriorEdges: Exterior edges of a mesh

View source: R/Edges.R

exteriorEdgesR Documentation

Exterior edges of a mesh

Description

Returns the edges of a mesh whose corresponding dihedral angles are not too flat.

Usage

exteriorEdges(edgesDF, angleThreshold = 1)

Arguments

edgesDF

the dataframe returned by the edges method of cgalMesh

angleThreshold

maximum deviation in degrees from the flat angle; for example if angleThreshold=1, then an edge is considered as exterior if its corresponding dihedral angle is lower than 179 or higher than 181

Value

An integer matrix giving the vertex indices of the exterior edges.

Note

Once you get the exterior edges, say in extEdges, then you can get the indices of the exterior vertices with which(table(extEdges) != 2).

Examples

library(cgalMeshes)
library(rgl)
mesh <- cgalMesh$new(dodecahedron3d())
extEdges <- exteriorEdges(mesh$getEdges())
vertices <- mesh$getVertices()
open3d(windowRect = 50 + c(0, 0, 512, 512), zoom = 0.9)
shade3d(dodecahedron3d(), color = "tomato")
plotEdges(vertices, extEdges)

cgalMeshes documentation built on July 9, 2023, 7:45 p.m.