public static Dictionary <LinearArrayDefine, List <SlicedPlane> > DoLinearSlice(Facet[] facets, LinearArrayDefine[] defines) { var results = new Dictionary <LinearArrayDefine, List <SlicedPlane> >(); foreach (var define in defines) { var result = new List <SlicedPlane>(); var factory = new LinearArrayCreater(); var planes = factory.CreateArrayPlane(define); foreach (var p in planes) { var planeInfo = p as LinearSlicePlaneInfo; var sp = new SlicedPlane(planeInfo); result.Add(sp); foreach (var f in facets) { var segs = GetPlaneCross(f, planeInfo.Plane); if (segs.Count > 0) { sp.Lines.AddRange(segs); } } } results.Add(define, result); } return(results); }
public static Dictionary <float, List <SlicedPlane> > DoLinearSlice(Facet[] facets, LinearArrayDefine define) { var result = new List <SlicedPlane>(); var factory = new LinearArrayCreater(); var planes = factory.CreateArrayPlane(define); foreach (var p in planes) { var planeInfo = p as LinearSlicePlaneInfo; var sp = new SlicedPlane(planeInfo); result.Add(sp); foreach (var f in facets) { var segs = GetPlaneCross(f, planeInfo.Plane); if (segs.Count > 0) { sp.Lines.AddRange(segs); } } } return(result.OrderBy(m => m.D).GroupBy(m => m.D).ToDictionary(m => m.Key, n => n.ToList())); }