# autodeskailab/brepnet architecture

> Architecture diagram of the GitHub repository autodeskailab/brepnet, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/autodeskailab/brepnet
- Repository: https://github.com/autodeskailab/brepnet

## Overview

BRepNet is a research system for semantic face segmentation of boundary-representation (B-Rep) solids. A user processes STEP data into topology, geometry features, and dataset metadata; trains or loads the network; then obtains per-face segment probabilities and can visualize results. The graph captures documented and indexed source relationships. Some feature extraction, prediction, and visualization links are based on README statements because their implementation was not excerpted; those links are marked dashed where source-level wiring is unverified.

Main entry points: [`pipeline/extract_brepnet_data_from_step.py`](https://github.com/autodeskailab/brepnet/blob/master/pipeline/extract_brepnet_data_from_step.py) (STEP extraction), [`models/brepnet.py`](https://github.com/autodeskailab/brepnet/blob/master/models/brepnet.py) (BRepNet model), [`eval/evaluate_folder.py`](https://github.com/autodeskailab/brepnet/blob/master/eval/evaluate_folder.py) (Folder evaluation), [`pipeline/quickstart.py`](https://github.com/autodeskailab/brepnet/blob/master/pipeline/quickstart.py) (Dataset quickstart)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Data preparation"]
  node_quickstart["Dataset quickstart<br/>[quickstart.py]"]
  node_extract["STEP extraction"]
  node_mapper["Entity mapping<br/>[entity_mapper.py]"]
  node_validate["Face index validation"]
  node_crosscheck["Segmentation checks"]
  node_builddata["Dataset metadata"]
  node_stats["Feature statistics<br/>[running_stats.py]"]
end

subgraph group_learning["Model and training"]
  node_dataset["BRepNet dataset<br/>[brepnet_dataset.py]"]
  node_datasetold["Legacy dataset"]
  node_sampler["Face sampler"]
  node_uvnet["UV feature encoders<br/>[uvnet_encoders.py]"]
  node_model["BRepNet model<br/>[brepnet.py]"]
  node_train["Training runner<br/>[train.py]"]
end

subgraph group_inference["Evaluation and visualization"]
  node_evaluate["Folder evaluation<br/>[evaluate_folder.py]"]
  node_visualize["Segmentation viewers"]
end

subgraph group_shared["Shared runtime"]
  node_occ["OCC conversion"]
  node_scale["Body scaling<br/>[scale_utils.py]"]
  node_datautils["Data utilities<br/>[data_utils.py]"]
end

node_user(("Engineer"))
node_step["STEP solids"]
node_predictions["Face probabilities"]

node_user -->|"runs preparation"| node_quickstart
node_step -.->|"extracts features"| node_extract
node_quickstart -->|"runs extraction"| node_extract
node_quickstart -->|"builds dataset"| node_builddata
node_extract -->|"maps entities"| node_mapper
node_extract -->|"validates indices"| node_validate
node_extract -->|"checks labels"| node_crosscheck
node_extract -->|"converts geometry"| node_occ
node_extract -->|"scales body"| node_scale
node_builddata -->|"accumulates statistics"| node_stats
node_builddata -->|"loads data"| node_datautils
node_user -->|"starts training"| node_train
node_train -->|"fits model"| node_model
node_model -->|"loads batches"| node_dataset
node_model -->|"supports legacy loading"| node_datasetold
node_model -->|"samples faces"| node_sampler
node_model -->|"encodes geometry"| node_uvnet
node_dataset -->|"loads arrays"| node_datautils
node_datasetold -->|"loads arrays"| node_datautils
node_user -->|"evaluates solids"| node_evaluate
node_evaluate -->|"processes STEP files"| node_extract
node_evaluate -->|"runs prediction"| node_model
node_evaluate -.->|"writes probabilities"| node_predictions
node_predictions -.->|"displays segments"| node_visualize
node_user -->|"views results"| node_visualize
node_mapper -->|"maps displayed faces"| node_visualize

click node_quickstart "https://github.com/autodeskailab/brepnet/blob/master/pipeline/quickstart.py"
click node_extract "https://github.com/autodeskailab/brepnet/blob/master/pipeline/extract_brepnet_data_from_step.py"
click node_mapper "https://github.com/autodeskailab/brepnet/blob/master/pipeline/entity_mapper.py"
click node_occ "https://github.com/autodeskailab/brepnet/blob/master/utils/create_occwl_from_occ.py"
click node_scale "https://github.com/autodeskailab/brepnet/blob/master/utils/scale_utils.py"
click node_validate "https://github.com/autodeskailab/brepnet/blob/master/pipeline/face_index_validator.py"
click node_crosscheck "https://github.com/autodeskailab/brepnet/blob/master/pipeline/segmentation_file_crosschecker.py"
click node_builddata "https://github.com/autodeskailab/brepnet/blob/master/pipeline/build_dataset_file.py"
click node_stats "https://github.com/autodeskailab/brepnet/blob/master/pipeline/running_stats.py"
click node_dataset "https://github.com/autodeskailab/brepnet/blob/master/dataloaders/brepnet_dataset.py"
click node_datasetold "https://github.com/autodeskailab/brepnet/blob/master/dataloaders/brepnet_dataset_old.py"
click node_sampler "https://github.com/autodeskailab/brepnet/blob/master/dataloaders/max_num_faces_sampler.py"
click node_uvnet "https://github.com/autodeskailab/brepnet/blob/master/models/uvnet_encoders.py"
click node_model "https://github.com/autodeskailab/brepnet/blob/master/models/brepnet.py"
click node_train "https://github.com/autodeskailab/brepnet/blob/master/train/train.py"
click node_evaluate "https://github.com/autodeskailab/brepnet/blob/master/eval/evaluate_folder.py"
click node_visualize "https://github.com/autodeskailab/brepnet/tree/master/visualization"
click node_datautils "https://github.com/autodeskailab/brepnet/blob/master/utils/data_utils.py"

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_quickstart,node_extract,node_mapper,node_validate,node_crosscheck,node_builddata,node_stats toneBlue
class node_dataset,node_datasetold,node_sampler,node_uvnet,node_model,node_train toneAmber
class node_evaluate,node_visualize toneMint
class node_occ,node_scale,node_datautils toneRose
class node_user,node_step,node_predictions toneIndigo
```

## Components

### Data preparation

- [Dataset quickstart](https://github.com/autodeskailab/brepnet/blob/master/pipeline/quickstart.py): `pipeline/quickstart.py`
- [STEP extraction](https://github.com/autodeskailab/brepnet/blob/master/pipeline/extract_brepnet_data_from_step.py): `pipeline/extract_brepnet_data_from_step.py`
- [Entity mapping](https://github.com/autodeskailab/brepnet/blob/master/pipeline/entity_mapper.py): `pipeline/entity_mapper.py`
- [Face index validation](https://github.com/autodeskailab/brepnet/blob/master/pipeline/face_index_validator.py): `pipeline/face_index_validator.py`
- [Segmentation checks](https://github.com/autodeskailab/brepnet/blob/master/pipeline/segmentation_file_crosschecker.py): `pipeline/segmentation_file_crosschecker.py`
- [Dataset metadata](https://github.com/autodeskailab/brepnet/blob/master/pipeline/build_dataset_file.py): `pipeline/build_dataset_file.py`
- [Feature statistics](https://github.com/autodeskailab/brepnet/blob/master/pipeline/running_stats.py): `pipeline/running_stats.py`

### Model and training

- [BRepNet dataset](https://github.com/autodeskailab/brepnet/blob/master/dataloaders/brepnet_dataset.py): `dataloaders/brepnet_dataset.py`
- [Legacy dataset](https://github.com/autodeskailab/brepnet/blob/master/dataloaders/brepnet_dataset_old.py): `dataloaders/brepnet_dataset_old.py`
- [Face sampler](https://github.com/autodeskailab/brepnet/blob/master/dataloaders/max_num_faces_sampler.py): `dataloaders/max_num_faces_sampler.py`
- [UV feature encoders](https://github.com/autodeskailab/brepnet/blob/master/models/uvnet_encoders.py): `models/uvnet_encoders.py`
- [BRepNet model](https://github.com/autodeskailab/brepnet/blob/master/models/brepnet.py): `models/brepnet.py`
- [Training runner](https://github.com/autodeskailab/brepnet/blob/master/train/train.py): `train/train.py`

### Evaluation and visualization

- [Folder evaluation](https://github.com/autodeskailab/brepnet/blob/master/eval/evaluate_folder.py): `eval/evaluate_folder.py`
- [Segmentation viewers](https://github.com/autodeskailab/brepnet/tree/master/visualization): `visualization`

### Shared runtime

- [OCC conversion](https://github.com/autodeskailab/brepnet/blob/master/utils/create_occwl_from_occ.py): `utils/create_occwl_from_occ.py`
- [Body scaling](https://github.com/autodeskailab/brepnet/blob/master/utils/scale_utils.py): `utils/scale_utils.py`
- [Data utilities](https://github.com/autodeskailab/brepnet/blob/master/utils/data_utils.py): `utils/data_utils.py`

### Other components

- **Engineer**
- **STEP solids**
- **Face probabilities**

## Connections

- Engineer → Dataset quickstart: runs preparation (evidence: `README.md`)
- STEP solids → STEP extraction: extracts features (evidence: `README.md`)
- Dataset quickstart → STEP extraction: runs extraction (evidence: `pipeline/quickstart.py`)
- Dataset quickstart → Dataset metadata: builds dataset (evidence: `pipeline/quickstart.py`)
- STEP extraction → Entity mapping: maps entities (evidence: `pipeline/extract_brepnet_data_from_step.py`)
- STEP extraction → Face index validation: validates indices (evidence: `pipeline/extract_brepnet_data_from_step.py`)
- STEP extraction → Segmentation checks: checks labels (evidence: `pipeline/extract_brepnet_data_from_step.py`)
- STEP extraction → OCC conversion: converts geometry (evidence: `pipeline/extract_brepnet_data_from_step.py`)
- STEP extraction → Body scaling: scales body (evidence: `pipeline/extract_brepnet_data_from_step.py`)
- Dataset metadata → Feature statistics: accumulates statistics (evidence: `pipeline/build_dataset_file.py`)
- Dataset metadata → Data utilities: loads data (evidence: `pipeline/build_dataset_file.py`)
- Engineer → Training runner: starts training (evidence: `README.md`)
- Training runner → BRepNet model: fits model (evidence: `train/train.py`)
- BRepNet model → BRepNet dataset: loads batches (evidence: `models/brepnet.py`)
- BRepNet model → Legacy dataset: supports legacy loading (evidence: `models/brepnet.py`)
- BRepNet model → Face sampler: samples faces (evidence: `models/brepnet.py`)
- BRepNet model → UV feature encoders: encodes geometry (evidence: `models/brepnet.py`)
- BRepNet dataset → Data utilities: loads arrays (evidence: `dataloaders/brepnet_dataset.py`)
- Legacy dataset → Data utilities: loads arrays (evidence: `dataloaders/brepnet_dataset_old.py`)
- Engineer → Folder evaluation: evaluates solids (evidence: `README.md`)
- Folder evaluation → STEP extraction: processes STEP files (evidence: `eval/evaluate_folder.py`)
- Folder evaluation → BRepNet model: runs prediction (evidence: `eval/evaluate_folder.py`)
- Folder evaluation → Face probabilities: writes probabilities (evidence: `README.md`)
- Face probabilities → Segmentation viewers: displays segments (evidence: `README.md`)
- Engineer → Segmentation viewers: views results (evidence: `README.md`)
- Entity mapping → Segmentation viewers: maps displayed faces (evidence: `visualization/jupyter_segmentation_viewer.py`)
