A long long time a go I used to make #VectorWorks CAD plug-ins in #Pascal variant called #VectorScript...
In this other life I had, I used to write #Pascal (a.k.a. #VectorScript) plug-ins for a CAD tool called #Vectorworks...
This clumsy line intersection function was part of a tool to draw annotations in architectural drawings of embakment slopes or earthmoving ramps.