Пример #1
0
        static public IList <XYZ> FlattenIntoPoints(this CurveLoop curveLoop, double height = 0, double tolerance = 0.0328)
        {
            IList <XYZ> points = new List <XYZ>();

            foreach (Curve curve in curveLoop)
            {
                XYZ point0 = curve.GetEndPoint(0);
                XYZ point1 = curve.GetEndPoint(1);

                point0 = point0.Flatten(height);
                point1 = point1.Flatten(height);

                if (points.Where(p => p.IsAlmostEqualTo(point0, tolerance)).FirstOrDefault() == null)
                {
                    points.Add(point0);
                }

                if (points.Where(p => p.IsAlmostEqualTo(point1, tolerance)).FirstOrDefault() == null)
                {
                    points.Add(point1);
                }
            }

            return(points);
        }