Multipatch转Geometry转PointCollection转TriangleFan

众所周知,Multipatch是ArcGIS独创的数据结构,叫“面片”。可以根据点集按照一定的顺序连成。那么反过来我们也可以根据面片生成点集。

                IGeometryCollection GeoCollection = new MultiPatchClass();
                IPointCollection TriStripPoints = new TriangleStripClass();
                object Missing = Type.Missing;

                for (int i = 0; i < division; i++)
                {
                    VectorCross.Rotate(Angle, VectorPipe);//旋转底面上的向量
                    IPoint PntA = ConstructPnt3D(FromPnt.X + VectorCross.XComponent, FromPnt.Y + VectorCross.YComponent, FromPnt.Z + VectorCross.ZComponent, sr);
                    IPoint PntB = ConstructPnt3D(ToPnt.X + VectorCross.XComponent, ToPnt.Y + VectorCross.YComponent, ToPnt.Z + VectorCross.ZComponent, sr);
                    TriStripPoints.AddPoint(PntA, ref Missing, ref Missing);
                    TriStripPoints.AddPoint(PntB, ref Missing, ref Missing);
                    //MessageBox.Show(PntA.X + "," + PntA.Y + "," + PntA.Z + ";" + PntB.X + "," + PntB.Y + "," + PntB.Z);
                }
                TriStripPoints.AddPoint(TriStripPoints.get_Point(0), ref Missing, ref Missing);
                TriStripPoints.AddPoint(TriStripPoints.get_Point(1), ref Missing, ref Missing);
                GeoCollection.AddGeometry(TriStripPoints as IGeometry, ref Missing, ref Missing);
                IGeometry GeoPipe3D = GeoCollection as IGeometry;
                GeoPipe3D.SpatialReference = sr;
                return GeoPipe3D;

巷道+管道-ArcScene

原文地址:https://www.cnblogs.com/2008nmj/p/14341121.html