TEDRASIM is a research demonstrator from a larger project exploring automated analysis of technical drawings.
Traditionally, technical drawings are created first in order to manufacture or model a three-dimensional object. TEDRASIM investigates the reverse direction: starting from a 3D scan or a photo of an object, the system automatically derives the corresponding technical drawing.
The overall TEDRASIM project explores two complementary approaches:
- Mesh-based pipeline – extracting projections and feature edges directly from 3D scan data
- Vision–Language Model (VLM) approach – generating 3D models from textual descriptions using fine-tuned multimodal models
This repository contains the mesh-based pipeline that converts STL meshes into structured technical drawings (PDF).
The machine-learning approach is implemented in a separate repository:
Note: This repository contains a simplified public version of the project; parts of the original pipeline and the core technical drawing similarity search system are not included.
The geometry-based pipeline converts a raw 3D mesh into a technical drawing through the following stages:
- Mesh preprocessing – repair and simplify the STL mesh
- Feature edge extraction – detect sharp edges relevant for drawings
- Orthographic projection – generate multiple 2D views
- Projection cleanup – remove artifacts and snap line endpoints
- TechDraw export – generate a PDF technical drawing using FreeCAD
tedrasim_3dscan/
├── data_example/ # example input/output data
├── notebooks/ # exploratory notebooks
├── scripts/ # CLI entrypoints for pipeline stages
├── src/
│ └── tedrasim_3dscan/
│ ├── freecad/ # FreeCAD TechDraw export
│ ├── mesh_processing/ # STL cleanup + feature edges
│ ├── projection_cleanup/ # projection snapping/cleanup
│ └── projections/ # compute orthographic projections
│
├── pyproject.toml
├── uv.lock
└── README.md
This project uses uv for Python environment and dependency management.
curl -Ls https://astral.sh/uv/install.sh | shuv venv
source .venv/bin/activateuv sync- Python 3.10+
- FreeCAD (required for final technical drawing export)
FreeCAD must be available in your system path.
Cleans and simplifies an STL mesh and extracts relevant feature edges.
python scripts/extract_features.py \
--input-stl PATH/TO/input.stl \
--cleaned-stl PATH/TO/cleaned-input.stl \
--edges-out PATH/TO/OUTPUT/feature_edges.vtp \
--target-faces 800 \
--feature-angle 25 \
--merge-vertex-percent 40Outputs:
mesh_cleaned.stlfeature_edges.vtp
Generates multiple 2D projections from the extracted edge geometry.
Two axis estimation methods are available.
-cluster (default) - uses clustering on line orientations
-longest - uses the longest edge direction
Example:
python scripts/make_projections.py \
--input PATH/TO/feature_edges.vtp \
--out-dir PATH/TO/projections \
--method clusterOutputs:
projection_0.npz
projection_1.npz
projection_2.npz
Snaps endpoints, removes short segments, and prepares projection geometry for CAD export.
python scripts/clean_projections.py \
--input-dir PATH/TO/projections \
--output-dir PATH/TO/projections_clean \
--snap-tol 1e-4 \
--min-length 0.01Outputs cleaned .npz files that are ready for FreeCAD-based drawing generation.
Creates a TechDraw page from the cleaned projections and exports a PDF.
The export script must be executed using FreeCAD’s Python environment:
FreeCAD -c src/tedrasim_3dscan/freecad/techdraw_from_projections.pyNote: file paths inside the FreeCAD script must match your local data directory.
The repository also contains exploratory notebooks for development and experimentation:
notebooks/stl_to_techdraw_pipeline.ipynbnotebooks/project_polygons.ipynb