> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cosmon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reverse Engineering

> Turn a 3D scan — mesh, STL, or point cloud — into an editable, parametric CAD model.

## Overview

A 3D scan gives you a mesh or point cloud — millions of facets with no feature history, no datums, and nothing you can parametrically edit. That's fine for visual reference or inspection, but it isn't usable for design changes, mating with other parts, or driving a drawing.

Nexus takes scan data and builds a real, editable feature tree behind it: recognising planes, cylinders, and other primitive features in the mesh, fitting parametric geometry to them within a stated tolerance, and reconstructing the part the way an engineer would model it from scratch — not a surface wrapped around the scan.

## What Nexus can help with

* **Feature recognition** — Identify planar faces, cylindrical bosses and bores, fillets, and other primitives directly from mesh data.
* **Parametric reconstruction** — Build a native feature tree (extrudes, revolves, fillets) fitted to the recognised features, editable like any modelled part.
* **Alignment and datums** — Establish a coordinate system on the scan from reference features, so the reconstructed model lands in a usable orientation.
* **Scan-to-model deviation** — Compare a scan against an existing CAD model (or the reconstruction itself) and report where they diverge, for inspection or as-built verification.
* **Mixed-fidelity modelling** — Model functional, mating features (bores, mounting faces, threads) exactly, while approximating organic or cosmetic surfaces where exact reconstruction isn't the goal.

## Example prompts

<AccordionGroup>
  <Accordion icon="cube" title="Reconstruct a part from an STL scan">
    ```text theme={null}
    Import C:/Scans/housing_scan.stl (structured-light scan, units millimetres). Identify the primary planar and cylindrical features and build a parametric solid matching the scan within 0.1mm. This part has no functional surfaces requiring higher precision — a good general fit is fine.
    ```
  </Accordion>

  <Accordion icon="crosshairs" title="Align a scan to a reference coordinate system">
    ```text theme={null}
    On the imported mesh, identify the bottom mounting face, the two dowel-pin bores, and use them to establish an aligned coordinate system: bottom face as the XY plane, one bore as the origin, the second bore defining the X axis. Reorient the scan to that coordinate system before reconstruction.
    ```
  </Accordion>

  <Accordion icon="magnifying-glass-chart" title="Scan-to-model deviation report">
    ```text theme={null}
    Compare the scan at C:/Scans/pump_housing_asbuilt.stl against the nominal CAD model at C:/Projects/Pump/pump_housing.SLDPRT. Generate a colour deviation map and report the maximum positive and negative deviation, and any region exceeding ±0.5mm.
    ```
  </Accordion>

  <Accordion icon="wand-magic-sparkles" title="Reconstruct a legacy part with no CAD file">
    ```text theme={null}
    This bracket has no existing CAD model — it's out-of-production tooling we scanned to replicate. Reconstruct it as a fully parametric part from C:/Scans/bracket_legacy.stl. The two bolt holes and the mating flange face are functional and must match the scan within 0.05mm; the rest of the body can be a clean approximation of the scanned surface.
    ```
  </Accordion>
</AccordionGroup>

## Tips for reverse engineering prompts

* **Say how the scan was captured** — structured-light, laser, CT, or photogrammetry scans differ in noise characteristics and typical accuracy. This helps Nexus judge what's real geometry versus scan noise.
* **State a target tolerance** — "within 0.1mm" gives Nexus a concrete fit criterion. Without one, it has to guess how tightly to chase the mesh.
* **Separate functional from cosmetic features** — call out which features must match exactly (mating faces, bores, thread engagement) versus which can be a clean approximation (organic surfaces, cosmetic curvature). This is the single biggest lever on how usable the result is.
* **Give a reference for alignment** — if the part needs to sit in a specific orientation or coordinate system (to mate with another part, or match a drawing), name the reference features to align to.
* **Ask for a deviation report when accuracy matters** — for inspection or as-built verification, always request the scan-to-model comparison rather than assuming the fit is good.
