/*-------------------------------------------------------------------------
 * 功能描述：CurveLoopExtension
 * 作者：xulisong
 * 创建时间： 2019/6/26 17:53:33
 * 版本号：v1.0
 *  -------------------------------------------------------------------------*/

using Autodesk.Revit.DB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RevitToJBim.Extension
{
    public static class CurveLoopExtension
    {
        public static List<XYZ> GetPolygon(this CurveLoop curveLoop)
        {
            List<XYZ> polygon = new List<XYZ>();


            foreach (Curve curve in curveLoop)
            {
                var points = curve.Tessellate();
                points.RemoveAt(points.Count - 1);
                polygon.AddRange(points);
            }

            return polygon;
        }
    }
}
