public static ConstructPoint3D ( double x, double y, double z ) : IPoint | ||
x | double | |
y | double | |
z | double | |
Результат | IPoint |
public static IGeometry GetExample4() { //Ring: Maze Lying On XY Plane IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection ringPointCollection = new RingClass(); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-10, 10, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 10, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, -10, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-10, -10, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-10, 6, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(6, 6, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(6, -6, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-6, -6, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-6, 2, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-6, 2, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 2, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-4, 0, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-4, -4, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(4, -4, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(4, 4, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-8, 4, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-8, -8, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(8, -8, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(8, 8, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-10, 8, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-10, 10, 0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(ringPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample2() { //TriangleStrip: Multi-Paneled Vertical Plane IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection triangleStripPointCollection = new TriangleStripClass(); //Panel 1 triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 7.5, 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 7.5, 7.5), ref _missing, ref _missing); //Panel 2 triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-2.5, 2.5, 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-2.5, 2.5, 7.5), ref _missing, ref _missing); //Panel 3 triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, -2.5, 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, -2.5, 7.5), ref _missing, ref _missing); //Panel 4 triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, 7.5), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(triangleStripPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample3() { //Triangles: Three Upright Triangles IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection trianglesPointCollection = new TrianglesClass(); //Triangle 1 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 2.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 2.5, 7.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 2.5, 7.5), ref _missing, ref _missing); //Triangle 2 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 2.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 2.5, 7.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-2.5, 2.5, 7.5), ref _missing, ref _missing); //Triangle 3 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-2.5, -2.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-2.5, -2.5, 7.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, -2.5, 7.5), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(trianglesPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample5() { //TriangleStrip: Star Shaped Box Without Top or Bottom IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection triangleStripPointCollection = new TriangleStripClass(); //Start triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 2, 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 2, 5), ref _missing, ref _missing); //First Panel triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1 * Math.Sqrt(10), Math.Sqrt(10), 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1 * Math.Sqrt(10), Math.Sqrt(10), 5), ref _missing, ref _missing); //Second Panel triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-2, 0, 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-2, 0, 5), ref _missing, ref _missing); //Third Panel triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1 * Math.Sqrt(10), -1 * Math.Sqrt(10), 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1 * Math.Sqrt(10), -1 * Math.Sqrt(10), 5), ref _missing, ref _missing); //Fourth Panel triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -2, 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -2, 5), ref _missing, ref _missing); //Fifth Panel triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(Math.Sqrt(10), -1 * Math.Sqrt(10), 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(Math.Sqrt(10), -1 * Math.Sqrt(10), 5), ref _missing, ref _missing); //Sixth Panel triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2, 0, 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2, 0, 5), ref _missing, ref _missing); //Seventh Panel triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(Math.Sqrt(10), Math.Sqrt(10), 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(Math.Sqrt(10), Math.Sqrt(10), 5), ref _missing, ref _missing); //End, To Close Box triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 2, 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 2, 5), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(triangleStripPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample5() { const int XRange = 16; const int YRange = 16; const int InteriorRingCount = 25; const double HoleRange = 0.5; //RingGroup: Square Lying In XY Plane With Single Exterior Ring And Multiple Interior Rings IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IMultiPatch multiPatch = multiPatchGeometryCollection as IMultiPatch; //Exterior Ring IPointCollection exteriorRingPointCollection = new RingClass(); exteriorRingPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0.5 * (XRange + 2), -0.5 * (YRange + 2), 0), ref _missing, ref _missing); exteriorRingPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-0.5 * (XRange + 2), -0.5 * (YRange + 2), 0), ref _missing, ref _missing); exteriorRingPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-0.5 * (XRange + 2), 0.5 * (YRange + 2), 0), ref _missing, ref _missing); exteriorRingPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0.5 * (XRange + 2), 0.5 * (YRange + 2), 0), ref _missing, ref _missing); IRing exteriorRing = exteriorRingPointCollection as IRing; exteriorRing.Close(); multiPatchGeometryCollection.AddGeometry(exteriorRing as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(exteriorRing, esriMultiPatchRingType.esriMultiPatchOuterRing); //Interior Rings Random random = new Random(); for (int i = 0; i < InteriorRingCount; i++) { double interiorRingOriginX = XRange * (random.NextDouble() - 0.5); double interiorRingOriginY = YRange * (random.NextDouble() - 0.5); IPointCollection interiorRingPointCollection = new RingClass(); interiorRingPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(interiorRingOriginX - 0.5 * HoleRange, interiorRingOriginY - 0.5 * HoleRange, 0), ref _missing, ref _missing); interiorRingPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(interiorRingOriginX + 0.5 * HoleRange, interiorRingOriginY - 0.5 * HoleRange, 0), ref _missing, ref _missing); interiorRingPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(interiorRingOriginX + 0.5 * HoleRange, interiorRingOriginY + 0.5 * HoleRange, 0), ref _missing, ref _missing); interiorRingPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(interiorRingOriginX - 0.5 * HoleRange, interiorRingOriginY + 0.5 * HoleRange, 0), ref _missing, ref _missing); IRing interiorRing = interiorRingPointCollection as IRing; interiorRing.Close(); multiPatchGeometryCollection.AddGeometry(interiorRing as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(interiorRing, esriMultiPatchRingType.esriMultiPatchInnerRing); } return(multiPatchGeometryCollection as IGeometry); }
public static void DrawAxes(IGraphicsContainer3D axesGraphicsContainer3D) { const esriSimple3DLineStyle AxisStyle = esriSimple3DLineStyle.esriS3DLSTube; const double AxisWidth = 0.25; DrawAxis(axesGraphicsContainer3D, GeometryUtilities.ConstructPoint3D(-10, 0, 0), GeometryUtilities.ConstructPoint3D(10, 0, 0), ColorUtilities.GetColor(255, 0, 0), AxisStyle, AxisWidth); DrawAxis(axesGraphicsContainer3D, GeometryUtilities.ConstructPoint3D(0, -10, 0), GeometryUtilities.ConstructPoint3D(0, 10, 0), ColorUtilities.GetColor(0, 0, 255), AxisStyle, AxisWidth); DrawAxis(axesGraphicsContainer3D, GeometryUtilities.ConstructPoint3D(0, 0, -10), GeometryUtilities.ConstructPoint3D(0, 0, 10), ColorUtilities.GetColor(0, 255, 0), AxisStyle, AxisWidth); DrawEnd(axesGraphicsContainer3D, GeometryUtilities.ConstructPoint3D(10, 0, 0), GeometryUtilities.ConstructVector3D(0, 10, 0), 90, ColorUtilities.GetColor(255, 0, 0), 0.2 * AxisWidth); DrawEnd(axesGraphicsContainer3D, GeometryUtilities.ConstructPoint3D(0, 10, 0), GeometryUtilities.ConstructVector3D(10, 0, 0), -90, ColorUtilities.GetColor(0, 0, 255), 0.2 * AxisWidth); DrawEnd(axesGraphicsContainer3D, GeometryUtilities.ConstructPoint3D(0, 0, 10), null, 0, ColorUtilities.GetColor(0, 255, 0), 0.2 * AxisWidth); }
public static IGeometry GetExample3() { //TriangleStrip: Stairs IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection triangleStripPointCollection = new TriangleStripClass(); //First Step triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 10, 10), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 10, 10), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, 10), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 7.5, 10), ref _missing, ref _missing); //Second Step triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, 7.5), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 7.5, 7.5), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 7.5), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 5, 7.5), ref _missing, ref _missing); //Third Step triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 5, 5), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 2.5, 5), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 2.5, 5), ref _missing, ref _missing); //Fourth Step triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 2.5, 2.5), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 2.5, 2.5), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 2.5), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 0, 2.5), ref _missing, ref _missing); //End triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 0, 0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(triangleStripPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample4() { //Triangles: Six Triangles Lying In Different Planes IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection trianglesPointCollection = new TrianglesClass(); //Triangle 1 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 5, 0), ref _missing, ref _missing); //Triangle 2 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 5, 0), ref _missing, ref _missing); //Triangle 3 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, -5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -7.5, 0), ref _missing, ref _missing); //Triangle 4 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, 2.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, 0), ref _missing, ref _missing); //Triangle 5 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, -7.5, 2.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, -7.5, 0), ref _missing, ref _missing); //Triangle 6 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, 2.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, -7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, 0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(trianglesPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample14() { const int PointCount = 100; const double ZMin = 0; const double ZMax = 4; //Extrusion: Square Shaped Base Geometry Extruded Between Single TIN-Based Functional Surface IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); //Base Geometry IEnvelope envelope = new EnvelopeClass(); envelope.XMin = -10; envelope.XMax = 10; envelope.YMin = -10; envelope.YMax = 10; IGeometry baseGeometry = envelope as IGeometry; //Upper Functional Surface ITinEdit tinEdit = new TinClass(); tinEdit.InitNew(envelope); Random random = new Random(); for (int i = 0; i < PointCount; i++) { double x = envelope.XMin + (envelope.XMax - envelope.XMin) * random.NextDouble(); double y = envelope.YMin + (envelope.YMax - envelope.YMin) * random.NextDouble(); double z = ZMin + (ZMax - ZMin) * random.NextDouble(); IPoint point = GeometryUtilities.ConstructPoint3D(x, y, z); tinEdit.AddPointZ(point, 0); } IFunctionalSurface functionalSurface = tinEdit as IFunctionalSurface; IConstructMultiPatch constructMultiPatch = new MultiPatchClass(); constructMultiPatch.ConstructExtrudeBetween(functionalSurface, functionalSurface, baseGeometry); return(constructMultiPatch as IGeometry); }
public static IGeometry GetExample1() { //Triangles: One Triangle Lying On XY Plane IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection trianglesPointCollection = new TrianglesClass(); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 2.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 2.5, 0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(trianglesPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample1() { //TriangleStrip: Square Lying On XY Plane IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection triangleStripPointCollection = new TriangleStripClass(); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-6, -6, 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-6, 6, 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(6, -6, 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(6, 6, 0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(triangleStripPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample4() { //TriangleFan: Triangle Based Pyramid IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection triangleFanPointCollection = new TriangleFanClass(); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 6), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3 * Math.Sqrt(3), -3, 0), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 6, 0), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3 * Math.Sqrt(3), -3, 0), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3 * Math.Sqrt(3), -3, 0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(triangleFanPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample1() { //Ring: Upright Rectangle IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection ringPointCollection = new RingClass(); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 0, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 0, 7.5), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 0, 7.5), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 0, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 0, 0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(ringPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample3() { //RingGroup: Upright Square With Hole IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IMultiPatch multiPatch = multiPatchGeometryCollection as IMultiPatch; //Exterior Ring 1 IPointCollection exteriorRing1PointCollection = new RingClass(); exteriorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, -5), ref _missing, ref _missing); exteriorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 0, -5), ref _missing, ref _missing); exteriorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 0, 5), ref _missing, ref _missing); exteriorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 5), ref _missing, ref _missing); IRing exteriorRing1 = exteriorRing1PointCollection as IRing; exteriorRing1.Close(); multiPatchGeometryCollection.AddGeometry(exteriorRing1 as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(exteriorRing1, esriMultiPatchRingType.esriMultiPatchOuterRing); //Interior Ring 1 IPointCollection interiorRing1PointCollection = new RingClass(); interiorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-4, 0, -4), ref _missing, ref _missing); interiorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(4, 0, -4), ref _missing, ref _missing); interiorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(4, 0, 4), ref _missing, ref _missing); interiorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-4, 0, 4), ref _missing, ref _missing); IRing interiorRing1 = interiorRing1PointCollection as IRing; interiorRing1.Close(); multiPatchGeometryCollection.AddGeometry(interiorRing1 as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(interiorRing1, esriMultiPatchRingType.esriMultiPatchInnerRing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample9() { const int DensificationDivisions = 20; const double MaxDeviation = 0.1; const double BaseZ = 0; const double OffsetZ = -7; //Extrusion: 3D Polyline Having Vertices With Varying Z Values, Extruded Relative To Existing // Vertex Z Values Via ConstructExtrude() IPointCollection polylinePointCollection = new PolylineClass(); polylinePointCollection.AddPoint(GeometryUtilities.ConstructPoint2D(-10, -10), ref _missing, ref _missing); polylinePointCollection.AddPoint(GeometryUtilities.ConstructPoint2D(0, -5), ref _missing, ref _missing); polylinePointCollection.AddPoint(GeometryUtilities.ConstructPoint2D(0, 5), ref _missing, ref _missing); polylinePointCollection.AddPoint(GeometryUtilities.ConstructPoint2D(10, 10), ref _missing, ref _missing); IPolyline polyline = polylinePointCollection as IPolyline; polyline.Densify(polyline.Length / DensificationDivisions, MaxDeviation); IGeometry polylineGeometry = polyline as IGeometry; GeometryUtilities.MakeZAware(polylineGeometry); Random random = new Random(); for (int i = 0; i < polylinePointCollection.PointCount; i++) { IPoint polylinePoint = polylinePointCollection.get_Point(i); polylinePointCollection.UpdatePoint(i, GeometryUtilities.ConstructPoint3D(polylinePoint.X, polylinePoint.Y, BaseZ - 2 * Math.Sin(random.NextDouble()))); } ITopologicalOperator topologicalOperator = polylineGeometry as ITopologicalOperator; topologicalOperator.Simplify(); IConstructMultiPatch constructMultiPatch = new MultiPatchClass(); constructMultiPatch.ConstructExtrude(OffsetZ, polylineGeometry); return(constructMultiPatch as IGeometry); }
public static IGeometry GetExample3() { //TriangleFan: Square Based Pyramid IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection triangleFanPointCollection = new TriangleFanClass(); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 7), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-6, -6, 0), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-6, 6, 0), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(6, 6, 0), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(6, -6, 0), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-6, -6, 0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(triangleFanPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample2() { //TriangleFan: Upright Square IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection triangleFanPointCollection = new TriangleFanClass(); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 0, -5), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 0, 5), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 5), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, -5), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 0, -5), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(triangleFanPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample2() { const double XScale = 2; const double YScale = 2; const double ZScale = 3; //Transform3D: Cylinder Scaled Via Scale3D() IGeometry geometry = Vector3DExamples.GetExample3(); //Define Origin At Which Scale Operation Should Be Performed IPoint originPoint = GeometryUtilities.ConstructPoint3D(0, 0, 0); ITransform3D transform3D = geometry as ITransform3D; transform3D.Scale3D(originPoint, XScale, YScale, ZScale); return(geometry); }
private static void DrawEnd(IGraphicsContainer3D endGraphicsContainer3D, IPoint endPoint, IVector3D axisOfRotationVector3D, double degreesOfRotation, IColor endColor, double endRadius) { IGeometry endGeometry = Vector3DExamples.GetExample2(); ITransform3D transform3D = endGeometry as ITransform3D; IPoint originPoint = GeometryUtilities.ConstructPoint3D(0, 0, 0); transform3D.Scale3D(originPoint, endRadius, endRadius, 2 * endRadius); if (degreesOfRotation != 0) { double angleOfRotationInRadians = GeometryUtilities.GetRadians(degreesOfRotation); transform3D.RotateVector3D(axisOfRotationVector3D, angleOfRotationInRadians); } transform3D.Move3D(endPoint.X - originPoint.X, endPoint.Y - originPoint.Y, endPoint.Z - originPoint.Z); GraphicsLayer3DUtilities.AddMultiPatchToGraphicsLayer3D(endGraphicsContainer3D, endGeometry, endColor); }
public static IGeometry GetExample6() { //TriangleFan: Partial Fan, Two Levels Of Zs IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection triangleFanPointCollection = new TriangleFanClass(); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 3), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -6, 3), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3 * Math.Sqrt(2), -3 * Math.Sqrt(2), 3), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-6, 0, 3), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3 * Math.Sqrt(2), 3 * Math.Sqrt(2), 0), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 6, 0), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3 * Math.Sqrt(2), 3 * Math.Sqrt(2), 0), ref _missing, ref _missing); triangleFanPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(6, 0, 0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(triangleFanPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample3() { //Ring: Octagon With Non-Coplanar Points IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection ringPointCollection = new RingClass(); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 7.5, 5), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 8.5, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 7.5, 5), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(8.5, 0, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, 5), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -8.5, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, -7.5, 5), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-8.5, 0, 0), ref _missing, ref _missing); ringPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 7.5, 5), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(ringPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample4() { //TriangleStrip: Box Without Top or Bottom IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection triangleStripPointCollection = new TriangleStripClass(); //Start triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 10), ref _missing, ref _missing); //First Panel triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 10), ref _missing, ref _missing); //Second Panel triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 10), ref _missing, ref _missing); //Third Panel triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 10), ref _missing, ref _missing); //End, To Close Box triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 10), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(triangleStripPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample4() { const double XScale = 0.5; const double YScale = 0.5; const double ZScale = 2; const double XOffset = -5; const double YOffset = -5; const double ZOffset = -8; const double DegreesOfRotation = 90; //Transform3D: Cylinder Scaled, Rotated, Repositioned Via Move3D(), Scale3D(), RotateVector3D() IGeometry geometry = Vector3DExamples.GetExample3(); ITransform3D transform3D = geometry as ITransform3D; //Stretch The Cylinder So It Looks Like A Tube IPoint originPoint = GeometryUtilities.ConstructPoint3D(0, 0, 0); transform3D.Scale3D(originPoint, XScale, YScale, ZScale); //Rotate The Cylinder So It Lies On Its Side IVector3D axisOfRotationVector3D = GeometryUtilities.ConstructVector3D(0, 10, 0); double angleOfRotationInRadians = GeometryUtilities.GetRadians(DegreesOfRotation); transform3D.RotateVector3D(axisOfRotationVector3D, angleOfRotationInRadians); //Reposition The Cylinder So It Is Located Underground transform3D.Move3D(XOffset, YOffset, ZOffset); return(geometry); }
public static IGeometry GetExample5() { const double CylinderBaseDegrees = 360.0; const int CylinderBaseDivisions = 8; const double VectorComponentOffset = 0.0000001; const double CylinderBaseRadius = 3; const double CylinderUpperZ = 8; const double CylinderLowerZ = 0; //Vector3D: Cylinder, TriangleStrip With 8 Vertices IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection triangleStripPointCollection = new TriangleStripClass(); //Set Cylinder Base Origin To (0, 0, 0) IPoint originPoint = GeometryUtilities.ConstructPoint3D(0, 0, 0); //Define Upper Portion Of Axis Around Which Vector Should Be Rotated To Generate Cylinder Base Vertices IVector3D upperAxisVector3D = GeometryUtilities.ConstructVector3D(0, 0, 10); //Define Lower Portion of Axis Around Which Vector Should Be Rotated To Generate Cylinder 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 Cylinder Base Vertices IVector3D normalVector3D = upperAxisVector3D.CrossProduct(lowerAxisVector3D) as IVector3D; //Set Normal Vector Magnitude Equal To Radius Of Cylinder Base normalVector3D.Magnitude = CylinderBaseRadius; //Obtain Angle Of Rotation In Radians As Function Of Number Of Divisions Within 360 Degree Sweep Of Cylinder Base double rotationAngleInRadians = GeometryUtilities.GetRadians(CylinderBaseDegrees / CylinderBaseDivisions); for (int i = 0; i < CylinderBaseDivisions; i++) { //Rotate Normal Vector Specified Rotation Angle In Radians Around Either Upper Or Lower Axis normalVector3D.Rotate(rotationAngleInRadians, upperAxisVector3D); //Construct Cylinder Base Vertex Whose XY Coordinates Are The Sum Of Origin XY Coordinates And Normal Vector XY Components IPoint vertexPoint = GeometryUtilities.ConstructPoint3D(originPoint.X + normalVector3D.XComponent, originPoint.Y + normalVector3D.YComponent, 0); //Construct Lower Base Vertex From This Point And Add To TriangleStrip IPoint lowerVertexPoint = GeometryUtilities.ConstructPoint3D(vertexPoint.X, vertexPoint.Y, CylinderLowerZ); triangleStripPointCollection.AddPoint(lowerVertexPoint, ref _missing, ref _missing); //Construct Upper Base Vertex From This Point And Add To TriangleStrip IPoint upperVertexPoint = GeometryUtilities.ConstructPoint3D(vertexPoint.X, vertexPoint.Y, CylinderUpperZ); triangleStripPointCollection.AddPoint(upperVertexPoint, ref _missing, ref _missing); } //Re-Add The First And Second Points Of The Triangle Strip (First Two Vertices Added) To Close The Strip triangleStripPointCollection.AddPoint(triangleStripPointCollection.get_Point(0), ref _missing, ref _missing); triangleStripPointCollection.AddPoint(triangleStripPointCollection.get_Point(1), ref _missing, ref _missing); //Add TriangleStrip To MultiPatch multiPatchGeometryCollection.AddGeometry(triangleStripPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample1() { const double CircleDegrees = 360.0; const int CircleDivisions = 36; const double VectorComponentOffset = 0.0000001; const double CircleRadius = 5.0; const double CircleZ = 0.0; //Vector3D: Circle, TriangleFan With 36 Vertices IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection triangleFanPointCollection = new TriangleFanClass(); //Set Circle Origin To (0, 0, CircleZ) IPoint originPoint = GeometryUtilities.ConstructPoint3D(0, 0, CircleZ); //Add Origin Point To Triangle Fan triangleFanPointCollection.AddPoint(originPoint, ref _missing, ref _missing); //Define Upper Portion Of Axis Around Which Vector Should Be Rotated To Generate Circle Vertices IVector3D upperAxisVector3D = GeometryUtilities.ConstructVector3D(0, 0, 10); //Define Lower Portion of Axis Around Which Vector Should Be Rotated To Generate Circle Vertices IVector3D lowerAxisVector3D = GeometryUtilities.ConstructVector3D(0, 0, -10); //Add 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 Circle Vertices IVector3D normalVector3D = upperAxisVector3D.CrossProduct(lowerAxisVector3D) as IVector3D; //Set Normal Vector Magnitude Equal To Radius Of Circle normalVector3D.Magnitude = CircleRadius; //Obtain Angle Of Rotation In Radians As Function Of Number Of Divisions Within 360 Degree Sweep Of Circle double rotationAngleInRadians = GeometryUtilities.GetRadians(CircleDegrees / CircleDivisions); for (int i = 0; i < CircleDivisions; i++) { //Rotate Normal Vector Specified Rotation Angle In Radians Around Either Upper Or Lower Axis normalVector3D.Rotate(-1 * rotationAngleInRadians, upperAxisVector3D); //Construct Circle Vertex Whose XY Coordinates Are The Sum Of Origin XY Coordinates And Normal Vector XY Components IPoint vertexPoint = GeometryUtilities.ConstructPoint3D(originPoint.X + normalVector3D.XComponent, originPoint.Y + normalVector3D.YComponent, CircleZ); //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); }
public static IGeometry GetExample2() { //RingGroup: Multiple Exterior Rings With Corresponding Interior Rings IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IMultiPatch multiPatch = multiPatchGeometryCollection as IMultiPatch; //Exterior Ring 1 IPointCollection exteriorRing1PointCollection = new RingClass(); exteriorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1, 1, 0), ref _missing, ref _missing); exteriorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1, 4, 0), ref _missing, ref _missing); exteriorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(4, 4, 0), ref _missing, ref _missing); exteriorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(4, 1, 0), ref _missing, ref _missing); IRing exteriorRing1 = exteriorRing1PointCollection as IRing; exteriorRing1.Close(); multiPatchGeometryCollection.AddGeometry(exteriorRing1 as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(exteriorRing1, esriMultiPatchRingType.esriMultiPatchOuterRing); //Interior Ring 1 IPointCollection interiorRing1PointCollection = new RingClass(); interiorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3.5, 1.5, 0), ref _missing, ref _missing); interiorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3.5, 3.5, 0), ref _missing, ref _missing); interiorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1.5, 3.5, 0), ref _missing, ref _missing); interiorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1.5, 1.5, 0), ref _missing, ref _missing); IRing interiorRing1 = interiorRing1PointCollection as IRing; interiorRing1.Close(); multiPatchGeometryCollection.AddGeometry(interiorRing1 as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(interiorRing1, esriMultiPatchRingType.esriMultiPatchInnerRing); //Exterior Ring 2 IPointCollection exteriorRing2PointCollection = new RingClass(); exteriorRing2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1, -1, 0), ref _missing, ref _missing); exteriorRing2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(4, -1, 0), ref _missing, ref _missing); exteriorRing2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(4, -4, 0), ref _missing, ref _missing); exteriorRing2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1, -4, 0), ref _missing, ref _missing); IRing exteriorRing2 = exteriorRing2PointCollection as IRing; exteriorRing2.Close(); multiPatchGeometryCollection.AddGeometry(exteriorRing2 as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(exteriorRing2, esriMultiPatchRingType.esriMultiPatchOuterRing); //Interior Ring 2 IPointCollection interiorRing2PointCollection = new RingClass(); interiorRing2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1.5, -1.5, 0), ref _missing, ref _missing); interiorRing2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3.5, -1.5, 0), ref _missing, ref _missing); interiorRing2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3.5, -3.5, 0), ref _missing, ref _missing); interiorRing2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1.5, -3.5, 0), ref _missing, ref _missing); IRing interiorRing2 = interiorRing2PointCollection as IRing; interiorRing2.Close(); multiPatchGeometryCollection.AddGeometry(interiorRing2 as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(interiorRing2, esriMultiPatchRingType.esriMultiPatchInnerRing); //Exterior Ring 3 IPointCollection exteriorRing3PointCollection = new RingClass(); exteriorRing3PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1, 1, 0), ref _missing, ref _missing); exteriorRing3PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-4, 1, 0), ref _missing, ref _missing); exteriorRing3PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-4, 4, 0), ref _missing, ref _missing); exteriorRing3PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1, 4, 0), ref _missing, ref _missing); IRing exteriorRing3 = exteriorRing3PointCollection as IRing; exteriorRing3.Close(); multiPatchGeometryCollection.AddGeometry(exteriorRing3 as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(exteriorRing3, esriMultiPatchRingType.esriMultiPatchOuterRing); //Interior Ring 3 IPointCollection interiorRing3PointCollection = new RingClass(); interiorRing3PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1.5, 1.5, 0), ref _missing, ref _missing); interiorRing3PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3.5, 1.5, 0), ref _missing, ref _missing); interiorRing3PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3.5, 3.5, 0), ref _missing, ref _missing); interiorRing3PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1.5, 3.5, 0), ref _missing, ref _missing); IRing interiorRing3 = interiorRing3PointCollection as IRing; interiorRing3.Close(); multiPatchGeometryCollection.AddGeometry(interiorRing3 as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(interiorRing3, esriMultiPatchRingType.esriMultiPatchInnerRing); //Exterior Ring 4 IPointCollection exteriorRing4PointCollection = new RingClass(); exteriorRing4PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1, -1, 0), ref _missing, ref _missing); exteriorRing4PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1, -4, 0), ref _missing, ref _missing); exteriorRing4PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-4, -4, 0), ref _missing, ref _missing); exteriorRing4PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-4, -1, 0), ref _missing, ref _missing); IRing exteriorRing4 = exteriorRing4PointCollection as IRing; exteriorRing4.Close(); multiPatchGeometryCollection.AddGeometry(exteriorRing4 as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(exteriorRing4, esriMultiPatchRingType.esriMultiPatchOuterRing); //Interior Ring 4 IPointCollection interiorRing4PointCollection = new RingClass(); interiorRing4PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1.5, -1.5, 0), ref _missing, ref _missing); interiorRing4PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1.5, -3.5, 0), ref _missing, ref _missing); interiorRing4PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3.5, -3.5, 0), ref _missing, ref _missing); interiorRing4PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3.5, -1.5, 0), ref _missing, ref _missing); IRing interiorRing4 = interiorRing4PointCollection as IRing; interiorRing4.Close(); multiPatchGeometryCollection.AddGeometry(interiorRing4 as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(interiorRing4, esriMultiPatchRingType.esriMultiPatchInnerRing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample4() { //RingGroup: Upright Square Composed Of Multiple Exterior Rings And Multiple Interior Rings IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IMultiPatch multiPatch = multiPatchGeometryCollection as IMultiPatch; //Exterior Ring 1 IPointCollection exteriorRing1PointCollection = new RingClass(); exteriorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, -5), ref _missing, ref _missing); exteriorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 0, -5), ref _missing, ref _missing); exteriorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 0, 5), ref _missing, ref _missing); exteriorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 5), ref _missing, ref _missing); IRing exteriorRing1 = exteriorRing1PointCollection as IRing; exteriorRing1.Close(); multiPatchGeometryCollection.AddGeometry(exteriorRing1 as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(exteriorRing1, esriMultiPatchRingType.esriMultiPatchOuterRing); //Interior Ring 1 IPointCollection interiorRing1PointCollection = new RingClass(); interiorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-4, 0, -4), ref _missing, ref _missing); interiorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(4, 0, -4), ref _missing, ref _missing); interiorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(4, 0, 4), ref _missing, ref _missing); interiorRing1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-4, 0, 4), ref _missing, ref _missing); IRing interiorRing1 = interiorRing1PointCollection as IRing; interiorRing1.Close(); multiPatchGeometryCollection.AddGeometry(interiorRing1 as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(interiorRing1, esriMultiPatchRingType.esriMultiPatchInnerRing); //Exterior Ring 2 IPointCollection exteriorRing2PointCollection = new RingClass(); exteriorRing2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3, 0, -3), ref _missing, ref _missing); exteriorRing2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3, 0, -3), ref _missing, ref _missing); exteriorRing2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3, 0, 3), ref _missing, ref _missing); exteriorRing2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3, 0, 3), ref _missing, ref _missing); IRing exteriorRing2 = exteriorRing2PointCollection as IRing; exteriorRing2.Close(); multiPatchGeometryCollection.AddGeometry(exteriorRing2 as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(exteriorRing2, esriMultiPatchRingType.esriMultiPatchOuterRing); //Interior Ring 2 IPointCollection interiorRing2PointCollection = new RingClass(); interiorRing2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-2, 0, -2), ref _missing, ref _missing); interiorRing2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2, 0, -2), ref _missing, ref _missing); interiorRing2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2, 0, 2), ref _missing, ref _missing); interiorRing2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-2, 0, 2), ref _missing, ref _missing); IRing interiorRing2 = interiorRing2PointCollection as IRing; interiorRing2.Close(); multiPatchGeometryCollection.AddGeometry(interiorRing2 as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(interiorRing2, esriMultiPatchRingType.esriMultiPatchInnerRing); //Exterior Ring 3 IPointCollection exteriorRing3PointCollection = new RingClass(); exteriorRing3PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1, 0, -1), ref _missing, ref _missing); exteriorRing3PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1, 0, -1), ref _missing, ref _missing); exteriorRing3PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1, 0, 1), ref _missing, ref _missing); exteriorRing3PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1, 0, 1), ref _missing, ref _missing); IRing exteriorRing3 = exteriorRing3PointCollection as IRing; exteriorRing3.Close(); multiPatchGeometryCollection.AddGeometry(exteriorRing3 as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(exteriorRing3, esriMultiPatchRingType.esriMultiPatchOuterRing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample1() { //RingGroup: Multiple Rings IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); //Ring 1 IPointCollection ring1PointCollection = new RingClass(); ring1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1, 1, 0), ref _missing, ref _missing); ring1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1, 4, 0), ref _missing, ref _missing); ring1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(4, 4, 0), ref _missing, ref _missing); ring1PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(4, 1, 0), ref _missing, ref _missing); IRing ring1 = ring1PointCollection as IRing; ring1.Close(); multiPatchGeometryCollection.AddGeometry(ring1 as IGeometry, ref _missing, ref _missing); //Ring 2 IPointCollection ring2PointCollection = new RingClass(); ring2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1, -1, 0), ref _missing, ref _missing); ring2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(4, -1, 0), ref _missing, ref _missing); ring2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(4, -4, 0), ref _missing, ref _missing); ring2PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1, -4, 0), ref _missing, ref _missing); IRing ring2 = ring2PointCollection as IRing; ring2.Close(); multiPatchGeometryCollection.AddGeometry(ring2 as IGeometry, ref _missing, ref _missing); //Ring 3 IPointCollection ring3PointCollection = new RingClass(); ring3PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1, 1, 0), ref _missing, ref _missing); ring3PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-4, 1, 0), ref _missing, ref _missing); ring3PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-4, 4, 0), ref _missing, ref _missing); ring3PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1, 4, 0), ref _missing, ref _missing); IRing ring3 = ring3PointCollection as IRing; ring3.Close(); multiPatchGeometryCollection.AddGeometry(ring3 as IGeometry, ref _missing, ref _missing); //Ring 4 IPointCollection ring4PointCollection = new RingClass(); ring4PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1, -1, 0), ref _missing, ref _missing); ring4PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1, -4, 0), ref _missing, ref _missing); ring4PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-4, -4, 0), ref _missing, ref _missing); ring4PointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-4, -1, 0), ref _missing, ref _missing); IRing ring4 = ring4PointCollection as IRing; ring4.Close(); multiPatchGeometryCollection.AddGeometry(ring4 as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample4() { const double CircleDegrees = 360.0; const int CircleDivisions = 18; const double VectorComponentOffset = 0.0000001; const double InnerBuildingRadius = 3.0; const double OuterBuildingExteriorRingRadius = 9.0; const double OuterBuildingInteriorRingRadius = 6.0; const double BaseZ = 0.0; const double InnerBuildingZ = 16.0; const double OuterBuildingZ = 6.0; //Composite: Tall Building Protruding Through Outer Ring-Shaped Building IMultiPatch multiPatch = new MultiPatchClass(); IGeometryCollection multiPatchGeometryCollection = multiPatch as IGeometryCollection; IPoint originPoint = GeometryUtilities.ConstructPoint3D(0, 0, 0); IVector3D upperAxisVector3D = GeometryUtilities.ConstructVector3D(0, 0, 10); IVector3D lowerAxisVector3D = GeometryUtilities.ConstructVector3D(0, 0, -10); lowerAxisVector3D.XComponent += VectorComponentOffset; IVector3D normalVector3D = upperAxisVector3D.CrossProduct(lowerAxisVector3D) as IVector3D; double rotationAngleInRadians = GeometryUtilities.GetRadians(CircleDegrees / CircleDivisions); //Inner Building IGeometry innerBuildingBaseGeometry = new PolygonClass(); IPointCollection innerBuildingBasePointCollection = innerBuildingBaseGeometry as IPointCollection; //Outer Building IGeometry outerBuildingBaseGeometry = new PolygonClass(); IGeometryCollection outerBuildingBaseGeometryCollection = outerBuildingBaseGeometry as IGeometryCollection; IPointCollection outerBuildingBaseExteriorRingPointCollection = new RingClass(); IPointCollection outerBuildingBaseInteriorRingPointCollection = new RingClass(); for (int i = 0; i < CircleDivisions; i++) { normalVector3D.Rotate(-1 * rotationAngleInRadians, upperAxisVector3D); //Inner Building normalVector3D.Magnitude = InnerBuildingRadius; IPoint innerBuildingBaseVertexPoint = GeometryUtilities.ConstructPoint2D(originPoint.X + normalVector3D.XComponent, originPoint.Y + normalVector3D.YComponent); innerBuildingBasePointCollection.AddPoint(innerBuildingBaseVertexPoint, ref _missing, ref _missing); //Outer Building //Exterior Ring normalVector3D.Magnitude = OuterBuildingExteriorRingRadius; IPoint outerBuildingBaseExteriorRingVertexPoint = GeometryUtilities.ConstructPoint2D(originPoint.X + normalVector3D.XComponent, originPoint.Y + normalVector3D.YComponent); outerBuildingBaseExteriorRingPointCollection.AddPoint(outerBuildingBaseExteriorRingVertexPoint, ref _missing, ref _missing); //Interior Ring normalVector3D.Magnitude = OuterBuildingInteriorRingRadius; IPoint outerBuildingBaseInteriorRingVertexPoint = GeometryUtilities.ConstructPoint2D(originPoint.X + normalVector3D.XComponent, originPoint.Y + normalVector3D.YComponent); outerBuildingBaseInteriorRingPointCollection.AddPoint(outerBuildingBaseInteriorRingVertexPoint, ref _missing, ref _missing); } IPolygon innerBuildingBasePolygon = innerBuildingBaseGeometry as IPolygon; innerBuildingBasePolygon.Close(); IRing outerBuildingBaseExteriorRing = outerBuildingBaseExteriorRingPointCollection as IRing; outerBuildingBaseExteriorRing.Close(); IRing outerBuildingBaseInteriorRing = outerBuildingBaseInteriorRingPointCollection as IRing; outerBuildingBaseInteriorRing.Close(); outerBuildingBaseInteriorRing.ReverseOrientation(); outerBuildingBaseGeometryCollection.AddGeometry(outerBuildingBaseExteriorRing as IGeometry, ref _missing, ref _missing); outerBuildingBaseGeometryCollection.AddGeometry(outerBuildingBaseInteriorRing as IGeometry, ref _missing, ref _missing); ITopologicalOperator topologicalOperator = outerBuildingBaseGeometry as ITopologicalOperator; topologicalOperator.Simplify(); IConstructMultiPatch innerBuildingConstructMultiPatch = new MultiPatchClass(); innerBuildingConstructMultiPatch.ConstructExtrudeFromTo(BaseZ, InnerBuildingZ, innerBuildingBaseGeometry); IGeometryCollection innerBuildingMultiPatchGeometryCollection = innerBuildingConstructMultiPatch as IGeometryCollection; for (int i = 0; i < innerBuildingMultiPatchGeometryCollection.GeometryCount; i++) { multiPatchGeometryCollection.AddGeometry(innerBuildingMultiPatchGeometryCollection.get_Geometry(i), ref _missing, ref _missing); } IConstructMultiPatch outerBuildingConstructMultiPatch = new MultiPatchClass(); outerBuildingConstructMultiPatch.ConstructExtrudeFromTo(BaseZ, OuterBuildingZ, outerBuildingBaseGeometry); IMultiPatch outerBuildingMultiPatch = outerBuildingConstructMultiPatch as IMultiPatch; IGeometryCollection outerBuildingMultiPatchGeometryCollection = outerBuildingConstructMultiPatch as IGeometryCollection; for (int i = 0; i < outerBuildingMultiPatchGeometryCollection.GeometryCount; i++) { IGeometry outerBuildingPatchGeometry = outerBuildingMultiPatchGeometryCollection.get_Geometry(i); multiPatchGeometryCollection.AddGeometry(outerBuildingPatchGeometry, ref _missing, ref _missing); if (outerBuildingPatchGeometry.GeometryType == esriGeometryType.esriGeometryRing) { bool isBeginningRing = false; esriMultiPatchRingType multiPatchRingType = outerBuildingMultiPatch.GetRingType(outerBuildingPatchGeometry as IRing, ref isBeginningRing); multiPatch.PutRingType(outerBuildingPatchGeometry as IRing, multiPatchRingType); } } return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample2() { //Composite: Cutaway Of Building With Multiple Floors Composed Of 1 TriangleStrip And 5 Ring Parts IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IMultiPatch multiPatch = multiPatchGeometryCollection as IMultiPatch; //Walls IPointCollection wallsPointCollection = new TriangleStripClass(); //Start wallsPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3, -3, 0), ref _missing, ref _missing); wallsPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3, -3, 16), ref _missing, ref _missing); //Right Wall wallsPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3, 3, 0), ref _missing, ref _missing); wallsPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3, 3, 16), ref _missing, ref _missing); //Back Wall wallsPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3, 3, 0), ref _missing, ref _missing); wallsPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3, 3, 16), ref _missing, ref _missing); //Left Wall wallsPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3, -3, 0), ref _missing, ref _missing); wallsPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3, -3, 16), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(wallsPointCollection as IGeometry, ref _missing, ref _missing); //Floors //Base IPointCollection basePointCollection = new RingClass(); basePointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3, 3, 0), ref _missing, ref _missing); basePointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3, -3, 0), ref _missing, ref _missing); basePointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3, -3, 0), ref _missing, ref _missing); basePointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3, 3, 0), ref _missing, ref _missing); IRing baseRing = basePointCollection as IRing; baseRing.Close(); multiPatchGeometryCollection.AddGeometry(baseRing as IGeometry, ref _missing, ref _missing); //First Floor IPointCollection firstFloorPointCollection = new RingClass(); firstFloorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3, 3, 4), ref _missing, ref _missing); firstFloorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3, -3, 4), ref _missing, ref _missing); firstFloorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3, -3, 4), ref _missing, ref _missing); firstFloorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3, 3, 4), ref _missing, ref _missing); IRing firstFloorRing = firstFloorPointCollection as IRing; firstFloorRing.Close(); multiPatchGeometryCollection.AddGeometry(firstFloorRing as IGeometry, ref _missing, ref _missing); //Second Floor IPointCollection secondFloorPointCollection = new RingClass(); secondFloorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3, 3, 8), ref _missing, ref _missing); secondFloorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3, -3, 8), ref _missing, ref _missing); secondFloorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3, -3, 8), ref _missing, ref _missing); secondFloorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3, 3, 8), ref _missing, ref _missing); IRing secondFloorRing = secondFloorPointCollection as IRing; secondFloorRing.Close(); multiPatchGeometryCollection.AddGeometry(secondFloorRing as IGeometry, ref _missing, ref _missing); //Third Floor IPointCollection thirdFloorPointCollection = new RingClass(); thirdFloorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3, 3, 12), ref _missing, ref _missing); thirdFloorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3, -3, 12), ref _missing, ref _missing); thirdFloorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3, -3, 12), ref _missing, ref _missing); thirdFloorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3, 3, 12), ref _missing, ref _missing); IRing thirdFloorRing = thirdFloorPointCollection as IRing; thirdFloorRing.Close(); multiPatchGeometryCollection.AddGeometry(thirdFloorRing as IGeometry, ref _missing, ref _missing); //Roof IPointCollection roofPointCollection = new RingClass(); roofPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3, 3, 16), ref _missing, ref _missing); roofPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(3, -3, 16), ref _missing, ref _missing); roofPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3, -3, 16), ref _missing, ref _missing); roofPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-3, 3, 16), ref _missing, ref _missing); IRing roofRing = roofPointCollection as IRing; roofRing.Close(); multiPatchGeometryCollection.AddGeometry(roofRing as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }