Expand description
Dimension leaders and labels for distance, point-line distance, angle, radius, and diameter constraints.
dim_offsets[cid] = {du, dv} is the plane-space vector from a dimension’s
anchor to its label. Leaders and labels share this offset, with per-type
defaults when absent. Interaction state overrides the configured constraint color.
Structs§
- DimLabel
- The label placement + metadata for one dimensional constraint.
Constants§
- OVERLAY_
DIM_ LEADERS - The dimension-leaders overlay group name (its own group so it upserts/clears independently of geometry/points/preview).
Functions§
- constraint_
dim_ segments - The plane-space LEADER segments for ONE dimensional constraint, resolved against
doc(Nonefor a non-dimensional / unresolvable constraint). These are the pick + selection-emphasis target for a dimension: the leader lines (extension + dimension line + arrows), NOT the value label — the label is the egui value-edit affordance, so “click the leader” selects and “click the label” edits. - dimension_
anchor_ uv - The plane
(u, v)ANCHOR a dimension’s label offset is measured FROM — the midpoint for a linear distance, the center for a radial dim, the line intersection for an angle. Used by the drag-to-reposition mapping so the stored{du, dv}= (label uv) − (anchor uv).Nonefor a non-dimensional constraint. - dimension_
labels - The per-constraint label placements + metadata (one
DimLabelper dimensional constraint), with each label anchored in world space. - dimension_
leaders_ buffers - Build the world-space leader/arrow line segments for every dimensional
constraint, as flat
(positions, colors)buffers (6 position + 6 color floats per segment) ready to feed thesketch-dim-leadersoverlay group. - dimension_
leaders_ buffers_ with_ state - Like
dimension_leaders_buffers, but emphasizes the hovered / selected dimensional constraint (matched by a{"kind":"constraint","id":…}ref) in the SAME amber / light-blue as a selected / hovered point or geometry; an empty hover - dimension_
leaders_ overlay_ json - The
set_overlayJSON for thesketch-dim-leadersgroup (always emitted, empty when there are no dimensions, so a stale group is cleared). - dimension_
leaders_ overlay_ json_ with_ state - Like
dimension_leaders_overlay_json, but colors the hovered / selected dimensional constraint’s leader distinctly (S: constraint selection).