https://github.com/spicycactuar/half-edge
Triangle mesh rendered backed by a half-edge data structure
https://github.com/spicycactuar/half-edge
computer-graphics cpp geometry-processing half-edge-data-structure opengl qt5
Last synced: 6 days ago
JSON representation
Triangle mesh rendered backed by a half-edge data structure
- Host: GitHub
- URL: https://github.com/spicycactuar/half-edge
- Owner: SpicyCactuar
- Created: 2024-11-11T21:50:38.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-02-20T23:06:12.000Z (5 months ago)
- Last Synced: 2025-03-02T02:47:11.262Z (5 months ago)
- Topics: computer-graphics, cpp, geometry-processing, half-edge-data-structure, opengl, qt5
- Language: C++
- Homepage:
- Size: 2.48 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Half Edge

Qt application that displays triangle meshes backed by the [half-edge](https://jerryyin.info/geometry-processing-algorithms/half-edge/) data structure.
The program supports triangle soup (`.tri`) and custom half-edge (`.halfedge`) files, with samples being provided.
In addition, the mesh can be subdivided using the [loop subdivision](https://graphics.stanford.edu/~mdfisher/subdivision.html) technique.## Project Structure
```plaintext
half-edge/
├── src/ # Source code
├── assets/ # Static assets
├── tri # .tri files
├── halfedge # .halfedge files
├── half-edge.pro # QMake project
└── README.md # Project README
```## Build
```bash
qmake
make
```## Run
```bash
bin/half-edge <.tri or .halfedge file>
```Example `.tri`:
```bash
bin/half-edge assets/tri/cube.tri
```Example `.halfedge`:
```bash
bin/half-edge assets/halfedge/cube.halfedge
```## Controls
| Key(s) | Action |
|--------------------------|------------------------------------|
| `(X, Y, Z)` Sliders | Adjust the camera position |
| `Model` ArcBall | Rotate mesh |
| `Light` ArcBall | Rotate directional light |
| `Flat Normals` Checkbox | Toggle per vertex/per face normals |
| `Show Vertices` Checkbox | Render spheres around vertices |
| `Vertex Size` Slider | Control size of vertex spheres |
| `Subdivisions [0, 8]` | Control current subdivision level |## Technologies
* **C++**: `>= C++17`
* **Qt**: `5.12.x`
* **OpenGL**: `>= 4.0`Newer versions of Qt might work correctly, if no breaking changes that affect the application were introduced.
Subdivisions are computed lazily, but the computation occurs on the main thread.
If the mesh is sufficiently large, the program stalls.## TODOs
* [ ] Parallelize subdivision computation