Пример #1
0
        internal static List <Profile> ToProfiles(this PolyNode node, double tolerance = Vector3.EPSILON)
        {
            var joinedProfiles = new List <Profile>();

            if (node.Contour != null && !node.IsHole) // the outermost PolyTree will have a null contour, and skip this.
            {
                var profile = node.ToProfile(tolerance);
                joinedProfiles.Add(profile);
            }
            foreach (var result in node.Childs)
            {
                var profiles = result.ToProfiles(tolerance);
                joinedProfiles.AddRange(profiles.Where(p => p != null));
            }
            return(joinedProfiles);
        }