Commit Graph

5 Commits

Author SHA1 Message Date
rob 8019aac299 Miter: adjustable hinge offset instead of a center toggle
Replaces the from_center boolean with miter_offset_in / bevel_offset_in: how far
to move the cut's hinge IN from the edge. 0 = full edge-to-edge cut; half the
board size = the centre (corner notch); two centred cuts (+angle/−angle) make a
point (picket); intermediate/over values give asymmetric & partial cuts — much
more range than the old edge/centre toggle.

- Feature.miter_offset_in/bevel_offset_in (replaces from_center); geometry pivot
  = edge + inward·offset (per width/thickness); serialization additive.
- Joinery panel: Miter offset / Bevel offset spin fields (miter only), checkbox
  removed. CLI feature --miter-offset/--bevel-offset; wood-feature tool args
  (regenerated); controller passthrough; apply_preview carries the offsets.
- tests updated: offset=half-width notches a corner, two make a point, offset
  roundtrips. 247 pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 10:11:19 -03:00
rob f1eb7e8c29 Miter from-center (picket points) + real chamfer preview
- Miter gains a from_center option: pivot at the end CENTRE so it notches a
  corner instead of cutting full width. Add a +angle and a −angle from centre on
  the same end to bring it to a point (picket fence). Feature.from_center;
  geometry.miter_cutter honours it; Joinery panel checkbox (miter only); CLI
  feature --miter-pivot edge|center; wood-feature tool arg; serialization.
- Chamfer preview now shows the actual bevel slivers it removes (board −
  chamfered board), like the miter wedge — instead of a flat face slab.
  _chamfer_removed_mesh, with the face-highlight as fallback.
- tests: center miter notches a corner, two center miters make a point,
  from_center roundtrip, chamfer preview is real geometry. 247 pass.

Re-run gen_wood_tools.py for the voice tool to expose --miter-pivot.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 09:32:39 -03:00
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