Digital 3D Geometry Processing Exercise 2 – Geometry Representations
January 27, 2022
What to hand in
A .zip compressed file renamed to Exercisen-Group.zip where n is the number of the current exercise sheet. It should contain:
Copyright By PowCoder代写 加微信 powcoder
• Hand in only the files you changed (headers and source). It is up to you to make sure that all files that you have changed are in the zip.
• A readme.txt file containing a description on how you solved each exercise (use the same numbers and titles) and the encountered problems. Indicate what fraction of the total workload each project member contributed.
• Other files that are required by your readme.txt file. For example, if you mention some screenshot images in readme.txt, these images need to be submitted too.
• For the theory exercise, put TheoryExercise.pdf with your solutions in the same .zip you submit for the code. LATEX is preferred, but you may also handwrite neatly and legibly and scan it, if desired. No credit if I can’t read it.
• Submit your solutions to Gradescope before the submission deadline. The total points of this homework is 16.
1 Theory Exercise (8 pt)
1.1 (2 pt) Derive a signed distance function in 2D for a line L of the form y = x
1.2 (2 pt) Define a planar curve that has a sharp corner (discontinuity of normal vector) using only polynomials as coordinate functions. Please give a parametric representation.
1.3 (2 pt) Denote {(x(Nk ),y(Nk ))|k = 0,…,N} as a uniform sampling of a 2D curve (x(t),y(t)),t ∈ [0,1]. As the number of sampling N increases, does chord length mono- tonically increase (non-decrease). If yes, give a proof; if no, give a counterexample.
1.4 (2 pt) Find a sequence of 2D curves Ci (t), t ∈ [0, 1] which satisfy:
lim Ci (t) = L(t), ∀t ∈ [0, 1] where L(t) is a straight line segment in[0, 1]
The length of Ci(t) does not converge to the length of L(t) in [0,1]
Submit your solutions in a file named TheoryExercise.pdf. 1
Figure 1: Final result for the Regular Mesh 2 and function F(x,y) = y2 − sin(x2) = 0. 2 Coding Exercise (8 pt)
Download dgp-exercise2.zip from Piazza, which will contain a folder of planar tri- angle meshes in .obj format. Place this data folder somewhere you can access it, as you will need to load the triangular meshes into OpenFlipper to run your code on them. The skeleton code is in the file IsoContouring.cc, which should already be present in Plugin-DGPExercises.
You are given a triangular mesh with a list of vertex coordinates stored in v positions and a list of vertex indices forming each triangle stored in triangle ids. For each ver- tex, the third coordinate is zero, since the meshes are all in 2D. The goal of this exercise is to implement a contouring method like marching squares algorithm but on triangles rather than squares.
For each vertex you should compute the scalar iso-value of an implicit function. Then for each triangle, check if the signs of the vertex iso-values are not all the same. If the signs are different, use linear interpolation based on the iso-values to compute the edge that passes through that triangle. Add two end-points of that edge in a vector segment points. Here segment points is a vector of points, so add the two end- points one after the other.
Test the following implicit functions:
• F(x,y)=x2 +y2 −1=0
• F(x,y)=y2−sin(x2)=0
• F(x,y)=sin(2x+2y)−cos(4xy)+1=0
• F(x,y)=(3×2 −y2)2y2 −(x2 +y2)4 =0
After correctly implementing the functions, you should be able to test any of them by picking in the combobox.
To see the result on different meshes, simply load the provided meshes from the data folder. One correct output is shown in Figure 1.
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com