What I'm trying to do:
I'm trying to create a path-drawing function which will produce a path like the one I-P in the diagram below. The way this path was generated requires me to swap between the left adjacent triangle and the right adjacent triangle. For example, in the diagram below:
- Start at the midpoint, I, of edge GH.
- Choose Right -> move to midpoint, J, of edge along the right adjacent triangle, EH.
- From new point, J, alternate to Left Choice -> find midpoint, K, of edge along the left adjacent triangle.
- Repeat, alternating between left and right adjacent triangle edges.
Where I'm Stuck:
I'm having trouble finding an efficient/intuitive way for Mathematica to know which edge is the left edge vs which edge is the right edge. I'd like to be able to do this for an arbitrary triangulation mesh, but I can't think of a simple method for Mathematica to recognize left v.s. right edges.
Also, the path is slightly easier to describe when considering, instead, that we're choosing between edges of inscribed triangles at the midpoints of the mesh. .
- Start at I
- Right-> Choose edge IJ (not IQ), and move to J.
- From J, Left-> Choose edge JK (not JR), move to K.
- From K, Right-> Choose KL, move to L
- Continue, alternating between left and right.
Any ideas on how I can have Mathematica distinguish between the left and right edges/triangles?
Possible Solution: If I could somehow enumerate each edge around a given vertex starting from the incoming edge (#0), then the edge I'm looking for will always be #3. Is this an efficient way to approach this?
Example for Vertex J (Counter-Clockwise Enumeration):
JI=0 JH=1 JR=2 JK=3** JE=4 JQ=5