multipatch geometry in gis

Upload: fergus-cheng

Post on 02-Jun-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 MultiPatch Geometry in GIS

    1/160

    ESRI 380 New York St., Redlands, CA 92373-8100 USA TEL 909-793-2853 FAX 909-793-5953 E-MAIL [email protected] WEB www.esri.com

    The Multipatch Geometry Type

    An ESRIWhite Paper December 2008

  • 8/10/2019 MultiPatch Geometry in GIS

    2/160

    Copyright 2008 ESRIAll rights reserved.Printed in the United States of America.

    The information contained in this document is the exclusive property of ESRI. This work is protected under United Statescopyright law and other international copyright treaties and conventions. No part of this work may be reproduced ortransmitted in any form or by any means, electronic or mechanical, including photocopying and recording, or by any

    information storage or retrieval system, except as expressly permitted in writing by ESRI. All requests should be sent toAttention: Contracts and Legal Services Manager, ESRI, 380 New York Street, Redlands, CA 92373-8100 USA.

    The information contained in this document is subject to change without notice.

    ESRI, the ESRI globe logo, ArcGIS, ArcObjects, EDN, ArcScene, ArcGlobe, ArcSDE, 3D Analyst, www.esri.com, [email protected] are trademarks, registered trademarks, or service marks of ESRI in the United States, the European Community,or certain other jurisdictions. Other companies and products mentioned herein may be trademarks or registered trademarks oftheir respective trademark owners.

  • 8/10/2019 MultiPatch Geometry in GIS

    3/160

    J-9749

    ESRI White Paper i

    The Multipatch Geometry Type

    An ESRI White Paper

    Contents Page

    Introduction...........................................................................................1

    Definition ..............................................................................................1

    Geometry Construction.........................................................................2

    Triangle Strip Examples .......................................................................3

    Triangle Fan Examples .........................................................................13

    Triangles Examples...............................................................................23

    Ring Examples ......................................................................................39

    Ring Group Examples...........................................................................50

    IVector3D Examples.............................................................................68

    ITransform3D Examples.......................................................................77

    IConstruct MultiPatch Examples ..........................................................81

    ConstructExtrude Between().................................................................113

    Composite Examples ............................................................................117

    Developer Sample: Multipatch Examples ............................................136

    IGeneralMultiPatchCreator...................................................................138

    Additional Notes ...................................................................................154Additional Samples...............................................................................155

  • 8/10/2019 MultiPatch Geometry in GIS

    4/160

  • 8/10/2019 MultiPatch Geometry in GIS

    5/160

    J-9749

    ESRI White Paper

    The Multipatch Geometry Type

    Introduction The multipatch data format, a geographic information system (GIS)

    industry standard developed by ESRI in 1997, is a geometry used as a

    boundary representation for 3D objects. A collection that can be made up

    of triangle strips, triangle fans, triangles, or rings, multipatch features can

    be used to construct 3D features in ArcGIS, save existing data, and

    exchange data with other non-GIS 3D software packages such as

    Collaborative Design Activity (COLLADA) and SketchUp.

    The multipatch geometry type was initially developed to address the need for a 3D

    polygon geometry type unconstrained by 2D validity rules. Without eliminating the

    constraints that rule out vertical walls, for example, representing extruded 2D lines and

    polygon footprints for 3D visualization would not be possible. Multipatches overcome

    these limitations and go a step farther by providing better control over polygon face

    orientations and a better definition of polygon face interiors. Furthermore, multipatches

    allow for the storage of texture image, color, transparency, and lighting normal vector

    information within the geometry itself, making them the ideal data type for the

    representation of realistic-looking 3D features.

    Definition Multipatch: A 3D geometry used to represent the outer surface, or shell, of features thatoccupy a discrete area or volume in three-dimensional space. Multipatches comprise 3D

    rings and triangles that are used in combination to model a three-dimensional shell.

    Multipatches can be used to represent simple objects such as spheres and cubes or

    complex objects such as isosurfaces, buildings, and trees.

  • 8/10/2019 MultiPatch Geometry in GIS

    6/160

    The Multipatch Geometry Type

    J-9749

    December 2008 2

    TriangleStrip TriangleFan Triangles Ring

    * .. 1

    * .. 1 1 .. *

    1 .. *

    MultiPatch

    GeometryConstruction

    A multipatch can be viewed as a container for a collection of geometries that represent

    3D surfaces. These geometries may be triangle strips, triangle fans, triangles, or groups of

    rings, and a single multipatch may comprise a combination of one or more of thesegeometries.

    Constant Value Description

    esriGeometryMultiPatch 9 A collection of surface patches

    The geometries that a multipatch comprises are referred to as its parts or patches, and the

    type of part controls the interpretation of the order of its vertices. The parts of a

    multipatch can be of one the following geometry types:

    Constant Value Description

    esriGeometryRing 11 An area bounded by one closed path

    esriGeometryTriangleStrip 18 A surface patch of triangles defined by three consecutivepoints

    esriGeometryTriangleFan 19 A surface patch of triangles defined by the first point andtwo consecutive points

    esriGeometryTriangles 22 A surface patch of triangles defined by nonoverlapping setsof three consecutive points each

    A multipatch may contain one triangle strip, triangle fan, or triangle within a triangles set

    per surface and one or more rings per surface. Triangle strips, triangle fans, and triangles

    within a triangles set specify surfaces by themselves, whereas a ring may specify its own

    surface or work contextually with other rings to specify a surface.

    The following examples illustrate various kinds of multipatch geometries that can be

    constructed from a single triangle strip, triangle fan, triangles collection, or ring; multiple

    exterior and interior rings; a 3D vector rotated around an axis; 3D transformation

    functions; the extrusion of 2D and 3D base geometries; and multiple parts or patches to

    be contained by a single composite geometry. These examples focus on geometry

    construction, leaving details about storing texture image, color, transparency, and normal

    vector lighting information to the section that follows.

  • 8/10/2019 MultiPatch Geometry in GIS

    7/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 3

    Triangle StripExamples

    Triangle strip: A continuous, linked strip of 3D triangles where every vertex after the first

    two completes a new triangle. A new triangle is always formed by connecting the new

    vertex with its two immediate predecessors. For a triangle strip with six points, the

    triangle surfaces are defined by points: (0, 1, 2), (2, 1, 3), (2, 3, 4), (4, 3, 5).

    Example 1:Square Lying

    on XY Plane

  • 8/10/2019 MultiPatch Geometry in GIS

    8/160

    The Multipatch Geometry Type

    J-9749

    December 2008 4

    publ i c s tat i c I Geomet r y Get Exampl e1(){

    / / Tri angl eSt r i p: Square Lyi ng On XY Pl ane

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi nt Col l ect i on tr i angl eSt r i pPoi nt Col l ect i on =newTr i angl eSt r i pCl ass ( ) ;

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 6, - 6, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( - 6, 6, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 6, - 6, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 6, 6, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(t r i angl eStr i pPoi nt Col l ect i on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

    Example 2:MultipaneledVertical Plane

  • 8/10/2019 MultiPatch Geometry in GIS

    9/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 5

    publ i c s t at i c I Geomet r y Get Exampl e2(){

    / / Tr i angl eSt ri p: Mul t i - Panel ed Ver t i cal Pl ane

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi ntCol l ect i on tr i angl eStr i pPoi ntCol l ect i on =newTr i angl eSt r i pCl ass ( ) ;

    / / Panel 1

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 7. 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Panel 2

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 2. 5, 2. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 2. 5, 2. 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Panel 3

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (

    Geometr yUt i l i t i es. Constr uctPoi nt 3D( 2. 5, - 2. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 2. 5, - 2. 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Panel 4

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 7. 5, - 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (

    Geometr yUt i l i t i es. Constr uctPoi nt 3D( 7. 5, - 7. 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(tr i angl eSt r i pPoi ntCol l ect i on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

  • 8/10/2019 MultiPatch Geometry in GIS

    10/160

    The Multipatch Geometry Type

    J-9749

    December 2008 6

    Although the same surface could be represented by omitting the points that define Panel 3

    and Panel 4, this example illustrates that a triangle strip can be composed of several

    triangles that lie in the same plane.

    Example 3:Stairs

    publ i c s tat i c I Geomet r y Get Exampl e3()

    { / / Tr i angl eStr i p: Sta i rs

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi nt Col l ect i on tr i angl eSt r i pPoi nt Col l ect i on =newTr i angl eSt r i pCl ass ( ) ;

    / / Fi rs t Step

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 10, 10) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (

    Geomet r yUt i l i t i es. Const r uct Poi nt 3D( 10, 10, 10) ,r ef _mi ssi ng, r ef _mi ssi ng) ;

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 7. 5, 10) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 10, 7. 5, 10) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    11/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 7

    / / Second St ep

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 7. 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 10, 7. 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 10, 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Thi rd Step

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 10, 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 2. 5, 5) ,

    r ef _mi ssi ng, r ef _mi ssi ng) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 10, 2. 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Four t h St ep

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 2. 5, 2. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 10, 2. 5, 2. 5) ,

    r ef _mi ssi ng, r ef _mi ssi ng) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 2. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 10, 0, 2. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    12/160

    The Multipatch Geometry Type

    J-9749

    December 2008 8

    / / End

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 10, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(t r i angl eStr i pPoi nt Col l ect i on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

    By setting every four vertices of a triangle strip to have the same z-value, we cangenerate a stair-shaped geometry.

    Example 4:Box without Top

    or Bottom

    publ i c s tat i c I Geomet r y Get Exampl e4(){

    / / Tri angl eSt r i p: Box Wi t hout Top or Bott om

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi nt Col l ect i on tr i angl eSt r i pPoi nt Col l ect i on =newTr i angl eSt r i pCl ass ( ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    13/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 9

    / / Star t

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 10) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Fi rs t Panel

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 5, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 5, 0, 10) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Second Panel

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 5, 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 5, 5, 10) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Thi rd Panel

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 5, 10) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / End, To Cl ose Box

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 10) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    14/160

    The Multipatch Geometry Type

    J-9749

    December 2008 10

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(t r i angl eStr i pPoi nt Col l ect i on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

    Because we are using a single triangle strip, we are only able to generate a closed

    representation of the side of a box, leaving the top and bottom open. A later example will

    illustrate how we can fill in these holes through extrusion or through the combination of

    multiple patches/parts into a single multipatch geometry.

    Example 5:Star-Shaped Boxwithout Top or

    Bottom

    publ i c s tat i c I Geomet r y Get Exampl e5(){

    / / Tri angl eSt r i p: St ar Shaped Box Wi t hout Top or Bott om

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi nt Col l ect i on tr i angl eSt r i pPoi nt Col l ect i on =newTr i angl eSt r i pCl ass ( ) ;

    / / S ta r t

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 2, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 2, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    15/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 11

    / / Fi rs t Panel

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uct Poi nt 3D(

    - 1 * Mat h. Sqrt (10), Mat h. Sqrt ( 10) , 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uct Poi nt 3D(

    - 1 * Mat h. Sqrt (10), Mat h. Sqrt ( 10) , 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Second Panel

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 2, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 2, 0, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Thi rd Panel

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uct Poi nt 3D(

    - 1 * Mat h. Sqrt (10), - 1 * Mat h. Sqr t ( 10) , 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uct Poi nt 3D(- 1 * Mat h. Sqrt (10), - 1 * Mat h. Sqr t ( 10) , 5

    ) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Four t h Panel

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 0, - 2, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 0, - 2, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Fi f th Panel

    t ri angl eSt ri pPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uct Poi nt 3D(

    Mat h. Sqrt (10), - 1 * Mat h. Sqrt ( 10) , 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    16/160

    The Multipatch Geometry Type

    J-9749

    December 2008 12

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uct Poi nt 3D(

    Mat h. Sqrt ( 10) , - 1 * Mat h. Sqrt ( 10) , 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Si xt h Panel

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 2, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 2, 0, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Sevent h Panel

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uct Poi nt 3D(

    Mat h. Sqrt ( 10) , Mat h. Sqrt ( 10) , 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uct Poi nt 3D(

    Mat h. Sqrt ( 10) , Mat h. Sqrt ( 10) , 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / End, To Cl ose Box

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 2, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl eSt r i pPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 2, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(t r i angl eStr i pPoi nt Col l ect i on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

  • 8/10/2019 MultiPatch Geometry in GIS

    17/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 13

    Triangle FanExamples

    Triangle fan: A continuous fan of 3D triangles where the first point defines the apex or

    origin that all triangles share as a common pivot point and is included in all triangle

    surfaces. Every vertex after the first two completes a new triangle, and a new triangle is

    always formed by connecting the new vertex to its immediate predecessor and the first

    vertex of the part. For a triangle fan with six points, the triangle surfaces are defined by

    points: (0, 1, 2), (0, 2, 3), (0, 3, 4), (0, 4, 5).

  • 8/10/2019 MultiPatch Geometry in GIS

    18/160

    The Multipatch Geometry Type

    J-9749

    December 2008 14

    Example 1:Square Lying onXY Plane, Z < 0

    publ i c s tat i c I Geomet r y Get Exampl e1(){

    / / Tri angl eFan: Square Lyi ng On XY Pl ane, Z < 0

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi nt Col l ect i on tr i angl eFanPoi nt Col l ecti on =newTr i angl eFanCl ass ( ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 0, 0, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 6, - 6, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 6, 6, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 6, 6, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 6, - 6, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    19/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 15

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 6, - 6, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(t r i angl eFanPoi nt Col l ecti on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

    Previous examples showed how a multipatch could be positioned at or above the XY

    plane at z = 0. This example illustrates how a multipatch can be positioned anywhere in

    3D space.

    Because the centerpoint or origin of the triangle fan has the same z-value as its vertices,

    the triangle fan appears as a ring. As we will see in a later example, a ring would bebetter suited to represent this surface as it would not require a vertex to represent the

    centerpoint or origin and would result in a geometry with one less vertex than the

    equivalent triangle fan representation.

    Note that we need to re-add the second vertex of the triangle fan to close the fan.

    Otherwise, a triangle-shaped gap will appear between the last vertex, first vertex, and

    origin.

    Example 2:Upr ight Square

  • 8/10/2019 MultiPatch Geometry in GIS

    20/160

    The Multipatch Geometry Type

    J-9749

    December 2008 16

    publ i c s tat i c I Geomet r y Get Exampl e2(){

    / / Tri angl eFan: Upr i ght Square

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi nt Col l ect i on tr i angl eFanPoi nt Col l ecti on =newTr i angl eFanCl ass ( ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 5, 0, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( - 5, 0, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 5, 0, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 5, 0, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 5, 0, - 5) ,

    r ef _mi ssi ng, r ef _mi ssi ng) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(t ri angl eFanPoi nt Col l ecti on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

  • 8/10/2019 MultiPatch Geometry in GIS

    21/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 17

    Example 3:Square-Based

    Pyramid

    publ i c s t at i c I Geomet r y Get Exampl e3(){

    / /Tr i angl eFan: Squar e Based Pyr ami d

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi ntCol l ect i on tr i angl eFanPoi nt Col l ecti on =

    newTr i angl eFanCl ass ( ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 7) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 6, - 6, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 6, 6, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 6, 6, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 6, - 6, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    22/160

    The Multipatch Geometry Type

    J-9749

    December 2008 18

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 6, - 6, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(t ri angl eFanPoi nt Col l ecti on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

    By setting the z-value of the centerpoint or origin of the triangle fan to a value that differs

    from the z-value of the triangle fan's vertices, the triangle fan no longer appears as a ring

    but rather appears as a pyramid or cone.

    Example 4:

    Triangle-BasedPyramid

    publ i c s tat i c I Geomet r y Get Exampl e4(){

    / / Tri angl eFan: Tri angl e Based Pyrami d

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi nt Col l ect i on tr i angl eFanPoi nt Col l ecti on =newTr i angl eFanCl ass ( ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 6) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    23/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 19

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uct Poi nt 3D(

    - 3 * Mat h. Sqrt (3) , - 3, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 6, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uct Poi nt 3D(

    3 * Mat h. Sqrt (3) , - 3, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uct Poi nt 3D(

    - 3 * Mat h. Sqrt (3) , - 3, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(t r i angl eFanPoi nt Col l ecti on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

    Example 5:Alternating Fan

  • 8/10/2019 MultiPatch Geometry in GIS

    24/160

    The Multipatch Geometry Type

    J-9749

    December 2008 20

    publ i c s tat i c I Geomet r y Get Exampl e5(){

    / / Tri angl eFan: Al t ernati ng Fan

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi nt Col l ect i on tr i angl eFanPoi nt Col l ecti on =newTr i angl eFanCl ass ( ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, - 6, 3) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uct Poi nt 3D(

    - 3 * Mat h. Sqrt (2) , - 3 * Mat h. Sqrt (2) , - 3) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( - 6, 0, 3) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uct Poi nt 3D(

    - 3 * Mat h. Sqrt (2) , 3 * Mat h. Sqrt (2) , - 3) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 6, 3) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uct Poi nt 3D(

    3 * Mat h. Sqrt (2) , 3 * Mat h. Sqrt (2) , - 3) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 6, 0, 3) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uct Poi nt 3D(

    3 * Mat h. Sqrt (2) , - 3 * Mat h. Sqrt (2) , - 3) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    25/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 21

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 0, - 6, 3) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(t r i angl eFanPoi nt Col l ecti on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

    When adjacent vertices have differing z-values, a fanlike geometry is produced.

    Example 6:Partial Fan, Two

    Levels of Zs

    publ i c s t at i c I Geomet r y Get Exampl e6(){

    / / Tr i angl eFan: Par t i al Fan, Two Level s Of Zs

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi ntCol l ect i on tr i angl eFanPoi nt Col l ecti on =newTr i angl eFanCl ass ( ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 3) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 0, - 6, 3) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    26/160

    The Multipatch Geometry Type

    J-9749

    December 2008 22

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uct Poi nt 3D(

    - 3 * Mat h. Sqrt (2) , - 3 * Mat h. Sqrt ( 2) , 3) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( - 6, 0, 3) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uct Poi nt 3D(

    - 3 * Mat h. Sqrt (2) , 3 * Mat h. Sqrt (2) , 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 6, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uct Poi nt 3D(

    3 * Mat h. Sqrt (2) , 3 * Mat h. Sqrt ( 2) , 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t r i angl eFanPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 6, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(

    t ri angl eFanPoi nt Col l ecti on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

    A triangle fan does not need to be closed, and this example illustrates one such triangle

    fan representation.

  • 8/10/2019 MultiPatch Geometry in GIS

    27/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 23

    Triangles Examples

    Triangles: A collection of 3D triangles where each consecutive triplet of vertices defines

    a new triangle. The size of a triangles part must be a multiple of three. For a triangles part

    with six points, the triangle surfaces are defined by points: (0, 1, 2), (3, 4, 5).

    The triangles patch type was introduced to complete the range of vertex-based part types

    and facilitate the capturing of the output results of different triangle-mesh tessellators or

    3D object importers, such as 3D Studio, which output nonconnected triangles into a

    multipatch geometry. Developers may also find it to be a useful patch type for the

    representation of unlinked 3D triangles.

    Example 1:One Tr iangle Lying

    on XY Plane

  • 8/10/2019 MultiPatch Geometry in GIS

    28/160

    The Multipatch Geometry Type

    J-9749

    December 2008 24

    publ i c s tat i c I Geomet r y Get Exampl e1(){

    / / Tri angl es: One Tr i angl e Lyi ng On XY Pl ane

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi nt Col l ect i on t r i angl esPoi ntCol l ect i on =newTr i angl esCl ass ( ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 2. 5, 2. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 7. 5, 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 7. 5, 2. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(t ri angl esPoi nt Col l ecti on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

    Notice that we do not need to re-add the first point or close the geometry, as this is a

    triangle within a triangles set and not a ring. By definition, every three vertices within a

    triangles geometry define a new triangle.

    Example 2:One Upri ght

    Triangle

  • 8/10/2019 MultiPatch Geometry in GIS

    29/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 25

    publ i c s t at i c I Geomet r y Get Exampl e2(){

    / / Tr i angl es: One Upr i ght Tri angl e

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi ntCol l ect i on t r i angl esPoi nt Col l ect i on =newTr i angl esCl ass ( ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 2. 5, 2. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 2. 5, 2. 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 7. 5, 2. 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(t r i angl esPoi nt Col l ecti on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

    As this is a 3D geometry, we can represent it upright in the XZ plane.

    Example 3:

    Thr ee Upri ghtTriangles

  • 8/10/2019 MultiPatch Geometry in GIS

    30/160

    The Multipatch Geometry Type

    J-9749

    December 2008 26

    publ i c s tat i c I Geomet r y Get Exampl e3(){

    / / Tri angl es: Thr ee Upr i ght Tri angl es

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi nt Col l ect i on t r i angl esPoi ntCol l ect i on =newTr i angl esCl ass ( ) ;

    / / Tri angl e 1

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 2. 5, 2. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 2. 5, 2. 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 7. 5, 2. 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tri angl e 2

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 2. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 2. 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 2. 5, 2. 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tri angl e 3

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 2. 5, - 2. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 2. 5, - 2. 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 2. 5, - 2. 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    31/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 27

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(t r i angl esPoi nt Col l ecti on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

    A single triangles part can contain multiple triangles. A different triangles part is not

    needed for each new triangle and would be inefficient to use for multiple, isolated

    triangles.

    Example 4:Six Tr iangles Lyingin Di ff erent Planes

    publ i c s t at i c I Geomet r y Get Exampl e4(){

    / / Tr i angl es: Si x Tri angl es Lyi ng I n Di f f er ent Pl anes

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi ntCol l ect i on t r i angl esPoi nt Col l ect i on =newTr i angl esCl ass ( ) ;

    / / Tr i angl e 1

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 7. 5, 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 10, 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 7. 5, 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    32/160

    The Multipatch Geometry Type

    J-9749

    December 2008 28

    / / Tri angl e 2

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 5, 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tri angl e 3

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, - 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 2. 5, - 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 0, - 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tri angl e 4

    t ri angl esPoi nt Col l ecti on. AddPoi nt (

    Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 7. 5, 2. 5) ,r ef _mi ssi ng, r ef _mi ssi ng) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 2. 5, 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tri angl e 5

    t ri angl esPoi nt Col l ecti on. AddPoi nt (

    Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, - 7. 5, 2. 5) ,r ef _mi ssi ng, r ef _mi ssi ng) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 5, - 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    33/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 29

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, - 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tr i angl e 6

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 7. 5, - 7. 5, 2. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 10, - 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 7. 5, - 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(t r i angl esPoi nt Col l ecti on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

    Triangles within a single triangles part do not need to be coplanar. Each triangle or triplet

    of vertices within a triangles part defines a new triangular surface.

    Example 5:Eighteen Tr iangles

    Lying in Dif ferentPlanes

  • 8/10/2019 MultiPatch Geometry in GIS

    34/160

    The Multipatch Geometry Type

    J-9749

    December 2008 30

    publ i c s tat i c I Geomet r y Get Exampl e5(){

    / / Tri angl es: Ei ght een Tr i angl es Lyi ng I n Di f f er ent Pl anes

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi nt Col l ect i on t r i angl esPoi ntCol l ect i on =newTr i angl esCl ass ( ) ;

    / / Z > 0

    / / Tri angl e 1

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 7. 5, 7. 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 10, 7. 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 7. 5, 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tri angl e 2

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 7. 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (

    Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 5, 7. 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tri angl e 3

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, - 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (

    Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 2. 5, - 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 0, - 7. 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    35/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 31

    / / Tr i angl e 4

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 7. 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 2. 5, 7. 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 7. 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tr i angl e 5

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, - 7. 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 5, - 7. 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, - 7. 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tr i angl e 6

    t ri angl esPoi nt Col l ecti on. AddPoi nt (

    Geometr yUt i l i t i es. Constr uctPoi nt 3D( 7. 5, - 7. 5, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 10, - 7. 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 7. 5, - 7. 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Z = 0

    / / Tr i angl e 1

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 7. 5, 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 10, 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    36/160

    The Multipatch Geometry Type

    J-9749

    December 2008 32

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 7. 5, 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tri angl e 2

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 5, 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tri angl e 3

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, - 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 2. 5, - 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 0, - 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tri angl e 4

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 7. 5, 2. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 2. 5, 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tri angl e 5

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, - 7. 5, 2. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    37/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 33

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 5, - 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, - 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tr i angl e 6

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 7. 5, - 7. 5, 2. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 10, - 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 7. 5, - 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Z < 0

    / / Tr i angl e 1

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 7. 5, 7. 5, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (

    Geometr yUt i l i t i es. Const r uctPoi nt 3D( 10, 7. 5, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 7. 5, 5, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tr i angl e 2

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 7. 5, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (

    Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 5, 7. 5, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 5, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    38/160

    The Multipatch Geometry Type

    J-9749

    December 2008 34

    / / Tri angl e 3

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 0, - 5, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 2. 5, - 5, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 0, - 7. 5, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tri angl e 4

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 0, 7. 5, - 2. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 2. 5, 7. 5, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 0, 7. 5, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tri angl e 5

    t ri angl esPoi nt Col l ecti on. AddPoi nt (

    Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, - 7. 5, - 2. 5) ,r ef _mi ssi ng, r ef _mi ssi ng) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 5, - 7. 5, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, - 7. 5, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Tri angl e 6

    t ri angl esPoi nt Col l ecti on. AddPoi nt (

    Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 7. 5, - 7. 5, - 2. 5) ,r ef _mi ssi ng, r ef _mi ssi ng) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 10, - 7. 5, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    39/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 35

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 7. 5, - 7. 5, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(t r i angl esPoi nt Col l ecti on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

    This example builds on the previous one, showing that triangles can be rendered above,

    at, and below a given z level, in this case z = 0. It also illustrates how large numbers of

    disjoint triangle geometries output by a 3D tessellator can be conveniently captured into a

    single multipatch part.

    Example 6:Closed BoxConstructed fr om

    Single Tr iangles PartComposed of 12

    Triangles

    publ i c s t at i c I Geomet r y Get Exampl e6()

    { / / Tr i angl es: Cl osed Box Const r ucted FromSi ngl e Tr i angl es Par t/ / Composed Of 12 Tr i angl es

    obj ect _mi ssi ng =Type. Mi ssi ng;

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) as I Geometr yCol l ect i on;

    I Poi ntCol l ect i on t r i angl esPoi nt Col l ect i on =newTr i angl esCl ass ( ) as I Poi ntCol l ect i on;

  • 8/10/2019 MultiPatch Geometry in GIS

    40/160

    The Multipatch Geometry Type

    J-9749

    December 2008 36

    / / Bott om

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 5, 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 5, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 5, 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Si de 1

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    41/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 37

    / / Si de 2

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 5, 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 5, 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 5, 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Si de 3

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 5, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 5, 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 5, 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 5, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 5, 0, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 5, 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    42/160

    The Multipatch Geometry Type

    J-9749

    December 2008 38

    / / Si de 4

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 5, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 5, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 5, 0, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Top

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 5, 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 5, 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    t ri angl esPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 5, 0, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    43/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 39

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(t r i angl esPoi nt Col l ecti on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

    A single triangles part can also be used to form a closed solid. In this example, a closed

    box is constructed from 12 triangles participating in a single triangles part.

    Ring Examples

    Ring: A geometric element from which polygons are constructed, defined by an area

    bounded by one closed sequence of connected segments.

    All rings have the same structure, but each has a special role when defining a multipatch

    surface. The role of each ring is determined by the multipatch containing it and is not a

    property of the ring itself. The roles are as follows:

    Outer ring: The exterior or outer ring of a polygon

    Inner ring: The interior or hole within a polygon First ring: The first ring of a polygon of an unspecified type

    Ring: A ring of a polygon of an unspecified type

  • 8/10/2019 MultiPatch Geometry in GIS

    44/160

    The Multipatch Geometry Type

    J-9749

    December 2008 40

    A sequence of parts that are rings can describe a polygonal surface patch with holes. The

    sequence typically consists of an outer ring, representing the outer boundary of the patch,

    followed by a number of inner rings representing holes. When the individual types of

    rings are unknown in a collection of rings representing a polygonal patch with holes, the

    sequence must start with a first ring, followed by a number of rings. A sequence of rings

    not preceded by a first ring is treated as a sequence of outer rings without holes.

    If a part is a ring, it must be closed, meaning that the first and last vertex of a ring must

    be the same.

    The order of parts that are rings in the points array is significant: inner rings must follow

    their outer ring; a sequence of rings representing a single surface patch must begin with a

    ring of the type first ring.

    Another rule is that there is only one group per outer ring. If, for instance, there was

    another coplanar ring inside the hole mentioned above, this would be represented asanother group. This is because it is effectively another surface, even though it is coplanar

    with the side ring and the hole ring.

    Each group has a ring sequence, and in combination with the role of the rings in the

    sequence, a surface can be defined. A multipatch can have a number of surfaces

    represented by ring groups; the different roles of the rings help determine the group from

    the next and, within each group, determine the structure of the surface.

    First ring designates the start of a ring group. Any subsequent surface other than ring

    breaks the sequence.

    The following are examples of using roles of rings in a ring sequence of a group to define

    a surface.

    Example 1

    Multipatch composed of the following parts:

    Triangle StripTriangle FanRingRingFirst RingRing

    The above sequence is interpreted as fivesurfaces as follows:

    Triangle StripTriangle FanRingRingFirst Ring, Ring

    Example 2

    Multipatch composed of the following parts:

    Triangle StripOuter RingInner RingInner RingRingFirst RingRing

    The above sequence is interpreted as foursurfaces as follows:

    Triangle StripOuter Ring, Inner Ring, Inner RingRingFirst Ring, Ring

  • 8/10/2019 MultiPatch Geometry in GIS

    45/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 41

    Outer ring/inner ring nomenclature is a more structured form for representing a surface

    than first ring/ring series. The former explicitly defines that any inner ring that

    immediately follows an outer ring is a hole in the outer ring. In the sequence, inner must

    always follow outer or inner. Otherwise, it would be an error. Anything other than inner

    would stop the sequence for the inner/outer group.

    This paper will focus on outer (exterior) rings and inner (interior) rings, as it is possible

    to represent every type of ring patch using these two roles alone. In cases in which a

    multipatch is defined using rings with no holes or interiors, the basic ring role is used for

    convenience, although outer ring would work just as well.

    Example 1:Upr ight Rectangle

    publ i c s t at i c I Geomet r y Get Exampl e1(){

    / / Ri ng: Upr i ght Rect angl e

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi ntCol l ect i on ri ngPoi nt Col l ecti on = new Ri ngCl ass( ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 0, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 7. 5, 0, 7. 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    46/160

    The Multipatch Geometry Type

    J-9749

    December 2008 42

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 7. 5, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(r i ngPoi nt Col l ecti on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

    Note that after we have added all unique vertices to our ring, we need to re-add the first

    point or close the geometry. Otherwise, our geometry will be in an invalid state.

    Example 2:Octagon Lying in XY

    Plane

    publ i c s tat i c I Geomet r y Get Exampl e2(){

    / / Ri ng: Oct agon Lyi ng I n XY Pl ane

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi nt Col l ect i on ri ngPoi nt Col l ecti on = new Ri ngCl ass( ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 8. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    47/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 43

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 7. 5, 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 8. 5, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 7. 5, - 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 0, - 8. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, - 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 8. 5, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 7. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(ri ngPoi nt Col l ecti on as I Geomet r y,

    r ef _mi ssi ng, r ef _mi ssi ng) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

  • 8/10/2019 MultiPatch Geometry in GIS

    48/160

    The Multipatch Geometry Type

    J-9749

    December 2008 44

    Example 3:Octagon with

    Noncoplanar Points

    publ i c s tat i c I Geomet r y Get Exampl e3(){

    / / Ri ng: Oct agon Wi t h Non- Copl anar Poi nts

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi nt Col l ect i on ri ngPoi nt Col l ecti on = new Ri ngCl ass( ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 7. 5, 5) ,

    r ef _mi ssi ng, r ef _mi ssi ng) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 8. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 7. 5, 7. 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 8. 5, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 7. 5, - 7. 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 0, - 8. 5, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    49/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 45

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, - 7. 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 8. 5, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 7. 5, 7. 5, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(ri ngPoi nt Col l ecti on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

    This example illustrates the effect of setting our ring vertices to have differing z-values.

    Because such rings with noncoplanar vertices can be represented and rendered differently

    than we may expect, it is a good idea to adhere to the rule of only constructing rings with

    coplanar points. If we really desired the resulting geometry, for example, we could

    represent it with a single triangle strip for the center and a single triangles part for the two

    triangles on both ends.

    Example 4:Maze Lying on

    XY Plane

  • 8/10/2019 MultiPatch Geometry in GIS

    50/160

    The Multipatch Geometry Type

    J-9749

    December 2008 46

    publ i c s tat i c I Geomet r y Get Exampl e4(){

    / / Ri ng: Maze Lyi ng On XY Pl ane

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi nt Col l ect i on ri ngPoi nt Col l ecti on = new Ri ngCl ass( ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( - 10, 10, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 10, 10, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 10, - 10, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( - 10, - 10, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( - 10, 6, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 6, 6, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 6, - 6, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 6, - 6, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( - 6, 2, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( - 6, 2, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 0, 2, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    51/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 47

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 4, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 4, - 4, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 4, - 4, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 4, 4, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 8, 4, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 8, - 8, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 8, - 8, 0) ,

    r ef _mi ssi ng, r ef _mi ssi ng) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 8, 8, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( - 10, 8, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( - 10, 10, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(ri ngPoi nt Col l ecti on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

  • 8/10/2019 MultiPatch Geometry in GIS

    52/160

    The Multipatch Geometry Type

    J-9749

    December 2008 48

    Example 5:Maze with

    Noncoplanar Points

    publ i c s tat i c I Geomet r y Get Exampl e5(){

    / / Ri ng: Maze Wi t h Non- Copl anar Poi nt s

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Poi nt Col l ect i on ri ngPoi nt Col l ecti on = new Ri ngCl ass( ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( - 10, 10, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 10, 10, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 10, - 10, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( - 10, - 10, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( - 10, 6, 5) ,

    r ef _mi ssi ng, r ef _mi ssi ng) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( 6, 6, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    53/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 49

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 6, - 6, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 6, - 6, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 6, 2, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 6, 2, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 0, 2, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 0, 0, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 4, 0, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 4, - 4, 5) ,

    r ef _mi ssi ng, r ef _mi ssi ng) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 4, - 4, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 4, 4, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 8, 4, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( - 8, - 8, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ngPoi nt Col l ecti on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 8, - 8, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    54/160

    The Multipatch Geometry Type

    J-9749

    December 2008 50

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 8, 8, 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 10, 8, - 5) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    ri ngPoi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( - 10, 10, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(r i ngPoi nt Col l ecti on as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

    This somewhat more complex example of a ring with noncoplanar points further

    emphasizes the importance of adhering to the above mentioned rule.

    Ring GroupExamples

    Example 1:Mul tiple Rings

  • 8/10/2019 MultiPatch Geometry in GIS

    55/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 51

    publ i c s t at i c I Geomet r y Get Exampl e1(){

    / / Ri ngGr oup: Mul t i pl e Ri ngs

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    / / Ri ng 1

    I Poi ntCol l ect i on r i ng1Poi nt Col l ecti on = new Ri ngCl ass( ) ;

    r i ng1Poi nt Col l ect i on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 1, 1, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ng1Poi nt Col l ect i on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 1, 4, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ng1Poi nt Col l ect i on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 4, 4, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ng1Poi nt Col l ect i on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 4, 1, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    I Ri ng ri ng1 = r i ng1Poi nt Col l ecti on as I Ri ng;r i ng1. Cl ose( ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(r i ng1 as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Ri ng 2

    I Poi ntCol l ect i on r i ng2Poi nt Col l ecti on = new Ri ngCl ass( ) ;

    r i ng2Poi nt Col l ect i on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 1, - 1, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ng2Poi nt Col l ect i on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 4, - 1, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ng2Poi nt Col l ect i on. AddPoi nt (

    Geometr yUt i l i t i es. Constr uctPoi nt 3D( 4, - 4, 0) ,r ef _mi ssi ng, r ef _mi ssi ng) ;

    r i ng2Poi nt Col l ect i on. AddPoi nt (Geometr yUt i l i t i es. Constr uctPoi nt 3D( 1, - 4, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    56/160

    The Multipatch Geometry Type

    J-9749

    December 2008 52

    I Ri ng ri ng2 = ri ng2Poi nt Col l ecti on as I Ri ng;r i ng2. Cl ose() ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(r i ng2 as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    / / Ri ng 3

    I Poi nt Col l ect i on r i ng3Poi nt Col l ecti on = new Ri ngCl ass( ) ;

    r i ng3Poi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( - 1, 1, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ng3Poi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( - 4, 1, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ng3Poi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( - 4, 4, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ng3Poi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( - 1, 4, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    I Ri ng ri ng3 = ri ng3Poi nt Col l ecti on as I Ri ng;r i ng3. Cl ose() ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(r i ng3 as I Geomet r y,

    r ef _mi ssi ng, r ef _mi ssi ng) ;

    / / Ri ng 4

    I Poi nt Col l ect i on r i ng4Poi nt Col l ecti on = new Ri ngCl ass( ) ;

    r i ng4Poi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 1, - 1, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ng4Poi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 1, - 4, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ng4Poi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 4, - 4, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    r i ng4Poi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Constr uctPoi nt 3D( - 4, - 1, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    57/160

    The Multipatch Geometry Type

    J-9749

    ESRI White Paper 53

    I Ri ng ri ng4 = r i ng4Poi nt Col l ecti on as I Ri ng;r i ng4. Cl ose( ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(r i ng4 as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    return mul t i Pat chGeomet r yCol l ecti on as I Geomet r y;}

    Multiple rings can be added to a single multipatch, as shown in this example.

    Example 2:Multiple Exterior

    Rings withCorrespondingI nteri or Rings

    publ i c s t at i c I Geomet r y Get Exampl e2(){

    / / Ri ngGr oup: Mul t i pl e Ext eri or Ri ngs Wi t h Corr espondi ng I nt eri or Ri ngs

    I Geometr yCol l ect i on mul t i Pat chGeometr yCol l ect i on =new Mul t i Pat chCl ass( ) ;

    I Mul t i Pat ch mul t i Pat ch = mul t i Pat chGeometr yCol l ect i on as I Mul t i Pat ch;

    / / Exter i or Ri ng 1

    I Poi ntCol l ect i on exteri or Ri ng1Poi nt Col l ecti on = new Ri ngCl ass( ) ;

    ext eri orRi ng1Poi nt Col l ect i on. AddPoi nt (Geometr yUt i l i t i es. Const r uctPoi nt 3D( 1, 1, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

  • 8/10/2019 MultiPatch Geometry in GIS

    58/160

    The Multipatch Geometry Type

    J-9749

    December 2008 54

    exteri or Ri ng1Poi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 1, 4, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    exteri or Ri ng1Poi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 4, 4, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    exteri or Ri ng1Poi nt Col l ecti on. AddPoi nt (Geomet r yUt i l i t i es. Const r uctPoi nt 3D( 4, 1, 0) ,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    I Ri ng exteri or Ri ng1 = exteri or Ri ng1Poi nt Col l ecti on as I Ri ng;ext eri or Ri ng1. Cl ose( ) ;

    mul t i PatchGeomet r yCol l ect i on. AddGeomet r y(ext eri orRi ng1 as I Geomet r y,r ef _mi ssi ng, r ef _mi ssi ng

    ) ;

    mul t i Pat ch. Put Ri ngType(ext