private List <LINE> TakeOffColumnEdge(Dictionary <string, List <LINE> > columns, List <LINE> floor) { foreach (KeyValuePair <string, List <LINE> > column in columns) { List <LINE> newFloor = new List <LINE>(); Dictionary <int, List <LINE> > tmpData = new Dictionary <int, List <LINE> >(); for (int ii = 0; ii < column.Value.Count; ii++) { LINE columnEdge = column.Value[ii]; for (int jj = 0; jj < floor.Count; jj++) { LINE floorEdge = floor[jj]; if (Math.Round(floorEdge.GetSlope(), 3) == Math.Round(columnEdge.GetSlope(), 3)) { continue; } if (Math.Abs(Math.Round(floorEdge.GetDirection().X, 3)) == Math.Abs(Math.Round(columnEdge.GetDirection().X, 3)) && Math.Abs(Math.Round(floorEdge.GetDirection().Y, 3)) == Math.Abs(Math.Round(columnEdge.GetDirection().Y, 3))) { continue; } XYZ crossPoint = floorEdge.GetCrossPoint(columnEdge); try { if (floorEdge.IsPointInLine(crossPoint) && columnEdge.IsPointInLine(crossPoint)) { XYZ innerPoint = IsInner(columnEdge.GetStartPoint(), floor) ? columnEdge.GetStartPoint() : columnEdge.GetEndPoint(); double dis1 = (crossPoint - floorEdge.GetStartPoint()).GetLength(); double dis2 = (crossPoint - floorEdge.GetEndPoint()).GetLength(); LINE newLine = null; List <LINE> newList = new List <LINE>(); if (dis1 > dis2) { floorEdge.ResetParameters(crossPoint, "EndPoint"); newLine = new LINE(crossPoint, innerPoint); newList.Add(floorEdge); if (dis2 != 0) { newList.Add(newLine); } } else { newLine = new LINE(innerPoint, crossPoint); floorEdge.ResetParameters(crossPoint, "StartPoint"); if (dis1 != 0) { newList.Add(newLine); } newList.Add(floorEdge); } tmpData[jj] = newList; } } catch (Exception) { } } } for (int kk = 0; kk < floor.Count; kk++) { if (tmpData.ContainsKey(kk)) { foreach (LINE item in tmpData[kk]) { newFloor.Add(item); } } else { newFloor.Add(floor[kk]); } } floor = new List <LINE>(); floor = newFloor; } return(floor); }