2020 07 19 Improve LinePoints generation. DualGraph. Exterior Points. - syntaxmonkey/Thesis GitHub Wiki
TODO:
- We currently plot the vertical lines on the original Mesh. We need to draw the vertical lines on the flat Mesh. We need to convert the LinePoints from the original Mesh coordinates into the flat Mesh coordinates.
- Utilize the intersection of the Mesh with the vertical lines as the LineSeed points. Current implementing a line walk with small increments. May be able to utilize the following approach: https://stackoverflow.com/questions/3838329/how-can-i-check-if-two-segments-intersect
Drawing Vertical lines on Flatten Image
Can now transfer the LineSeeds to the Flatten Image and Draw the Vertical lines. Although the lines are relatively well distributed throughout the Flattened Mesh, the Generated Mesh has regions that are not covered.
How do we improve coverage?
- We could generate the LineSeeds in such a way that every triangle has at least one line through it? Could be an expensive process. Could also result in overly dense. May result in an optimization problem.
How many regions do not generate trifinder?
Running diagnostics to determine the number of regions that fail trifinder generation.
Was able to generate some diagnostics to determine how many regions can successfully produce a trifinder. Total regions: 45 Regions with successful trifinder: 37 About 82% can generate trifinder.
Creating Dual of Triangulation:
- Generate red dot.
- Produce vertical line based on red dot.
- Determine which edge the vertical line intersects.
- Place LineSeed where the vertical line intersects with the edge.
- Based on the intersecting edge, determine the next triangle the vertical line will intersect.
- Go back to step 3 until we are outside the trifinder.
Generating the Dual of Triangulation
We want to create a TriangulationDualGraph. The triangles represent the nodes while the edges represent the connections between the nodes. Adding metadata for other uses, such as determining the outer vertices, outer triangles, and outer edges.
- We have all the pieces: vertex points, triangles, neighbours, and edges. We generated the points to form the Mesh. The Neighbours, Triangles, and Edges are produced by the matplotlib.tri.Triangulation.
Created Dual Graph
We now have the DualGraph created. How do we test it?
- Determine all the exterior triangles and then highlight all exterior triangles.
- Draw vertical straight line and produce dots at all the edge intersections.
- Pick a random triangle and highlight red. Highlight the neighbours green.
Can pick a random triangle to highlight. Also highlight the neighbour triangles.
In the image below, we see that a selected triangle has a white border. The neighbours of the of the selected triangle are highlighted in magenta. There are also highlighted red triangles which are used to validate mesh orientation.
DualGraph working
We can now do the following:
- Generate list of exterior points.
- Generate list of exterior edges.
- Determine the triangles that are connected to a point.
- Determine the edges that are connected to a point.
As a demonstration of the first two pieces of functionality, we are able to mark the exterior points with a blue stars and exterior edges are marked with thick magenta lines.
We can display similar information on the respective flattened meshes.