Assignment 01

Processing TINs

Deadline is 2025-12-02@18:00

It’s worth 10% of the final mark

Late submission? 10% will be removed for each day that you are late (3 days max)

This is an individual assignment



The aim of this assignment is to implement several functions related to terrains represented with TINs.

You are required to implement the following three operations:

  1. Extracting the Voronoi diagram (VD) from the Delaunay triangulation (DT).
  2. Calculating the slope (gradient and aspect) at a given location.
  3. Estimating elevation through linear interpolation in a TIN.

What you are given to start

Code is provided in the /hw/01/ folder of the TUDelft GitLab repository of the course (login with your NetID is required). (This repository is provided only as a way to download the code; using Git is not necessary.)

The skeleton of the Python program includes:

  1. geo1015_hw01.py is the main program. You should not modify this file.
  2. interface.py controls the interface. You should not modify this file.
  3. mycode_hw01.py is where all your code should go. Three functions are defined here and must be completed. You are not allowed to change input parameters, but you may add helper functions within this file. Apart from numpy and startinpy, you are only allowed to import from the Python standard library (i.e., no additional pip-installed packages).

To run the code, first install the following packages:

pip install -U numpy
pip install -U startinpy
pip install -U rasterio
pip install -U matplotlib
pip install -U pillow

Then, start the program with this (to see the window above):

python geo1015_hw01.py

What you have to do

You must implement the code for the following three functions in mycode_hw01.py:

  1. get_voronoi_edges()
  2. slope()
  3. interpolate_tin()

Good to know

from my_code_hw01 import Tin
import numpy as np

tin = Tin()
tin.insert_one_pt([0., 0., 1.])
tin.insert_one_pt([1., 0., 2.])
tin.insert_one_pt([1., 1., 3.])
tin.insert_one_pt([0., 1., 4.])

vi_last = tin.number_of_vertices()
print(tin.get_area_voronoi_cell())

Marking

Criterion Points
Followed all rules and compiles/runs correctly 1.0
Voronoi diagram drawing 3.0
Slope calculation 3.0
Interpolation 3.0

What to submit and how to submit it

Submit one file: my_code_hw01.py (do not change the filename).

Don’t forget to add your name and student number at the top of the file, as indicated in the comments.

Oh, and no report is required.

Upload your file to this SURFdrive page and when prompted for your name put your student number

[last updated: 2025-11-13 08:21]