# Comparison Inspection Examples

These examples exercise the `comparison` inspection evidence.

## Code-Declared Reference

`comparison-candidate-plate.forge.js` declares its reference in model code:

```js
compareWith("./comparison-reference-plate.forge.js", {
  toleranceMm: 0.35,
  samples: 1800,
  label: "Reference Plate",
});
```

Run:

```bash
node dist-cli/forgecad.js inspect comparison examples/api/comparison-candidate-plate.forge.js /tmp/plate-comparison --force
```

Look at:

- `/tmp/plate-comparison/evidence/comparison/iso.png`
- `/tmp/plate-comparison/evidence/comparison/mismatch-points.json`
- `/tmp/plate-comparison/manifest.json`

## CLI-Declared Reference

Use the same candidate but provide the reference from the CLI:

```bash
node dist-cli/forgecad.js inspect comparison examples/api/comparison-candidate-plate.forge.js /tmp/plate-comparison-cli --compare-with examples/api/comparison-reference-plate.forge.js --compare-samples 1800 --compare-tolerance-mm 0.35 --force
```

## Imported CAD Reference

`comparison-imported-sphere-candidate.forge.js` compares against a raw STL asset:

```bash
node dist-cli/forgecad.js inspect comparison examples/api/comparison-imported-sphere-candidate.forge.js /tmp/sphere-comparison --force
```

The comparison evidence uses gray for shared coverage, amber for candidate-only geometry, cyan for reference-only geometry, and colored mismatch samples for nearest-surface differences.
