Skip to main content

Module mesh_faces

Module mesh_faces 

Source
Expand description

Faces of a triangle mesh selected by their normal (#417).

Takeoff quantities need the area of the downward faces (a floor), or of the faces normal to a wall with their extent along it. A face is selected when the angle between its normal and a cone’s axis is within the cone’s half-angle plus the tolerance’s angular slack. The angle is atan2(|N x axis|, N . axis) of the triangle’s raw doubled-area vector N, which stays accurate at angles acos of a normalised dot product cannot resolve.

The mesh must be surface-usable with no degenerate triangle, exactly as for crate::surface_properties, so a normal is always defined. Areas are summed in ascending triangle order about the mesh’s first vertex, as surface_properties does, so selecting every face reproduces its area bit for bit.

Structs§

FaceSelection
Triangles chosen by select_by_normal.
NormalCone
A direction and an angular reach about it.

Enums§

FaceSelectionError
Why a selection or an extent was refused.

Functions§

extent_along
Extent of the listed triangles along along: the least and greatest of p . u over every corner, u = along / |along|, as start and end.
select_by_normal
Select the triangles whose normal lies within cone.