About the 3D multipatch examples Sample
[C#]
TrianglesExamples.cs
using ESRI.ArcGIS.Geometry; using System; namespace MultiPatchExamples { public static class TrianglesExamples { private static object _missing = Type.Missing; 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 GetExample2() { //Triangles: One Upright Triangle 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(2.5, 2.5, 7.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.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 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 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 GetExample5() { //Triangles: Eighteen Triangles Lying In Different Planes IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection trianglesPointCollection = new TrianglesClass(); //Z > 0 //Triangle 1 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 7.5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 7.5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 5, 5), ref _missing, ref _missing); //Triangle 2 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 7.5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 7.5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 5, 5), ref _missing, ref _missing); //Triangle 3 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, -5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -7.5, 5), ref _missing, ref _missing); //Triangle 4 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, 7.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 7.5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, 5), ref _missing, ref _missing); //Triangle 5 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, -7.5, 7.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -7.5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, -7.5, 5), ref _missing, ref _missing); //Triangle 6 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, 7.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, -7.5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, 5), ref _missing, ref _missing); //Z = 0 //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); //Z < 0 //Triangle 1 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 7.5, -5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 7.5, -5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 5, -5), ref _missing, ref _missing); //Triangle 2 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 7.5, -5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 7.5, -5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 5, -5), ref _missing, ref _missing); //Triangle 3 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -5, -5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, -5, -5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -7.5, -5), 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, -5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, -5), 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, -5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, -7.5, -5), 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, -5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, -5), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(trianglesPointCollection as IGeometry, ref _missing, ref _missing); return multiPatchGeometryCollection as IGeometry; } public static IGeometry GetExample6() { //Triangles: Closed Box Constructed From Single Triangles Part Composed Of 12 Triangles IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass() as IGeometryCollection; IPointCollection trianglesPointCollection = new TrianglesClass() as IPointCollection; //Bottom trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), ref _missing, ref _missing); //Side 1 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), ref _missing, ref _missing); //Side 2 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), ref _missing, ref _missing); //Side 3 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), ref _missing, ref _missing); //Side 4 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 5), ref _missing, ref _missing); //Top trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 5), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(trianglesPointCollection as IGeometry, ref _missing, ref _missing); return multiPatchGeometryCollection as IGeometry; } } }
[Visual Basic .NET]
TrianglesExamples.vb
Imports Microsoft.VisualBasic Imports ESRI.ArcGIS.Geometry Imports System Public Class TrianglesExamples Private Shared _missing As Object = Type.Missing Private Sub New() End Sub Public Shared Function GetExample1() As IGeometry 'Triangles: One Triangle Lying On XY Plane Dim multiPatchGeometryCollection As IGeometryCollection = New MultiPatchClass() Dim trianglesPointCollection As IPointCollection = New TrianglesClass() trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 2.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 7.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 2.5, 0), _missing, _missing) multiPatchGeometryCollection.AddGeometry(TryCast(trianglesPointCollection, IGeometry), _missing, _missing) Return TryCast(multiPatchGeometryCollection, IGeometry) End Function Public Shared Function GetExample2() As IGeometry 'Triangles: One Upright Triangle Dim multiPatchGeometryCollection As IGeometryCollection = New MultiPatchClass() Dim trianglesPointCollection As IPointCollection = New TrianglesClass() trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 2.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 2.5, 7.5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 2.5, 7.5), _missing, _missing) multiPatchGeometryCollection.AddGeometry(TryCast(trianglesPointCollection, IGeometry), _missing, _missing) Return TryCast(multiPatchGeometryCollection, IGeometry) End Function Public Shared Function GetExample3() As IGeometry 'Triangles: Three Upright Triangles Dim multiPatchGeometryCollection As IGeometryCollection = New MultiPatchClass() Dim trianglesPointCollection As IPointCollection = New TrianglesClass() 'Triangle 1 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 2.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 2.5, 7.5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 2.5, 7.5), _missing, _missing) 'Triangle 2 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 2.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 2.5, 7.5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-2.5, 2.5, 7.5), _missing, _missing) 'Triangle 3 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-2.5, -2.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-2.5, -2.5, 7.5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, -2.5, 7.5), _missing, _missing) multiPatchGeometryCollection.AddGeometry(TryCast(trianglesPointCollection, IGeometry), _missing, _missing) Return TryCast(multiPatchGeometryCollection, IGeometry) End Function Public Shared Function GetExample4() As IGeometry 'Triangles: Six Triangles Lying In Different Planes Dim multiPatchGeometryCollection As IGeometryCollection = New MultiPatchClass() Dim trianglesPointCollection As IPointCollection = New TrianglesClass() 'Triangle 1 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 7.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 7.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 5, 0), _missing, _missing) 'Triangle 2 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 7.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 7.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 5, 0), _missing, _missing) 'Triangle 3 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, -5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -7.5, 0), _missing, _missing) 'Triangle 4 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, 2.5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 7.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, 0), _missing, _missing) 'Triangle 5 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, -7.5, 2.5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -7.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, -7.5, 0), _missing, _missing) 'Triangle 6 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, 2.5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, -7.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, 0), _missing, _missing) multiPatchGeometryCollection.AddGeometry(TryCast(trianglesPointCollection, IGeometry), _missing, _missing) Return TryCast(multiPatchGeometryCollection, IGeometry) End Function Public Shared Function GetExample5() As IGeometry 'Triangles: Eighteen Triangles Lying In Different Planes Dim multiPatchGeometryCollection As IGeometryCollection = New MultiPatchClass() Dim trianglesPointCollection As IPointCollection = New TrianglesClass() 'Z > 0 'Triangle 1 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 7.5, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 7.5, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 5, 5), _missing, _missing) 'Triangle 2 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 7.5, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 7.5, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 5, 5), _missing, _missing) 'Triangle 3 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -5, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, -5, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -7.5, 5), _missing, _missing) 'Triangle 4 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, 7.5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 7.5, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, 5), _missing, _missing) 'Triangle 5 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, -7.5, 7.5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -7.5, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, -7.5, 5), _missing, _missing) 'Triangle 6 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, 7.5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, -7.5, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, 5), _missing, _missing) 'Z = 0 'Triangle 1 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 7.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 7.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 5, 0), _missing, _missing) 'Triangle 2 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 7.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 7.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 5, 0), _missing, _missing) 'Triangle 3 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, -5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -7.5, 0), _missing, _missing) 'Triangle 4 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, 2.5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 7.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, 0), _missing, _missing) 'Triangle 5 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, -7.5, 2.5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -7.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, -7.5, 0), _missing, _missing) 'Triangle 6 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, 2.5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, -7.5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, 0), _missing, _missing) 'Z < 0 'Triangle 1 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 7.5, -5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 7.5, -5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 5, -5), _missing, _missing) 'Triangle 2 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 7.5, -5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 7.5, -5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 5, -5), _missing, _missing) 'Triangle 3 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -5, -5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, -5, -5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -7.5, -5), _missing, _missing) 'Triangle 4 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, -2.5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 7.5, -5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, -5), _missing, _missing) 'Triangle 5 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, -7.5, -2.5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -7.5, -5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, -7.5, -5), _missing, _missing) 'Triangle 6 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, -2.5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, -7.5, -5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, -5), _missing, _missing) multiPatchGeometryCollection.AddGeometry(TryCast(trianglesPointCollection, IGeometry), _missing, _missing) Return TryCast(multiPatchGeometryCollection, IGeometry) End Function Public Shared Function GetExample6() As IGeometry 'Triangles: Closed Box Constructed From Single Triangles Part Composed Of 12 Triangles Dim multiPatchGeometryCollection As IGeometryCollection = New MultiPatchClass() Dim trianglesPointCollection As IPointCollection = New TrianglesClass() 'Bottom trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), _missing, _missing) 'Side 1 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), _missing, _missing) 'Side 2 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), _missing, _missing) 'Side 3 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), _missing, _missing) 'Side 4 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 5), _missing, _missing) 'Top trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), _missing, _missing) trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 5), _missing, _missing) multiPatchGeometryCollection.AddGeometry(TryCast(trianglesPointCollection, IGeometry), _missing, _missing) Return TryCast(multiPatchGeometryCollection, IGeometry) End Function End Class