示例#1
0
        public static Path3D ToPath3D(string text) //The user uses the ReadPath result to create Point3D objects and with them, create Path3D obj
        {
            Path3D path = new Path3D();
            Regex  rgx  = new Regex(@"Point \[X:(.*?),\sY:(.*?),\sZ:(.*?)]");

            foreach (Match m in Regex.Matches(text, @"Point \[X:(.*?),\sY:(.*?),\sZ:(.*?)]"))
            {
                path.addPoint(new Point3D(Double.Parse(m.Groups[1].Value), Double.Parse(m.Groups[2].Value), Double.Parse(m.Groups[3].Value)));
            }

            return(path);
        }