When implementing this for my POV export in LDView, I went with infinitely long representations of all edge lines, and checked if triangle edges lined up with those. Assuming a match is found, you can then see if the triangle edge is within any of the segments that correspond to the infinitely long line. (I think I actually skipped this second step, but doing so is probably bad.)
Note: LDView's realtime 3D view uses conditional lines to indicate "smooth", and does its smoothing based on that. LDView's POV export does what you propose (which is probably better).
Note: LDView's realtime 3D view uses conditional lines to indicate "smooth", and does its smoothing based on that. LDView's POV export does what you propose (which is probably better).