Skip to content

graeps/tedrasim-3dscan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TEDRASIM – 3D Scan to Technical Drawing

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:

  1. Mesh-based pipeline – extracting projections and feature edges directly from 3D scan data
  2. 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.


Pipeline Overview

The geometry-based pipeline converts a raw 3D mesh into a technical drawing through the following stages:

  1. Mesh preprocessing – repair and simplify the STL mesh
  2. Feature edge extraction – detect sharp edges relevant for drawings
  3. Orthographic projection – generate multiple 2D views
  4. Projection cleanup – remove artifacts and snap line endpoints
  5. TechDraw export – generate a PDF technical drawing using FreeCAD

Repository Structure

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

Installation

This project uses uv for Python environment and dependency management.

Install uv

curl -Ls https://astral.sh/uv/install.sh | sh

Create and activate a virtual environment

uv venv
source .venv/bin/activate

Install dependencies

uv sync

Requirements

  • Python 3.10+
  • FreeCAD (required for final technical drawing export)

FreeCAD must be available in your system path.


Pipeline Usage

Step 1 – Mesh Preprocessing and Feature Edge Extraction

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 40

Outputs:

  • mesh_cleaned.stl
  • feature_edges.vtp

Step 2 – Orthographic Projections

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 cluster

Outputs:

projection_0.npz
projection_1.npz
projection_2.npz

Step 3 – Projection Cleanup

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.01

Outputs cleaned .npz files that are ready for FreeCAD-based drawing generation.


Step 4 – TechDraw Export with FreeCAD

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.py

Note: file paths inside the FreeCAD script must match your local data directory.


Notebooks

The repository also contains exploratory notebooks for development and experimentation:

  • notebooks/stl_to_techdraw_pipeline.ipynb
  • notebooks/project_polygons.ipynb

About

Pipeline for generating technical drawings from 3D scan meshes using geometric analysis.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors