• Stars
    star
    117
  • Rank 301,828 (Top 6 %)
  • Language
    C++
  • License
    Mozilla Public Li...
  • Created almost 8 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Introductory assignment for Geometry Processing course

Geometry Processing – Introduction

To get started: Clone (do not fork publicly) this repository

git clone --recursive http://github.com/alecjacobson/geometry-processing-introduction.git

Welcome to Geometry Processing! The purpose of this assignment will be to get you up and running with the two C++ libraries we will be using: Eigen for dense and sparse linear algebra routines and libigl for geometry processing routines. We will make use of the OpenGL-based viewer used by the libigl tutorial. This viewer also depends on glfw, a library for managing windows on Linux, Mac OS X and windows.

Prerequisite installation

On all platforms, we will assume you have installed cmake and a modern c++ compiler on Mac OS XΒΉ, LinuxΒ², or WindowsΒ³.

We also assume that you have cloned this repository using the --recursive flag (if not then issue git submodule update --init --recursive).

Layout

All assignments will have a similar directory and file layout:

README.md
CMakeLists.txt
main.cpp
include/
  function1.h
  function2.h
  ...
src/
  function1.cpp
  function2.cpp
  ...
shared/
  libigl/
    include/
      igl/
        ...
  ...

The README.md file will describe the background, contents and tasks of the assignment.

The CMakeLists.txt file setups up the cmake build routine for this assignment.

The main.cpp file will include the headers in the include/ directory and link to the functions compiled in the src/ directory. This file contains the main function that is executed when the program is run from the command line.

The include/ directory contains one file for each function that you will implement as part of the assignment. Do not change these files.

The src/ directory contains empty implementations of the functions specified in the include/ directory. This is where you will implement the parts of the assignment.

The shared/ directory will contain shared resources: cmake files, dependences (e.g., libigl) and data. Feel free to poke around in here, but you shouldn't change any of these files.

Compilation

This and all following assignments will follow a typical cmake/make build routine. Starting in this directory, issue:

mkdir build
cd build
cmake ..
make 

Why don't you try this right now?

Execution

Once built, you can execute the assignment from inside the build/ using

./introduction

After compiling according to the instructions above, if you try executing right now, then you'll see a bunny:

Screenshot of viewer displaying a bunny

You can click and drag to change the view.

Optionally, this program can input a path to a triangle mesh file (other than the bunny):

./introduction [path to input file]

Background

Every assignment, including this one, will start with a Background section. This will review the math and algorithms behind the task in the assignment. Students following the lectures should already be familiar with this material and may opt to skip this section.

Let's get familiar with the explicit mesh representation of a discrete surface immersed in $\mathbb{R}^3$. Throughout the course, we will store the set of mesh vertices $V$⁴ and the set of triangles (a.k.a. faces) $F$ as two matrices: V and F.

The matrix V is $|V|$ by 3 in size, where the ith row of this matrix contains the x-, y- and z-coordinates of the ith vertex of the mesh.

The matrix F is $|F|$ by 3 in size, where the jth row of this matrix contains the indices into the rows of V of the first, second and third corners of the jth triangle as a non-negative number (remember in C++ arrays and matrices start with index 0).

The information in V alone is purely positional and encodes the geometry of the surface.

The information in F alone is purely combinatoric and encodes the topology of the surface.

By convention, the indices in each row of F are ordered counter-clockwise around the triangle. Using the right-hand rule, we can define the normal of each triangle as the vector that points most away from the surface.

The right-hand rule and the counterclockwise ordering convention defines the normal of a triangle.

Each oriented triangle also defines three directed edges between its three vertices. Other triangles in the mesh may contain edges with the same incident vertices, possibly in the opposite direction. A manifold mesh will have at most two triangles incident on the same (undirected) edge, therefor we'll refer to each triangle's directed edge as a half-edge.

Two neighboring triangles may share the same (unoriented) edge (thick black). In a consistently oriented mesh, these triangles' corresponding half-edges (orange) will have opposite orientation.

The number of vertices $|V|$ and number of faces $|F|$ and number of unique (undirected) edges $|E|$ are intimately related. Adding a new triangle to a mesh may mean increasing the number of vertices and edges, too. The algebraic relationship between the number of vertices, edges and faces reveals the topological genus of the surface via the Euler Characteristic

$$ Ο‡ = 2c - 2h - b, $$

where $c$ is the number of connected components, $h$ is number of holes (as in donut), and $b$ is the number of connected components of the boundary of the surface.

For meshes representing polyhedral surfaces, the Euler Characteristic can be computed very simply:

Chi = |V| - |E| + |F|.

Assuming no unreferenced vertices in V, each of the quantities in the right-hand side can be determined from F alone. This indicates that its a purely topological property. Changing the geometric positions (i.e., changing the vertex positions in V) will not affect the Euler Characteristic. Due to this, we say that the Euler Characteristic is a topological invariant.

Tasks

Every assignment, including this one, will contain a Tasks section. This will enumerate all of the tasks a student will need to complete for this assignment. These tasks will match the header/implementation pairs in the include//src/ directories.

Groundrules

Libigl has implemented many of the tasks you'll find in this course. As a result, for some assignments, including this one, you'll see a Groundrules section that lists which functions you can and should use from libigl and/or functions you may not use (and should avoid copying your answers from).

Blacklist libigl functions

For this assignment you may not use

  • igl::all_edges
  • igl::edge_flaps
  • igl::edge_topology
  • igl::edges
  • igl::euler_characteristic
  • igl::exterior_edges
  • igl::is_boundary_edge
  • igl::unique_edge_map
  • or any other libigl function that returns a list of edges.

src/edges.cpp

From a list of triangles F, construct a $|E|$ by 2 matrix E, where the kth row of this matrix contains the indices into the rows of V of the start and end point of the kth edge in the mesh. E should contain every undirected edge exactly once.

src/euler_characteristic.cpp

From the list of triangles F, return the Euler Characteristic X of the triangle mesh. You may and should use your edges function from the previous task.

Submission

Submit your src/ files on MarkUs

Questions?

Direct your questions to the Issues page of this repository.

Answers?

Help your fellow students by answering questions or positions helpful tips on the Issues page of this repository.


ΒΉ Mac Users

You will need to install Xcode if you haven't already.

Β² Linux Users

Many linux distributions do not include gcc and the basic development tools in their default installation. On Ubuntu, you need to install the following packages:

sudo apt-get install git
sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install libx11-dev
sudo apt-get install mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev
sudo apt-get install libxrandr-dev
sudo apt-get install libxi-dev
sudo apt-get install libxmu-dev
sudo apt-get install libblas-dev

Β³ Windows Users

libigl only supports the Microsoft Visual Studio 2015 compiler in 64bit mode. It will not work with a 32bit build and it will not work with older versions of visual studio.

⁴ LaTeX

This markdown document, and those for all other assignments, contains $\LaTeX$ math. GitHub just shows the un-evaluated LaTeX code, but other markdown browsers will show the typeset math. You can also generate README.html using multimarkdown:

cat shared/markdown/header.md README.md | multimarkdown --process-html -o README.html

More Repositories

1

common-3d-test-models

Repository containing common 3D test models in original format with original source if known and obj mesh
Forth
763
star
2

gptoolbox

Matlab toolbox for Geometry Processing.
MATLAB
629
star
3

geometry-processing-csc2520

Course Page for Geometry Processing
MATLAB
334
star
4

geometry-processing

Course material for a grad-level course in Geometry Processing.
293
star
5

coloremoji.sty

Style package for directly including color emojis in latex documents
TeX
215
star
6

computer-graphics-csc317

Course Page for Computer Graphics course
CSS
184
star
7

geometry-processing-parameterization

Parameterization assignment for Geometry Processing course
C++
148
star
8

geometry-processing-curvature

Curvature assignment for Geometry Processing course
C++
148
star
9

geometry-processing-deformation

Deformation assignment for Geometry Processing course
C++
148
star
10

ascii3d

3D Render in ASCII art
C++
131
star
11

computer-graphics-bounding-volume-hierarchy

Computer Graphics Assignment about Bounding Volume Hierarchies
C++
123
star
12

geometry-processing-mesh-reconstruction

Mesh Reconstruction assignment for Geometry Processing course
Pawn
101
star
13

computer-graphics-kinematics

Computer Graphics Assignment about Kinematics
C++
93
star
14

geometry-processing-registration

Registration assignment for Geometry Processing course
C++
86
star
15

nested_cages

Corresponding Code for the SIGGRAPH Asia paper "Nested Cages"
C++
81
star
16

