Example #1
0
        public Line ProjectParallelOn(Plane plane, Vector3d viewDirection)
        {
            if (viewDirection.IsOrthogonalTo(plane.NormalVector))
            {
                throw new ArgumentException("Projection error: view direction is parallel to projection plane!");
            }
            if (viewDirection.IsParallelTo(this.vector3d_0))
            {
                throw new ArgumentException("Projection error: view direction and line are collinear!");
            }
            Point point  = this.point_0.ProjectParallelOn(plane, viewDirection);
            Point point2 = (this.point_0 + this.vector3d_0.ToPoint()).ProjectParallelOn(plane, viewDirection);
            Line  line   = new Line(point, point2);

            line.DirectionVector = line.DirectionVector.Normalize();
            return(line);
        }