|
|
@ -1,3 +1,4 @@ |
|
|
|
|
|
|
|
using System.Collections.Frozen; |
|
|
|
using System.Collections.ObjectModel; |
|
|
|
using System.Collections.ObjectModel; |
|
|
|
using System.IO; |
|
|
|
using System.IO; |
|
|
|
using System.Windows; |
|
|
|
using System.Windows; |
|
|
@ -81,6 +82,43 @@ public class ViewportHelperPro |
|
|
|
Material = material, |
|
|
|
Material = material, |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
|
|
/// 通过三角形实体集合生成面模型(只生成不添加) |
|
|
|
|
|
|
|
/// </summary> |
|
|
|
|
|
|
|
/// <param name="entities"></param> |
|
|
|
|
|
|
|
/// <param name="color"></param> |
|
|
|
|
|
|
|
/// <returns></returns> |
|
|
|
|
|
|
|
public static List<MeshGeometryModel3D> GenerateModelByEntityGroupByType(List<Viewport3DTriangleEntity> entities) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var groupedDict = entities |
|
|
|
|
|
|
|
.GroupBy(e => e.PlaneType) |
|
|
|
|
|
|
|
.ToDictionary(g => g.Key, g => g.ToList()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var result = new List<MeshGeometryModel3D>(); |
|
|
|
|
|
|
|
foreach (var group in groupedDict) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var key = group.Key; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static Color4? GenFaceColor4(PlaneType planeType) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
switch (planeType) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
case PlaneType.Girdle: |
|
|
|
|
|
|
|
return ViewportManager.LightGray; |
|
|
|
|
|
|
|
case PlaneType.Crown : |
|
|
|
|
|
|
|
return new Color4(1, 1, 1, 1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// 保存模型截图 |
|
|
|
/// 保存模型截图 |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
|