skeleton-builder

C++
61
star
17

FAST

Fast Automatic Skinning Transformations
C++
61
star
18

skeleton-poser

C++
58
star
19

better-code-runtime-polymorphism

Git walk through of the C++ code presented in Sean Parent's talk "Better Code: Runtime Polymorphism"
C++
55
star
20

convex-optimization-cookbook

MATLAB
53
star
21

seminar-on-geometry-and-animation

course webpage
49
star
22

computer-graphics-mass-spring-systems

Computer Graphics Assignment – Mass Spring Systems
C++
48
star
23

computer-graphics

Computer Graphics Course
45
star
24

MeshQuickLookPlugin

QuickLook Plugin (.qlgenerator) for 3D model mesh files (.mesh, .obj, .off, .ply, .stl, .wrl)
C++
45
star
25

geometry-processing-smoothing

Smoothing assignment for Geometry Processing course
C++
41
star
26

sparse-solver-benchmark

CMake
35
star
27

gp-cli

Command Line Tools for Geometry Processing
C++
30
star
28

computer-graphics-ray-casting

Computer Graphics Assignment about Ray Casting
C++
30
star
29

meshfix

Port of Marco Attene's meshfix to compile and run on Mac OS X
C++
27
star
30

computer-graphics-meshes

Computer Graphics Assignment about Meshes
C++
25
star
31

minimal-latex-setup-for-siggraph

TeX
21
star
32

qslim

Port of Michael Garland's QSlim to compile on Mac OS X
C++
21
star
33

puppet

Corresponding code for the SIGGRAPH 2014 paper "Tangible and Modular Input Device for Character Articulation"
C
20
star
34

computer-graphics-raster-images

Computer Graphics Assignment about Raster Images
C++
20
star
35

libigl-tinyad-example

C++
16
star
36

computer-graphics-ray-tracing

Computer Graphics Assignment about Ray Tracing
C++
14
star
37

computer-graphics-shader-pipeline

Computer Graphics Assignment about the Shader Pipeline
C++
14
star
38

medit

Port and Modification of Pascal Frey's medit software for tet-mesh visualization
C
14
star
39

geometry-processing-libigl-implementations

C++
12
star
40

libigl-link-example

CMake
8
star
41

glfw-glut

C
6
star
42

fcpw-libigl-example

C++
6
star
43

openmp-on-macos

C++
6
star
44

vim-digraphs-everywhere

Ruby
6
star
45

self-intersection-curves

CMake
6
star
46

multigrid

Multigrid solver for matlab
MATLAB
5
star
47

matlab

just enough matlab to compile gptoolbox's mex folder
Shell
4
star
48

libigl-shadow-mapping

C++
3
star
49

phong-demo

Demonstration of Phong illumination and Phong/Gouraud Shading
JavaScript
3
star
50

latent-space-dynamics-website

CSS
3
star
51

glut

Patched version of glut for os x, supporting vertical/horizontal mouse wheel, command key, core profile.
C
3
star
52

libigl-eigen-mkl

CMake
3
star
53

chalkboard

Raster chalkboard app with pressure sensitive (e.g., for Apple Pencilβ„’) https://alecjacobson.github.io/chalkboard/
HTML
3
star
54

paparazzi-website

Project Page website for Paparazzi
CSS
2
star
55

FLUFFY

CMake
2
star
56

perceptual-study

Web-based perceptual study base code
PHP
2
star
57

consistent-penetrations

C++
2
star
58

libigl-example-project-with-multiple-executables

CMake
2
star
59

math-genealogy

Python
2
star
60

gmp-mpfr-externalproject_add

CMake
2
star
61

low-rank-friction

Jupyter Notebook
1
star
62

cmake-dependency-test

CMake
1
star
63

CoMISo-skinny

C++
1
star
64

libigl-example-triangle

C++
1
star
65

libigl-issue-1656-hot-fix

C++
1
star
66

scatter-gather-symdiff

MATLAB
1
star
67

stop-motion-faces-project-page

CSS
1
star
68

side-by-side

C++
1
star
69

libigl-example-mex

CMake
1
star
70

libigl-skinny

C++
1
star
71

libigl-small

C++
1
star
72

dirac-project-page

Project Page for "A Dirac Operator for Extrinsic Shape Analysis"
CSS
1
star