private void MidPlaneProcess() { for (int k = this.polyList.Count - 2; k >= 0; k--) { // last plane corners MyPolygon p_last = this.polyList[k + 1]; List <MyVector3> corners_last = p_last.CornerPoints3d; // this plane info MyPolygon p_now = this.polyList[k]; double offset = p_now.BelongPlane.planeEquation.Offset; double z = p_now.BelongPlane.planeEquation.C; MyVector3 p_in_plane = new MyVector3(0.0, 0.0, -offset / z); foreach (MyVector3 c_last in corners_last) { double bias = (c_last - p_in_plane).Dot(p_now.Normal); MyVector3 c_now = c_last - p_now.Normal * bias; p_now.AddCornerPoint(c_now); } // local optimization p_now.LocalOptimizing(); p_now.ResetCenter(); p_now.BuildLocalFrame(); p_now.ProjCenterTo2d(); p_now.ProjSliceTo2d(); p_now.ProjCornerTo2d(); } }
public void AddNeighbor(MyPolygon r) { neighbors.Add(r); }
public void AddPolygon(MyPolygon poly) { polyList.Add(poly); }
public MyGCuboid(MyPolygon poly) { polyList.Add(poly); }