Commit Graph

3 Commits

Author SHA1 Message Date
rob 7f49e65c33 Miter: full-width cut + per-kind feature inputs (usability)
Two issues Rob hit:

1. Miter pivoted at the END CENTRE, so 45° only notched a corner — you couldn't
   cut edge-to-edge. miter_cutter() now pivots about an EDGE of the end, so a
   45° miter is a true full-width corner cut; the angle's sign picks which edge
   stays long. Factored into geometry.miter_cutter so the wedge preview uses the
   exact same cut. edit_feature keeps a miter on an end face.

2. The Joinery panel showed every input for every feature, so most knobs did
   nothing for a miter (only miter/bevel) or chamfer (only width), and the face
   dropdown offered faces a miter can't use. The panel now shows only the
   relevant rows per kind (KIND_FIELDS) and limits faces per kind (KIND_FACES:
   tenon/miter = ends only).

tests: 45° miter wedge spans the full width; miter face stays an end; panel
shows angle-only for miter, width-only for chamfer, box fields for mortise.
243 pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 09:18:55 -03:00
rob 12e4bbab88 Fix miter preview/highlight: show the cut-off wedge, not a tenon box
The cyan (select) / red (edit) overlay for a miter fell through to the
tenon/mortise box branch, so it looked like a 1" pocket at the end instead of an
angled cut.

- viewer._miter_wedge_mesh: build board ∩ cutter (the piece the miter removes),
  placed in world space, and return that as the preview/highlight mesh; falls
  back to highlighting the end face when the angle is 0.
- factored tessellation into _solid_to_polydata; miter excluded from the
  normal-axis spin step.
- test: the miter preview is a wedge reaching the board end, not a centre box.
238 pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 00:21:47 -03:00
rob b284b58229 Add angled end cuts: miter + bevel
A new 'miter' feature angles a board's end — miter across the width (frame
corners, braces), bevel through the thickness (tilted blade), or both
(compound). Slots into the existing Feature system.

- scene: Feature.miter_deg/bevel_deg; END_KINDS={"miter"}; add_feature forces an
  end face and defaults to 45° miter; serialization additive.
- geometry._apply_miter: subtracts a large block rotated about the end (Z=miter,
  Y=bevel) so the viewer/export show the real angled end; guarded.
- cut list notes "miter 45° / bevel 15°"; instructions describe the angled end;
  jigs suggest a miter sled/gauge for ≥3 repeated angle settings.
- cli feature --miter/--bevel; controller wood-feature passthrough; gen_wood_tools
  wood-feature gains --miter/--bevel (re-run it for the voice tools).
- GUI Joinery tab: "+ Miter" button + Miter/Bevel angle fields (live edit/apply).
- tests: default 45°, end-face forcing, JSON roundtrip, cut-list note,
  instructions, jig suggestion, and real geometry (volume reduced). 237 pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 00:12:48 -03:00