mesh_flatness

compas.datastructures.mesh_flatness(mesh, maxdev=1.0)[source]

Compute mesh flatness per face.

Parameters:
meshcompas.datastructures.Mesh

A mesh object.

maxdevfloat, optional

A maximum value for the allowed deviation from flatness.

Returns:
dict[int, float]

For each face, a deviation from flatness.

Warning

This function only works as expected for quadrilateral faces.

Notes

The “flatness” of a face is expressed as the ratio of the distance between the diagonals to the average edge length. For the fabrication of glass panels, for example, 0.02 could be a reasonable maximum value.