Skyline(c#)怎么显示三维管线

        /// 
        /// 创建管线(不考虑高程)
        /// 
        /// 起点经度
        /// 起点纬度
        /// 起点高程
        /// 终点经度
        /// 终点纬度
        /// 终点高程
        /// 管线材质
        /// 管半径
        /// 
        private void CreatPipe(double x1, double y1, double z1, double x2, double y2, double z2, string pipeCaiZhi, double pipeGuanJing )
        {
            try
            {
                //获取两点间距离
                double pipeLength = SkyLineView.SgWorld.CoordServices.GetDistance(x1, y1, x2, y2);
                //圆柱面数 越大越圆滑但渲染的也就越慢
                int numOfSegments = 20;
                IPosition66 origionPosition = SkyLineView.SgWorld.Creator.CreatePosition(x1, y1, 10);
                IPosition66 tagerPosition = SkyLineView.SgWorld.Creator.CreatePosition(x2, y2, 10);
                IPosition66 pipePosition = SkyLineView.SgWorld.CoordServices.GetAimingAngles(origionPosition, tagerPosition);
                var thisPipe = SkyLineView.SgWorld.Creator.CreateCylinder(origionPosition, pipeGuanJing, pipeLength, NumOfSegments: numOfSegments, LineColor: 33023);
                //因为线是水平的必须旋转90°
                thisPipe.Position.Pitch = 90 - pipePosition.Pitch;
                thisPipe.Position.Yaw = pipePosition.Yaw;
                thisPipe.Position.Roll = pipePosition.Roll;
            }
            catch (Exception CC)
            {

            }
           
        }

你可能感兴趣的:(GIS)