Example #1
0
            public bool IsParallelTo(double tol, Plane3D plane)
            {
                var from_ = this.From.ToUCS(plane.CS);
                var to_   = this.To.ToUCS(plane.CS);

                return(from_.Z.EqualsTol(tol, to_.Z));
            }
Example #2
0
            /// <summary>
            /// returns null if this line is parallel to the plane,
            /// the intersection point otherwise
            /// </summary>
            public Vector3D Intersect(double tol, Plane3D plane)
            {
                if (IsParallelTo(tol, plane))
                {
                    return(null);
                }

                // O = plane.Origin    Vx = plane.CS.BaseX    Vy = plane.CS.BaseY
                //
                // plane : O + alpha * Vx + beta * Vy
                // line  : From + gamma * V
                //
                // => m:{ alpha * Vx + beta * Vy - gamma * V } * s = n:{ From - O }

                var m = Matrix3D.FromVectorsAsColumns(plane.CS.BaseX, plane.CS.BaseY, -V);
                var n = From - plane.CS.Origin;
                var s = m.Solve(n);

                return(From + s.Z * V);
            }
Example #3
0
 /// <summary>
 /// return intersection line between two planes or null if they parallels
 /// </summary>
 /// <param name="tol_len">len tolerance</param>
 /// <param name="other">other plane</param>
 public Line3D Intersect(double tol_len, Plane3D other) => CS.Intersect(tol_len, other.CS);
Example #4
0
 /// <summary>
 /// returns null if this line is parallel to the plane,
 /// the intersection point otherwise
 /// </summary>
 public Vector3D Intersect(double tol, Plane3D plane) => Intersect(tol, plane.CS);
Example #5
0
 public bool IsParallelTo(double tol, Plane3D plane) => IsParallelTo(tol, plane.CS);