Skip to main content

Module draft_analysis

Module draft_analysis 

Source
Expand description

DRAFT ANALYSIS: every face of the shown model coloured by its draft angle against a pull direction and a minimum (docs/features/draft.md).

Display only. Nothing here touches the history, the document or undo: the classes are read off the DISPLAY mesh (its outward normals, inside each face’s own triangle range, so a trimmed face is judged on what is there, not on its whole carrier), and the colour is an analysis tint on the face (crate::scene::FaceDisplay::analysis_color) that wins over the user’s face colour while the analysis is on and leaves it untouched.

The draft angle of a surface point is the angle between its outward normal and the plane square to the pull: asin(n · pull), so a wall along the pull reads 0°, a wall leaning away from the pull as it rises (the material side narrowing, the way a drafted boss is) reads positive, and a face that faces along the pull reads +90°. A flat face has one angle. A curved face is SAMPLED at its mesh vertices, and its class comes from the least and the greatest sample; the exact extreme can sit between samples, so a curved face whose sampled range ends within NEAR_LIMIT_DEG of the minimum is marked nearLimit.

Structs§

FaceDraft
One face’s reading.

Enums§

DraftClass
The classes, in legend order.

Constants§

CAP_TOL_DEG
A face within this of ±90° everywhere is square to the pull (a cap, or a parting face).
NEAR_LIMIT_DEG
Within this of the minimum, a CURVED face’s sampled range is “near the limit”: the samples could have missed an extreme just over it.

Functions§

analyse_solid
Read every face of solid against the unit pull and minimum_deg.
classify
The class of a face whose draft runs from min_deg to max_deg, against a minimum of minimum_deg (≥ 0).
face_normals
The outward normals one face of solid presents in WORLD space: one for a flat face (its triangles’ common normal, signed by the mesh normals), else every vertex normal of its triangles. None for a face with none.
near_limit
Whether a curved face’s sampled range ends within NEAR_LIMIT_DEG of the minimum on either side.