Skip to content

Polygon meshes are fundamental data structures in computer graphics, widely used to represent 3D surfaces. The aim of this project is to investigate alternatives to the half-edge data structure. Specifically, the project will focus on a vertex-centered approach inspired by rotation systems.

Notifications You must be signed in to change notification settings

CBSaksager/Polygonal-Mesh-Representation-Unity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mesh Representation Schemes Unity

This project implements and compares different polygon mesh representation schemes in Unity. It focuses on alternatives to the traditional Half-Edge data structure, particularly using a vertex-based approach inspired by Rotation Systems.

Codebase Structure

The project is organized into several modules, each implementing a different mesh representations or environment extensions:

Key Features

  • Multiple mesh representations: Half-edge and Rotation Systems
  • Face operations: Select and split faces
  • Edge operations: Navigate mesh topology through edges
  • Visualization: Debug gizmos for vertices, edges, and faces
  • Performance metrics: Timing information for mesh operations

Half-Edge Data Structure

Located in Assets/Scripts/Half-edge This folder contains the implementation of a Half-Edge mesh.

  • HalfEdgeCore.cs - Core data structures:
    • HEVertex - Represents a vertex in 3D space
    • HEHalfEdge - Represents a directed half-edge
    • HEFace - Represents a mesh face
  • HalfEdgeMesh.cs - Main mesh class with operations
  • HalfEdgeTester.cs - MonoBehaviour for testing in Unity

Rotation System v2

Located in Assets/Scripts/Rotation System v2 This folder contains the implementation of a Rotation System mesh with a face definition.

  • RotationSystem2Core.cs - Core data structures:
    • RSVertex - Represents a vertex in 3D space
    • RSEdge - Represents an edge between two vertices
    • RSFace - Represents a mesh face
  • RotationSystem2Mesh.cs - Main mesh class with operations
  • RotationSystem2Tester.cs - MonoBehaviour for testing in Unity

Editor Extensions

Located in Assets/Editor

  • HalfEdgeTesterEditor.cs - Custom inspector for Half-Edge testing
  • RotationSystem2TesterEditor.cs - Custom inspector for Rotation System v2
  • RotationSystemTesterEditor.cs - Custom inspector for original Rotation System

Getting Started

  1. Open the Unity scene Assets/Scenes/MeshSchemes.unity
  2. Select one of the tester objects in the hierarchy:
    • HEMeshTester for half-edge representation
    • RS2MeshTester for rotation system with face implementation
    • RSMeshTester for the simple, yet uncompletede, rotation system with out face implementation
  3. Use the Inspector buttons to create and manipulate meshes

Abandoned or unfinished parts


Some parts of the project didn't work out either because of time constraints or prioritisation of other elements.

Original Rotation System

Located in Assets/Scripts/Rotation System This folder contains the original Rotation System implementation. Meaning the implementation with a definition of faces. This mesh does work to some extend and the Face Split algorithm works. It shows how it is possible to work on meshes with implicit faces, but does not mimic a fair real-world mesh since no data for the faces such as colors, normals and so on can be stored.

  • RotationSystemCore.cs - Core data structures
  • RotationSystemMesh.cs - Main mesh class with operations
  • RotationSystemTester.cs - MonoBehaviour for testing in Unity

PLY File Support (Outdated)

Located in Assets/Scripts/PLY(outdated)/ An attempt to import PLY files without luck. For a better attempt look at the branch RsPly. This branch does however only import PLY files into the Rotation System v2 mesh.

  • PlyImporter.cs - Utilities for importing PLY files
  • PlyViewer.cs - MonoBehaviour for viewing PLY files

About

Polygon meshes are fundamental data structures in computer graphics, widely used to represent 3D surfaces. The aim of this project is to investigate alternatives to the half-edge data structure. Specifically, the project will focus on a vertex-centered approach inspired by rotation systems.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages