private void findPath(int from, int to, List <VectorLine> lines, List <VectorPath> vp)
            {
                VectorPath tp     = new VectorPath();
                List <int> startl = new List <int>();

                tp.addPoint(lines[from].A);
                startl.Add(from);
                tracePath(from, to, lines, vp, tp, startl);
            }
 private void fallback()
 {
     if (_A == _B)
     {
         return;           // This is no line
     }
     pointlist = new VectorPath();
     pointlist.addPoint(_A);
     if (_Adir.nonZero)
     {
         pointlist.addPoint(_A + _Adir * _stdgapA);
     }
     if (_Bdir.nonZero)
     {
         pointlist.addPoint(_B + _Bdir * _stdgapB);
     }
     pointlist.addPoint(_B);
     valid = true;
 }
            private void tracePath(int from, int to, List <VectorLine> lines, List <VectorPath> vp, VectorPath start, List <int> startl)
            {
                if (from == to)
                {
                    // On the final line
                    VectorPath ep = new VectorPath(start);
                    ep.addPoint(lines[to].B);
                    vp.Add(ep);
                    return;
                }

                // Check for intersections
                for (int i = 0; i < lines.Count; i++)
                {
                    if ((i != from) && (startl.IndexOf(i) < 0))
                    {
                        Vector ip = Vector.Zero;
                        if (VectorLine.intersect(lines[from], lines[i], ref ip))
                        {
                            // Lines intersect!
                            bool isavalidline = true;
                            if (isavalidline && (startl.Count > 1) && _VA.nonZero && _VA.inside(ip))
                            {
                                isavalidline = false;
                            }
                            if (isavalidline && _VB.nonZero && _VB.inside(ip))
                            {
                                isavalidline = false;
                            }
                            VectorLine nl = new VectorLine(start.list.Last(), ip, VectorLine.LineType.AB);
                            if (isavalidline && (startl.Count > 1) && _VA.nonZero && _VA.Intersects(nl))
                            {
                                isavalidline = false;
                            }
                            if (isavalidline && _VB.nonZero && _VB.Intersects(nl))
                            {
                                isavalidline = false;
                            }
                            if (isavalidline)
                            {
                                VectorPath ep      = new VectorPath(start);
                                List <int> startlx = new List <int>(startl);
                                startlx.Add(i);
                                ep.addPoint(ip);
                                tracePath(i, to, lines, vp, ep, startlx);
                            }
                        }
                    }
                }
            }