Skip to main content

OCP viewer troubleshooting

IssueFix
Extension missing (Cursor / fork)F1 → Extensions: Install from VSIX... → workspace root ocp-cad-viewer-3.4.0.vsix (steps)
Extension missing (VS Code / Codespaces)Install bernhard-42.ocp-cad-viewer from Marketplace
VSIX file missingbash .devcontainer/install-ocp-cad-viewer.sh download then install from VSIX
Cursor CLI reinstallbash .devcontainer/install-ocp-cad-viewer.sh install-cli then reload window
Commands still missingDeveloper: Reload Window after install
Blank viewerOpen OCP CAD Viewer panel before running just view
Cursor ESM crash / extension removedReinstall patched workspace VSIX (not Marketplace); rebuild container if file is stale
Cursor keeps uninstalling after crashUse patched VSIX only — bash .devcontainer/install-ocp-cad-viewer.sh download refreshes it

Recovery sequence (Cursor and forks)​

  1. bash .devcontainer/install-ocp-cad-viewer.sh download (if ocp-cad-viewer-3.4.0.vsix is missing)
  2. F1 → Extensions: Install from VSIX... → select /workspaces/<your-repo-folder>/ocp-cad-viewer-3.4.0.vsix
  3. Developer: Reload Window
  4. Open OCP CAD Viewer panel (activity bar)
  5. just view

Alternative for Cursor: bash .devcontainer/install-ocp-cad-viewer.sh install-cli, then steps 3–5.

See OCP CAD Viewer setup.

Missing Model Render colors​

Headless previews (export release, cad_tooling.render) read Part.color from leaf Part nodes only. Uncolored Compound wrappers do not inherit child colors — flattening that stops on one paints its sub-tree with the default face color (0.31, 0.63, 1.0).

SymptomLikely cause
Uniform blue sub-treeUncolored intermediate Compound not flattened to leaves
Sub-artifact OK, assembly wrongValidated a nested part, not the top-level @artifact
Everything one colorRendered from STL (no per-part color metadata)
just view OK, PNG wrongLive viewer uses the scene tree; headless render uses _colored_solids

Set part.color on every leaf Part, compose multi-color parts as nested compounds, and validate the published @artifact from Python geometry (not STL):

uv run python -c "
from cad_tooling.render import _build_artifact_shape, _colored_solids
name = 'ARTIFACT'
for i, (_, c) in enumerate(_colored_solids(_build_artifact_shape(name), (0.31, 0.63, 1.0))):
print(i, tuple(round(x, 2) for x in c))
"
just render-artifact ARTIFACT /tmp/out

One printed line per leaf solid; (0.31, 0.63, 1.0) means a missing part.color or an unflattened wrapper.

See also Render — Assembly colors and AGENTS.md — Part preview colors.