# roadinforest/occt-step-viewer-web architecture

> Architecture diagram of the GitHub repository roadinforest/occt-step-viewer-web, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/roadinforest/occt-step-viewer-web
- Repository: https://github.com/roadinforest/occt-step-viewer-web

## Overview

This is a client-side CAD file viewer. A user selects a supported file, the Vue demo reads it and dispatches it to the OCCT WebAssembly importer, then exposes the import result and renders its meshes in an interactive Three.js viewer. The component also handles loading and error states. The README documents JSON mesh-structure display; the supplied excerpt does not show its rendering details, so that capability is represented without asserting a separate implementation path. Some template and rendering code is omitted from the excerpts.

Main entry points: [`occt-vue-demo/src/components/OcctImportDemo.vue`](https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/components/OcctImportDemo.vue) (Format dispatch), [`occt-vue-demo/src/main.js`](https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/main.js) (Vue entry point), [`occt-vue-demo/src/App.vue`](https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/App.vue) (Application shell), [`occt-vue-demo/public/occt-import-js.js`](https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/public/occt-import-js.js) (OCCT importer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Vue application"]
  node_entry["Vue entry point<br/>[main.js]"]
  node_shell["Application shell<br/>[App.vue]"]
  node_demo["Import demo UI<br/>[OcctImportDemo.vue]"]
end

subgraph group_import["CAD import"]
  node_file_read["File selection and reading<br/>[OcctImportDemo.vue]"]
  node_dispatch["Format dispatch<br/>[OcctImportDemo.vue]"]
  node_occt["OCCT importer<br/>[occt-import-js.js]"]
  node_wasm["OCCT WebAssembly"]
end

subgraph group_view["Results and viewer"]
  node_result["Import result and status<br/>[OcctImportDemo.vue]"]
  node_json["Mesh JSON display<br/>[OcctImportDemo.vue]"]
  node_render["Mesh rendering<br/>[OcctImportDemo.vue]"]
  node_three["Three.js renderer"]
  node_orbit["Orbit controls"]
end

node_user(("CAD file user"))

node_user -->|"opens viewer"| node_entry
node_entry -->|"mounts"| node_shell
node_shell -->|"renders"| node_demo
node_user -->|"selects file"| node_file_read
node_file_read -->|"provides bytes"| node_dispatch
node_dispatch -->|"calls parser"| node_occt
node_occt -.->|"loads engine"| node_wasm
node_dispatch -->|"sets result"| node_result
node_result -.->|"displays structure"| node_json
node_result -->|"renders meshes"| node_render
node_render -->|"uses renderer"| node_three
node_render -->|"creates controls"| node_orbit

click node_entry "https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/main.js"
click node_shell "https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/App.vue"
click node_demo "https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/components/OcctImportDemo.vue"
click node_file_read "https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/components/OcctImportDemo.vue"
click node_dispatch "https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/components/OcctImportDemo.vue"
click node_occt "https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/public/occt-import-js.js"
click node_wasm "https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/public/occt-import-js.wasm"
click node_result "https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/components/OcctImportDemo.vue"
click node_json "https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/components/OcctImportDemo.vue"
click node_render "https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/components/OcctImportDemo.vue"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_shell,node_demo,node_user toneBlue
class node_file_read,node_dispatch,node_occt,node_wasm toneAmber
class node_result,node_json,node_render,node_three,node_orbit toneMint
```

## Components

### Vue application

- [Vue entry point](https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/main.js): `occt-vue-demo/src/main.js`
- [Application shell](https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/App.vue): `occt-vue-demo/src/App.vue`
- [Import demo UI](https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/components/OcctImportDemo.vue): `occt-vue-demo/src/components/OcctImportDemo.vue`

### CAD import

- [File selection and reading](https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/components/OcctImportDemo.vue): `occt-vue-demo/src/components/OcctImportDemo.vue`
- [Format dispatch](https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/components/OcctImportDemo.vue): `occt-vue-demo/src/components/OcctImportDemo.vue`
- [OCCT importer](https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/public/occt-import-js.js): `occt-vue-demo/public/occt-import-js.js`
- [OCCT WebAssembly](https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/public/occt-import-js.wasm): `occt-vue-demo/public/occt-import-js.wasm`

### Results and viewer

- [Import result and status](https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/components/OcctImportDemo.vue): `occt-vue-demo/src/components/OcctImportDemo.vue`
- [Mesh JSON display](https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/components/OcctImportDemo.vue): `occt-vue-demo/src/components/OcctImportDemo.vue`
- [Mesh rendering](https://github.com/roadinforest/occt-step-viewer-web/blob/main/occt-vue-demo/src/components/OcctImportDemo.vue): `occt-vue-demo/src/components/OcctImportDemo.vue`
- **Three.js renderer**
- **Orbit controls**

### Other components

- **CAD file user**

## Connections

- CAD file user → Vue entry point: opens viewer (evidence: `README.md`)
- Vue entry point → Application shell: mounts (evidence: `occt-vue-demo/src/main.js`)
- Application shell → Import demo UI: renders (evidence: `occt-vue-demo/src/App.vue`)
- CAD file user → File selection and reading: selects file (evidence: `occt-vue-demo/src/components/OcctImportDemo.vue`)
- File selection and reading → Format dispatch: provides bytes (evidence: `occt-vue-demo/src/components/OcctImportDemo.vue`)
- Format dispatch → OCCT importer: calls parser (evidence: `occt-vue-demo/src/components/OcctImportDemo.vue`)
- OCCT importer → OCCT WebAssembly: loads engine
- Format dispatch → Import result and status: sets result (evidence: `occt-vue-demo/src/components/OcctImportDemo.vue`)
- Import result and status → Mesh JSON display: displays structure (evidence: `README.md`)
- Import result and status → Mesh rendering: renders meshes (evidence: `occt-vue-demo/src/components/OcctImportDemo.vue`)
- Mesh rendering → Three.js renderer: uses renderer (evidence: `occt-vue-demo/src/components/OcctImportDemo.vue`)
- Mesh rendering → Orbit controls: creates controls (evidence: `occt-vue-demo/src/components/OcctImportDemo.vue`)
