public static Plane ParsePlane(string s) { var match = Regex.Match(s, PlanePointVectorPattern); if (match.Success) { var p = Point3D.Parse(match.Groups["p"].Value); var uv = UnitVector3D.Parse(match.Groups["v"].Value); return(new Plane(p, uv)); } match = Regex.Match(s, PlaneAbcdPattern); { var a = ParseDouble(match.Groups["a"]); var b = ParseDouble(match.Groups["b"]); var c = ParseDouble(match.Groups["c"]); var d = ParseDouble(match.Groups["d"]); return(new Plane(a, b, c, d)); } }
/// <summary> /// Parses string representation of throughpoint and direction /// This is mainly meant for tests /// </summary> /// <param name="point"></param> /// <param name="direction"></param> /// <returns></returns> public static Ray3D Parse(string point, string direction) { return(new Ray3D(Point3D.Parse(point), UnitVector3D.Parse(direction))); }