# Tongue & Groove

*A tongue cut from one board locking into a groove in another*

**Names:** `tongue_and_groove`

## When to use

Use `tongue_and_groove` when one board's edge or end must lock flat into another's: floor and
panelling boards, and above all the **breadboard end** of a solid tabletop, where a cap board
runs across the end grain of the field boards. The tongue is the male board's own wood (an
`Add` on its face, like a tenon); the groove is a blind cut in the female. Nothing is a loose
spline. For a tongue that locks by its shape use `sliding_dovetail`; for a stub that goes into a
pocket rather than a full-length groove use `mortise_and_tenon`.

## Syntax

```kdl grammar
joinery tongue_and_groove name=<Name> {
    tongue_thickness <mm>      // across the male's thickness, centred on the male mark (default 10, 3 to 40)
    depth            <mm>      // how far the tongue stands out of the shoulder (default 12, 3 to 40)
    clearance        <mm>      // optional; widens the groove only, never the tongue (ADR-0013)
    slot diameter=<mm> length=<mm> at=<mm>    // optional: elongated peg hole through the tongue
}
join joint=<Name> male=<Part>@<Mark> female=<Part>@<Mark>
```

- The male mark sits on the face the tongue stands out of, with its normal pointing out. The
  tongue spans the face's longer extent (the run) and is `tongue_thickness` across the shorter
  one (the flare), centred on the mark.
- The groove is `tongue_thickness + clearance` wide and `depth + clearance / 2` deep, over the
  tongue's full run, so one groove per field board merges into the one continuous groove a
  breadboard end needs.
- `slot` is a stadium cut through the tongue's thickness, long axis along the run. `length` is
  the overall length (`diameter` plus twice the travel); `at` is the distance out of the
  shoulder (default `depth / 2`). Glued versus sliding is two `joinery` declarations, one with
  `slot` and one without, each named by the `join`s that want it.

## Example

```kdl
project name="Breadboard end" units=mm schema_version=1 {
    materials { material Oak type=hardwood }

    component FieldBoard {
        stock Oak 100.0 50.0 20.0
        mark End x=50.0 y=50.0 z=-10.0 normal=pos_y
    }
    component Cap {
        stock Oak 100.0 50.0 20.0
        mark Groove x=50.0 y=0.0 z=-10.0 normal=neg_y
    }
    joinery tongue_and_groove name=Sliding {
        tongue_thickness 7.0
        depth 10.0
        clearance 0.1
        slot diameter=4.0 length=8.0 at=5.0
    }

    assembly Top {
        part Field instance=FieldBoard { pos x=0.0 y=0.0 z=0.0 }
        part Breadboard instance=Cap { pos x=0.0 y=50.0 z=0.0 }
        join joint=Sliding male=Field@End female=Breadboard@Groove
    }
}
```

`examples/dining_table.kdl` is the full case: eight field boards, `BreadboardEndGlued` for the
centre boards and `BreadboardEndSliding` for the outer ones, with the cap's round peg holes
cut as ordinary `hole`s.

## Pitfalls and diagnostics

- The slot is a feature of the tongue, not a `hole` on the field board: a `hole` there would
  land in the visible tabletop, because the board as modelled has no tongue to carry it.
- The peg is not generated. `slot` and the cap's `hole` are the two holes it passes through.
- `params` (error): `tongue_thickness` or `depth` missing or out of range.
- `material` (error): the tongue is as thick as its board, or the groove does not fit across
  the female.
- `facing`, `contact` (error): the male's shoulder meets the female off square, or does not
  bear on its face.
- `slot` (error): not `diameter=`/`length=`/`at=`; `length` below `diameter`; the slot leaves
  the tongue along its depth or run.
- `remaining-wall` (warning): less than `max(3 mm, 15 %)` of the female is left beside the
  groove. `tongue-overhang` (warning): the tongue's run is longer than the face it goes into.
- One slot per joint; a very wide board that needs two is two joints at two marks.

## See also

- `docs/adr/0022-tongue-and-groove.md` and `docs/rfc/0030-breadboard-elongated-mortises.md`
- `docs/KDL_AUTHORING.md` section 8 (joinery kinds)
- `docs/agent-reference/nodes.md` (the node index)
- `docs/styles/models/tongue-and-groove.kdl` and `breadboard-end.kdl` (the glossary models)

## Names

Every name this page declares, how the example library uses it, and the shortest real use.

### `tongue_and_groove`

joinery kind; value in 4 of 116 examples (7 uses).

Shortest real use, from `farmhouse_harvest_table.kdl`:

```kdl
joinery tongue_and_groove name=CapGlued {
    tongue_thickness 10.0
    depth           tongue_depth
}
```

## Related terms

- [Groove](/almanac/techniques#groove)
- [Tongue and groove](/almanac/techniques#tongue-and-groove)
