# Inspect keys and anchors inside TikZ

Use `show anchors` and `show keys` on any **tikzphysics node**. They work on
named and unnamed nodes, including surfaces, wedges, ramps, mechanics,
elements, native fluid nodes, and optics. A name is needed only when later
commands refer to an anchor. Both switches are off in a finished diagram.

```latex
\begin{tikzpicture}
  \node[ground,show anchors,show keys] (G) {};
\end{tikzpicture}
```

`show anchors` marks each named anchor with a red number and puts the names
in a table. Anchors at the same position share one number. `show keys`
places a reference card with the **documented defaults**, size aliases, named
anchors, and percentage families. It does not report the values applied to
this particular node or enumerate arbitrary TikZ keys.

| Drawing API | Inspect it with | Coordinate syntax |
| --- | --- | --- |
| Native node, such as `wedge` or `fluid tank` | `show anchors,show keys` in its node options | `(W.surface-50)` |
| Path style, such as `spring` or `rope` | `\physicshelp{spring}` | Ordinary path coordinates |
| Pic, such as `fluid tank diagram` | `\physicshelp{fluid tank diagram}` | `(F-surface)` for its named coordinates |

For every available topic, use `\physicshelp{index}` inside a
`tikzpicture`. The [feature reference](reference.md) contains the same
declarations in a searchable document.

## Select percentage points

The default anchor table lists named anchors. Percentage families are
available on the node but are plotted only when requested. `0` is the
documented start, `50` the midpoint, and `100` the end of a family. This
example samples the complete floor contact and the right wall of a platform:

```latex
\node[platform-right,pulley edge,show anchors,
  physics debug/anchor list={surface,pulley-center,wall-root},
  physics debug/anchor families={surface,transition,wall-surface},
  physics debug/anchor samples={0,50,100}] (P) {};
```

Use `physics debug/anchor families=all` to select every family, or
`physics debug/anchor samples={0,25,...,100}` for a native TikZ range.
`physics debug/anchor list={}` hides named anchors when you want only
family samples. A crowded table can be reduced by selecting one or two
families at a time. See the [surface](surface-anchors.md),
[wedge](wedge-anchors.md), and [ramp](ramp-anchors.md) guides for the
direction of each family.

## Copy-ready examples by object

Each snippet goes inside a `tikzpicture` after `\usepackage{tikzphysics}`.
The [complete feature tour](../examples/debug-feature-tour.tex) draws these
categories as separate pages, with both debug overlays visible.

**Wedge contact and body:**

```latex
\node[wedge,wedge angle=30,pulley edge,show anchors,show keys,
  physics debug/anchor list={bl,br,top,pulley-center,wall-root,centroid},
  physics debug/anchor families={surface,transition},
  physics debug/anchor samples={0,50,100}] (W) {};
```

**Straight or curved ramp:**

```latex
\node[curved-ramp,show anchors,show keys,
  physics debug/anchor list={surface-start,curve-start,curve-end},
  physics debug/anchor families={floor,curve,back},
  physics debug/anchor samples={0,50,100}] (R) {};
```

The curved ramp's default flat floor is `3.75cm`. Set
`curved ramp floor length=<length>` to change it. On a straight ramp, use
`floor`, `incline`, `wall-surface`, `base`, and `end` for the drawn edges.

**Native fluid node:**

```latex
\node[fluid tank,fluid={width=4cm,height=3cm},
  show anchors,show keys,
  physics debug/anchor list={surface,left-surface,right-surface,%
    north west,north east,south west,south east}] (F) {};
```

Fluid nodes have named attachment points but no percentage families. For
the assembled pic, use `\physicshelp{fluid tank diagram}` and refer to
`(F-surface)` after `\pic (F) {fluid tank diagram};`.

**Optical surface:**

```latex
\node[concave-mirror,show anchors,show keys,
  physics debug/anchor list={vertex,surface-top,surface-bottom},
  physics debug/anchor families={surface,front,back},
  physics debug/anchor samples={0,50,100}] (M) {};
```

**Cartesian differential element:**

```latex
\node[rectangular element,element width=2cm,element height=1cm,
  show anchors,show keys,
  physics debug/anchor list={center,centroid},
  physics debug/anchor families={top,right,bottom,left},
  physics debug/anchor samples={0,50,100}] (E) {};
```

**Path and pic references:**

```latex
\begin{tikzpicture}
  \physicshelp{spring}
  \physicshelp[xshift=10cm]{fluid tank diagram}
\end{tikzpicture}
```

## Scope and panel placement

Put `show anchors` or `show keys` on a `tikzpicture` or `scope` to enable
them for its physics nodes. Turn either one off for a particular node:

```latex
\begin{tikzpicture}[show anchors,show keys]
  \node[block] (A) {};
  \node[block,show anchors=false,show keys=false] (B) at (4,0) {};
\end{tikzpicture}
```

Move a table or card with `physics debug/anchor legend xshift`,
`physics debug/anchor legend yshift`, `physics debug/key panel xshift`, and
`physics debug/key panel yshift`. Debug overlays enlarge the picture's
bounding box, so keep them off in the final drawing. The complete
[scoped example](../examples/debug-scoped.tex) shows local overrides.
