StandardUtil.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*-------------------------------------------------------------------------
  2. * 功能描述:StandardUtil
  3. * 作者:xulisong
  4. * 创建时间: 2019/6/27 11:25:35
  5. * 版本号:v1.0
  6. * -------------------------------------------------------------------------*/
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. using JBIM.Definition;
  13. using SAGA.DotNetUtils.Extend;
  14. namespace RevitToJBim.Common
  15. {
  16. /// <summary>
  17. /// 标准整理工具
  18. /// </summary>
  19. public static class StandardUtil
  20. {
  21. public static void ArrangeLoop(Polygon polygon)
  22. {
  23. if (polygon.Count>=2)
  24. {
  25. var firstPoint = polygon[0];
  26. var lastPoint = polygon[polygon.Count - 1];
  27. if (!firstPoint.X.IsEqual(lastPoint.X) || !firstPoint.Y.IsEqual(lastPoint.Y) ||
  28. !firstPoint.Z.IsEqual(lastPoint.Z))
  29. {
  30. polygon.Add(firstPoint);
  31. }
  32. }
  33. }
  34. }
  35. }