2020 08 30 Fix Culling algorithm. Change culling intensity correlation. - syntaxmonkey/Thesis GitHub Wiki
Fix culling algorithm.
We use the exterior vertices as the seed for drawing the contour lines. However, the order of the exterior points is circular. Sorting the lines based on external vertex was not enough. In many cases, there are lines in the region that are closer than they should be.
We fix this by sorting the external vertices in a sequential order traversing the circumference of the flattened mesh. When culling the lines, we also check that lines are far enough away from the current line AND far enough from any existing line accepted in the region. The result is that regions with higher intensity regions do not have lines that are too close together.
Change line density correlation algorithm
The line density was inversely correlated with the region intensity. Regions with high intensity, toward 255, will have lower line density while regions with lower intensity, will have high line density. Unfortunately, the linear transformation does not sufficiently reduce the line density in high intensity regions.
We can utilize other transformations. In the image below, we implement an exponential transformation for line distance based on region intensity. As a result, regions with high intensity have significantly lower line density.
Allow blank regions
Currently, regardless of the intensity of the region, we always draw the first line. As a result, even a region with maximum intensity will have a line.
To counteract this behaviour, we have added an intensity threshold check. If the region threshold is above value K, we will skip drawing lines in that region. The first image used the old algorithm while the second image allows blank regions. This is another behaviour we can control. I'm not entirely sure we want the blank region to always be true.