Exemple #1
0
        List <Point> GetPathAngle(IConnectionPoint startConnection, IConnectionPoint endConnection)
        {
            //var _startConnection = (IConnectionPoint)StartPoint;
            //var _endConnection = (IConnectionPoint)EndPoint;

            // displacement vector between the primary and secondary vertex
            Vector displacementVector = Vector.Subtract((Vector)startConnection.Position, (Vector)endConnection.Position);
            //displacementVector.Normalize();
            var startLine = (Line)converter.Convert(new object[] { displacementVector, startConnection.Position }, null, null, null);
            var endLine   = (Line)converter.Convert(new object[] { -displacementVector, endConnection.Position }, null, null, null);

            return(PathCalculator.FindPath(
                       (Line)converter.Convert(new object[] { startConnection.Side.ToVector(), startConnection.Position }, null, null, null),
                       (Line)converter.Convert(new object[] { endConnection.Side.ToVector(), endConnection.Position }, null, null, null),
                       PathLine)
                   .Select(p => p.ToPoint()).ToList());
        }
Exemple #2
0
 List <Point> GetPath(IConnectionPoint startConnection, IConnectionPoint endConnection) =>
 PathCalculator.FindPath(
     (Line)converter.Convert(new object[] { startConnection.Side.ToVector(), startConnection.Position }, null, null, null),
     (Line)converter.Convert(new object[] { endConnection.Side.ToVector(), endConnection.Position }, null, null, null),
     PathLine, Angle)
 .Select(p => p.ToPoint()).ToList();