ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.Geometry Namespace / Multipatch Class / GetPatchNormals Method
The index of the patch. Must be greater than or equal to zero and less than PartCount.
The collection into which the coordinates are copied. If normals is null, then a list is allocated.
Example

In This Topic
    GetPatchNormals Method
    In This Topic
    Gets a collection of coordinates representing the vertices of the normals for the specified patch (part).
    Syntax
    public void GetPatchNormals( 
       int patchIndex,
       ref ICollection<Coordinate3D> normals
    )
    Public Sub GetPatchNormals( _
       ByVal patchIndex As Integer, _
       ByRef normals As ICollection(Of Coordinate3D) _
    ) 

    Parameters

    patchIndex
    The index of the patch. Must be greater than or equal to zero and less than PartCount.
    normals
    The collection into which the coordinates are copied. If normals is null, then a list is allocated.
    Exceptions
    ExceptionDescription
    The patch index must be >= 0.
    The patch index must be less than the number of patches (parts) in the multipatch.
    This multipatch does not have normals.
    Remarks
    The normals of a 3D object are used for lighting. They define the direction that each face will reflect light. They are usually perpendicular to the geometry but can also be defined in other directions.
    Example
    Get the normals of a multipatch
    // <summary>
    // This method gets the normal coordinate of a multipatch and does something with it.
    // This method must be called on the MCT. Use QueuedTask.Run.
    // </summary>
    // <param name="multipatch">The input multipatch.</param>
    public void DoSomethingWithNormalCoordinates(Multipatch multipatch)
    {
      if (multipatch.HasNormals)
      {
        // Allocate the list only once
        int numPoints = multipatch.PointCount;
        ICollection<Coordinate3D> normals = new List<Coordinate3D>(numPoints);
    
        // The parts of a multipatch are also called patches
        int numPatches = multipatch.PartCount;
    
        for (int patchIndex = 0; patchIndex < numPatches; patchIndex++)
        {
          multipatch.GetPatchNormals(patchIndex, ref normals);
    
          // Do something with the normals for this patch.
        }
      }
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also