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

- What you are given to start
- What you have to do
- Good to know
- Marking
- What to submit and how to submit it
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:
- Extracting the Voronoi diagram (VD) from the Delaunay triangulation (DT).
- Calculating the slope (gradient and aspect) at a given location.
- 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:
geo1015_hw01.pyis the main program. You should not modify this file.interface.pycontrols the interface. You should not modify this file.mycode_hw01.pyis 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:
get_voronoi_edges()slope()interpolate_tin()
Good to know
- The file
mycode_hw01.pycontains useful hints—read it carefully. - Code efficiency is not a concern for this assignment.
- You are not allowed to directly use the functions
interpolate(),normal_triangle(), andnormal_vertex()from startinpy; you must implement these yourself. You may use all other functions from startinpy however. - Draw only the Voronoi cells that are bounded (ie not on the convex hull of the data).
- Your code must handle any input without crashing, even if the points are not in general position.
- Test your functions with various inputs, including manually constructed data, for example:
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]