public ICartGridData Unroll(double scaling, double unrollRadius) { try { ICartGridData stripList = new CartGridData(); int i = 0; double dTh = 0; if (Count > 1) { var strip0 = this[0]; var strip1 = this[1]; dTh = strip1[0].ThetaRad - strip0[0].ThetaRad; } foreach (ICylData cylstrip in this) { cylstrip.RotateAbtZ(-1 * i * dTh); stripList.Add(cylstrip.Unroll(scaling, unrollRadius)); i++; } return(stripList); } catch (Exception) { throw; } }
public static BoundingBox GetBB(CartGridData data) { try { double maxX = double.MinValue; double minX = double.MaxValue; double maxY = double.MinValue; double minY = double.MaxValue; double maxZ = double.MinValue; double minZ = double.MaxValue; foreach (var strip in data) { foreach (var pt in strip) { double x = pt.X; if (x > maxX) { maxX = x; } if (x < minX) { minX = x; } double y = pt.Y; if (y > maxY) { maxY = y; } if (y < minY) { minY = y; } if (pt.Z > maxZ) { maxZ = pt.Z; } if (pt.Z < minZ) { minZ = pt.Z; } } } var bb = new BoundingBox(minX, minY, minZ, maxX, maxY, maxZ); return(bb); } catch (Exception) { throw; } }
/// <summary> /// unroll cylinder into grid /// </summary> /// <param name="correctedRingList"></param> /// <param name="scaling"></param> /// <param name="unrollRadius"></param> /// <returns></returns> static public CartGridData UnrollCylinder(CylGridData correctedRingList, double scaling, double unrollRadius) { try { var stripList = new CartGridData(); foreach (var cylstrip in correctedRingList) { stripList.Add(UnrollCylinderRing(cylstrip, scaling, unrollRadius)); } return(stripList); } catch (Exception) { throw; } }
/// <summary> /// convert cylinder grid to cartesian grid /// </summary> /// <param name="correctedRingList"></param> /// <returns></returns> public CartGridData AsCartGridData() { try { var stripList = new CartGridData(); foreach (var cylstrip in this) { var strip = new CartData(cylstrip.FileName); foreach (var ptCyl in cylstrip) { strip.Add(new Vector3(ptCyl)); } stripList.Add(strip); } return(stripList); } catch (Exception) { throw; } }
public CartGridDataEnumerator(CartGridData collection) { _collection = collection; curIndex = -1; currentItem = default; }