//得到箭头 public static IGeometry GetArrow() { const double ConeBaseDegrees = 360.0; const int ConeBaseDivisions = 36; const double VectorComponentOffset = 0.0000001; const double ConeBaseZ = 0.0; double ConeApexZ = 0; double ConeBaseRadius = 0; ConeBaseRadius = 20; //范围 //正常 ConeApexZ = 100; //尖度 //Vector3D: Cone, TriangleFan With 36 Vertices IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection triangleFanPointCollection = new TriangleFanClass(); //Set Cone Apex To (0, 0, ConeApexZ) IPoint coneApexPoint = GeometryUtilities.ConstructPoint3D(0, 0, ConeApexZ); //Add Cone Apex To Triangle Fan triangleFanPointCollection.AddPoint(coneApexPoint, ref _missing, ref _missing); //Define Upper Portion Of Axis Around Which Vector Should Be Rotated To Generate Cone Base Vertices IVector3D upperAxisVector3D = GeometryUtilities.ConstructVector3D(0, 0, 10); //Define Lower Portion of Axis Around Which Vector Should Be Rotated To Generate Cone Base Vertices IVector3D lowerAxisVector3D = GeometryUtilities.ConstructVector3D(0, 0, -10); //Add A Slight Offset To X or Y Component Of One Of Axis Vectors So Cross Product Does Not Return A Zero-Length Vector lowerAxisVector3D.XComponent += VectorComponentOffset; //Obtain Cross Product Of Upper And Lower Axis Vectors To Obtain Normal Vector To Axis Of Rotation To Generate Cone Base Vertices IVector3D normalVector3D = upperAxisVector3D.CrossProduct(lowerAxisVector3D) as IVector3D; //Set Normal Vector Magnitude Equal To Radius Of Cone Base normalVector3D.Magnitude = ConeBaseRadius; //Obtain Angle Of Rotation In Radians As Function Of Number Of Divisions Within 360 Degree Sweep Of Cone Base double rotationAngleInRadians = GeometryUtilities.GetRadians(ConeBaseDegrees / ConeBaseDivisions); for (int i = 0; i < ConeBaseDivisions; i++) { //Rotate Normal Vector Specified Rotation Angle In Radians Around Either Upper Or Lower Axis normalVector3D.Rotate(-1 * rotationAngleInRadians, upperAxisVector3D); //Construct Cone Base Vertex Whose XY Coordinates Are The Sum Of Apex XY Coordinates And Normal Vector XY Components IPoint vertexPoint = GeometryUtilities.ConstructPoint3D(coneApexPoint.X + normalVector3D.XComponent, coneApexPoint.Y + normalVector3D.YComponent, ConeBaseZ); //Add Vertex To TriangleFan triangleFanPointCollection.AddPoint(vertexPoint, ref _missing, ref _missing); } //Re-Add The Second Point Of The Triangle Fan (First Vertex Added) To Close The Fan triangleFanPointCollection.AddPoint(triangleFanPointCollection.get_Point(1), ref _missing, ref _missing); //Add TriangleFan To MultiPatch multiPatchGeometryCollection.AddGeometry(triangleFanPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }