[WS2021] Homework 2 Discussion #2
-
|
This thread is open for the discussion of homework 2. |
Beta Was this translation helpful? Give feedback.
Replies: 24 comments
-
|
I have a question regarding the Halfedge Datastructure. In the lecture slides (Slide 68: https://docs.google.com/presentation/d/1k9Y2vSu9t-9rYNAIddGBSd6NZ2x0hODhCP_bbhF1SWE/edit#slide=id.ga62e3d440e_0_90) there is no explicit mention of an Edge in the Halfedge Datastructure. Is there a reason why the Edge class was added to the code skeleton? And if yes why does it only have one halfedge vaariable? Shouldn't it be two? |
Beta Was this translation helpful? Give feedback.
-
|
@torantie Good question. The short answer is: There is a reason. However, in this project, you can choose not to use Edge, whereas using Edge will bring more long-term benefits. The long answer is: Edge is a higher-level abstraction, and Halfedge is a detail of the implementation layer. If you only want to build a Halfedge representation, then Edge is not that important in the implementation, because Halfedge can already represent the concept of an edge.
Because a halfedge can access its opposite/twin, it is not entirely necessary to wrap two of them. |
Beta Was this translation helpful? Give feedback.
-
|
A okay i understand the abstraction point. Thank you^^
Hm i guess i am still a little confused why it is then called Halfedge and why it has that "twin" as information. The name kind of implies that it is a unidirectional edge (the picture of the slides also implies that), while the "Edge" implies that its bidirectional. |
Beta Was this translation helpful? Give feedback.
-
Your understanding is correct. Halfedge is unidirectional, but Edge is more on the conceptual side which is bidirectional. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Oppos.. the class Face {
constructor() {
this.halfedge = null // Halfedge
this.idx = -1 // Number
}
// vertices visit all vertices of the given face, and
// fn is a callback that receives the visited vertices
// and order index. For example, the usage could be:
//
// f.vertices((vertex, orderIdx) => {
// ... // do something for the vertex
// })
//
// if one does not need to access the order index,
// one can simply call the function as follows:
//
// f.vertices(v => { ... })
//
vertices(fn) {
... // should call fn(v, i) for all vertices of the face, where v is a vertex and i is its order index.
}
... |
Beta Was this translation helpful? Give feedback.
-
|
Ah okay. I thought the Note |
Beta Was this translation helpful? Give feedback.
-
|
No problem and sorry for the confusion. Actually, the project does not very strictly force you to not change the code skeleton (but I would not suggest change too much). So basically if you submit runnable code that does what was required in the project description (i.e. visualizes the normals and curvatures), it is still considered a successful delivery :) |
Beta Was this translation helpful? Give feedback.
-
|
Hi :-) How exactly is the homework graded? Is it a problem if the construction of the half edge structure takes relatively long? (around 1.5 minutes) |
Beta Was this translation helpful? Give feedback.
-
|
@vseup Performance is not the primary goal, getting things right is better than getting things faster in this course. Clean and clear implementation is preferred, if you have extra time, performance optimization will be a plus (not bonus :) The project description does not require anything related to runtime performance. A working submission before the corresponding deadline gets a PASS and receives the full 10%. |
Beta Was this translation helpful? Give feedback.
-
|
How's everyone's implementation status? Considering there is a huge gap (14.12.2020 - 11.01.2021) between the Christmas break, we could consider drifting the current submission deadline(s) a little bit to give you some more extra time to work on the coding project 1 and 2 (homework 2 and homework 3). Thumbs up on this message if you like it, and we could discuss the change in our next session if there are a considerable amount of requests. Otherwise, we just stick to the original plan :) |
Beta Was this translation helpful? Give feedback.
-
|
Hi, I'm curious how everyone is doing with the tasks of homework 2. To be honest it's quite challenging for me - until now I edited/completed all tasks, but not without mistakes. As I already invested a lot of time and neglected other courses for this too much I consider handing in a unfinished solution. |
Beta Was this translation helpful? Give feedback.
-
|
@vseup Good point. You can send your pull requests as early as possible even if you are not finished, but if you want to submit incremental commits, then you must comment on your pull request and state which version (by the commit hash) should be recognized as your final version. The grade for the project will be calculated according to the time of that commit and subtracted by the delay time (if it is delayed). So far, I think it is likely to extend the deadline of homework 2 and 3 by a week, which leaves more room for all of you to have more time to really understand the most important / foundation of this practical course. We can discuss more on tomorrow's session :) |
Beta Was this translation helpful? Give feedback.
-
|
okay, thank you :-) |
Beta Was this translation helpful? Give feedback.
-
|
I was working on the Gaussian curvature implementation and unfortunately am kind of stuck. This is what i got so far. I have honestly no idea what could be wrong or where i should search for an error. Would really appreciate a tip how this can happen. |
Beta Was this translation helpful? Give feedback.
-
|
@torantie Interesting result. So far your snippet looks good to me. But I am wondering are you absolutely sure your halfedge construction is correct? A possible way to debug your implementation and verify the result is to start from a simple model, such as a cube, or a tetrahedron. |
Beta Was this translation helpful? Give feedback.
-
|
The halfedge structure seems to work. Luckily i got the solution. my getAngle function was located in the vertex class and always calculated the same angle for every for loop. i just moved it to the Halfedge class and now it works. Took me only 3 hours to find out :D Sorry for the late night question ^^ |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
@krasnor Oppos. This seems to be an implementation issue. So far you implemented everything correct, except the color encoding. The mean curvature is always positive for sure, the problem is how we should visualize it. Notice that mean curvature is the amount of normal direction: with the provided color bar (from blue to red), if the angle defect is greater than zero (meaning concave), then we have the mean curvature on the normal direction, otherwise it is a convex we have an opposite direction. The text might not easy to understand but the following code should be easy to read: meanCurvature() {
const clb = this.cotanLaplaceBeltrami() // assume this returns || (Δf)i ||
if (this.angleDefect() < 0) {
return -clb
}
return clb
} |
Beta Was this translation helpful? Give feedback.
-
|
Ah thank you :) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
@torantie This is only about color mapping, which is not considered as wrong. If you take a look at how curvature is mapped to color, you will see the reason: https://github.com/mimuc/gp-ws2021/blob/f052bf48ab3918756a0a4d959841898b4e08d3f2/homeworks/2-ddg/src/main.js#L145 To reproduce exactly the same visualization, you will need to adapt a little bit to that (which I forgot to mark it as a TODO in the skeleton, sorry...). Overall, I won't suggest you spend more effort working on reproducing exactly the same color encoding. From what you have so far, the computation is correct (think about the relativity of values between vertices). |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the feedback. Good to know that the calculation at least is correct :D |
Beta Was this translation helpful? Give feedback.
-
|
Close due to the end of the submission period. |
Beta Was this translation helpful? Give feedback.






Close due to the end of the submission period.