dihedralAngles {cxhull}R Documentation

Dihedral angles

Description

Dihedral angles of a convex hull.

Usage

dihedralAngles(hull)

Arguments

hull

an output of cxhull applied to 3D points

Value

A dataframe with three columns. The two first columns represent the edges, given as a pair of vertex indices. The third column provides the dihedral angle in degrees corresponding to the edge, that is the angle between the two faces incident to this edge. This is useful to find edges between two coplanar faces: if the faces are exactly coplanar then the dihedral angle is 180, but because of numerical approximation one can consider that there is coplanarity when the dihedral angle is greater than 179, for example. This function is used in plotConvexHull3d to get rid of such edges (if the user sets a value to the argument angleThreshold).

Examples

# a cube ####
library(cxhull)
points <- rbind(
 c(0.5,0.5,0.5),
 c(0,0,0),
 c(0,0,1),
 c(0,1,0),
 c(0,1,1),
 c(1,0,0),
 c(1,0,1),
 c(1,1,0),
 c(1,1,1)
)
hull <- cxhull(points)
dihedralAngles(hull)

[Package cxhull version 0.7.4 Index]