calculating the intersection between an egde and a plane

Hello

Does anyone have a clue how to calculate where an edge pierce a body and then putting a vertex there to make a polyline?

The vertex can probably be created in the intersection with this script:
https://blenderartists.org/forum/viewtopic.php?t=35223&start=0&postdays=0&postorder=asc&highlight=project%20plane

But then I must know exactly wich face the edge is piercing…

http://blender.isoserv.com/uploads/screen2.jpg
http://blender.isoserv.com/uploads/test_screw_and_cyl.blend


Part of figuring out how to make these things:
http://www.rainnea.com/cnc_toolkit.htm