2020 07 26 Implement LineSeed based on exterior points. Fix last intersection. - syntaxmonkey/Thesis GitHub Wiki
Vertical Lines based on Exterior points
We can now draw vertical lines starting from the exterior points. The following screenshots illustrate the results of drawing vertical lines on the Flat Triangulation and transferring to the Generated Mesh. When drawing the vertical lines, we the by a static amount. As a result, the lines that run through the high triangle density areas still do not cover the whole image. The line density is greater in the regions with higher density triangles. This property may help to preserve the contours in the high density triangle areas.
Drawing the vertical lines by finding where a reference line intersects with the triangle edges. Will place a point at each intersection.
Using the following approach to determine which edge intersects with reference line: https://www.kite.com/python/answers/how-to-check-if-two-line-segments-intersect-in-python
Draw the first intersection
Using the exterior points, we can now draw a line to the first edge intersection. The vertical lines alternate between magenta, white, and red. The containing triangle is highlighted in bolder yellow lines.
Drawing next intersections
Not completely working yet. For some reason, the lines terminate prematurely. There is a logic problem in the FindNextIntersection or the data structures.
TODO:
-
Fix defect on the last edge intersection.
-
Merge the regions back together.
2a. Once working, try out the full merge on several images. 2b. -
BFF still consistently fails in some cases. Try expanding the Mask for each attempt.
-
Generate hatching? Line density can be based on intensity of the region.
-
Thesis template: http://gigl.scs.carleton.ca/codefiles
-
Potential alternative approach to line intersection detection: https://gist.github.com/danieljfarrell/faf7c4cafd683db13cbc
Fix defect on the last edge intersection.
We will try detect the last edge intersection. Once we detect the last edge intersection, we will reduce the length to 99% of the actual length. Will need to test out some values.
Now the functionality is working. The vertical lines on the Flat Triangulation now go from edge to edge.
Rotating the original image CW 90
Can now rotate the original mesh Clock Wise 90 degrees. The contours lines are also rotated.