CurveLoopExtension.cs 895 B

12345678910111213141516171819202122232425262728293031323334
  1. /*-------------------------------------------------------------------------
  2. * 功能描述:CurveLoopExtension
  3. * 作者:xulisong
  4. * 创建时间: 2019/6/26 17:53:33
  5. * 版本号:v1.0
  6. * -------------------------------------------------------------------------*/
  7. using Autodesk.Revit.DB;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. namespace RevitToJBim.Extension
  14. {
  15. public static class CurveLoopExtension
  16. {
  17. public static List<XYZ> GetPolygon(this CurveLoop curveLoop)
  18. {
  19. List<XYZ> polygon = new List<XYZ>();
  20. foreach (Curve curve in curveLoop)
  21. {
  22. var points = curve.Tessellate();
  23. points.RemoveAt(points.Count - 1);
  24. polygon.AddRange(points);
  25. }
  26. return polygon;
  27. }
  28. }
  29. }