cad-editor/src/modules
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Hakan Seven 3f060a570a fix(pick): hit-test lineweight width and thickness walls
Selection tested a flat 8 px radius around each wire's centreline and
nothing else, so two things the user can see were not pickable.

A wire renders as a band `line_weight_px` wide, so pick now widens to that
rendered half-width via `pick_tolerance_px`, mirroring the wire shader's
`select(0.5, half_width, lwdisplay_enable)`. Behaviour is unchanged for
every standard weight (the widest, 2.11 mm, renders 7.97 px half-width —
just under the 8 px threshold); this keeps the two sides from drifting
apart if the display boost in `lineweight_to_px` ever changes.

Entities extruded by a DXF thickness draw their wall as four edges with
nothing in between, so the interior was a hole the cursor fell through.
WireModel gains `pick_tris`: triangles hit-testing treats as solid and the
renderer never uploads. Kept apart from `fill_tris` because that channel
reaches the GPU, and a wall that rendered shaded would change how every
thickness drawing looks. Ranked below `fill_tris` — those are drawn, these
are not, so where they overlap the drawn face is what the user means.

Walls are dropped when a wire is projected into a floating viewport:
`points` are reprojected and clipped into paper coords there, so cloned
model-space triangles would hit-test at a model-scale offset. Extruded
entities stay selectable by their edges, which do get projected.

The wall loop runs on every hover that misses everything else, so it
rejects on the wire's AABB first — an extruded circle is ~128 triangles
and a drawing full of thickness would otherwise project every wall on
each mouse move.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 14:58:55 +03:00
..
annotate fix(pick): hit-test lineweight width and thickness walls 2026-07-17 14:58:55 +03:00
draw fix(pick): hit-test lineweight width and thickness walls 2026-07-17 14:58:55 +03:00
insert refactor(precision): widen command transform scalars and defaults to f64 (#311) 2026-07-12 00:34:38 +03:00
layout fix(pick): hit-test lineweight width and thickness walls 2026-07-17 14:58:55 +03:00
manage chore: remove orphaned manage/mview.rs dead code 2026-07-12 00:37:49 +03:00
model fix(pick): hit-test lineweight width and thickness walls 2026-07-17 14:58:55 +03:00
view fix(pick): hit-test lineweight width and thickness walls 2026-07-17 14:58:55 +03:00
mod.rs refactor: replace build.rs module codegen with a static registry 2026-06-26 23:19:20 +03:00
registry.rs refactor: replace build.rs module codegen with a static registry 2026-06-26 23:19:20 +03:00