Example #1
0
        /// <summary>
        /// 用polygon2d收集点集是为了,删除异常点(单根线端点,共线点)
        /// </summary>
        public static Polygon2d ToPolygon2d(this Path path)
        {
            Polygon2d polygon2d = new Polygon2d(path.ToVector2ds());

            polygon2d = polygon2d.DelDuplicate();
            return(polygon2d.RemoveSharpCcorners());
        }
Example #2
0
        public static CurveLoop ToCurveLoop(this Polygon2d _polygon2d)
        {
            _polygon2d = _polygon2d.DelDuplicate();
            List <Line> lines = new List <Line>();

            foreach (var seg in _polygon2d.SegmentItr())
            {
                lines.Add(seg.ToLine());
            }
            CurveLoop curves = new CurveLoop();

            foreach (Line line in lines)
            {
                Curve _c = line as Curve;
                curves.Append(_c);
            }
            return(curves);
        }