## Geometry

Object Hierarchy | Related C++ Class: Geometry

### Inheritance

###

SIObject

Geometry

### Description

The Geometry object provides access to the X3DObject's Geometry. The geometry is exposed via the Primitive object. There are 3 different types of geometry supported: PolygonMesh, NurbsSurfaceMesh and NurbsCurveList.
Geometry is made up of the following components:
- Facet: Maps to a PolygonFace on a polygon mesh and a NurbsSurface. On a NURBS surface mesh, there is no direct mapping to NURBS curve list.
- Segment: Maps to a Edge on a polygon mesh. There is no direct mapping for NURBS surface mesh and NURBS curve list.
- Point: Maps to a Vertex on a polygon mesh and a ControlPoint on a NURBS surface mesh and NURBS curve list.
- Sample: Maps to a PolygonNode on a polygon mesh and a NurbsSample on a NURBS surface mesh and NURBS curve list.
An object may have multiple Operator objects in its ConstructionHistory that change the original geometry. For example, an Envelope or Shape Combiner operator will deform the the geometry. In order to access the geometry without the influence of the operators, use the DeactivateAbove command to temporarily disable parts of the operator stack.
Similarily, a geometry may change over time, for example because of an animated deformation. The time argument to Primitive.Geometry is useful for working with such animated shapes.
For setting points within the context of a scripted operator, use the PointCollection.PositionArray property. If not used in a scripted operator, you must either call FreezeObj to remove all operators or use the Translate command.
Geometry has several methods related to PointLocatorData. A point locator is a geometric surface coordinate, and represents a precise location on a geometry. For more information about point locators and Geometry's related methods, see PointLocatorData.

### Methods

AddCluster | AddEmptyCluster | AddICEAttribute | CreateSubComponent
EvaluateClusterProperty | EvaluateNormals | EvaluatePositions | GetBoundingBox
GetBoundingCapsule | GetBoundingSphere | GetClosestLocations | GetClosestLocationsWithinRadius
GetICEAttributeFromName | GetRaycastIntersections | GetSurfacePointLocatorsFromPoints | IsClassOf
IsEqualTo | RemoveICEAttribute | SaveShapeKey | SetupPointLocatorQueries

### Properties

Application | Cache | Categories | Clusters
Facets | FullName | Help | ICEAttributes
Name | NestedObjects | Origin | OriginPath
Parent | Points | Samples | Segments
Triangles | Type |  |

### Examples

#### VBScript Example

    'VBScript example demonstrating how to access the base geometry of a grid

    'that is being deformed by an envelope.  To do this we temporarily

    'disable the envelope using the DeactivateAbove command

    newscene ,false

    ' Create the Skeleton

    Dim oRoot, aRootPos, aEffPos1, aEffPos2, oChain1, oChain2

    Set oRoot = Application.ActiveProject.ActiveScene.Root

    aRootPos = Array(-4, 0, 4)

    aEffPos1 = Array(0,0,0)

    aEffPos2 = Array(2,0,-2)

    aEffPos3 = Array(4,0,-4)

    Set oChainRoot = oRoot.Add2DChain( aRootPos, aEffPos1, , siViewTop )

    oChainRoot.AddBone( aEffPos2 )

    oChainRoot.AddBone( aEffPos3 )

    set oEff = oChainRoot.Children("eff")

    ' Create the Envelope

    Dim oGrid, oGeometry

    Set oGrid = oRoot.AddGeometry( "grid", "MeshSurface")

    oGrid.Parameters("subdivu").Value = 3

    oGrid.Parameters("subdivv").Value = 3

    ' Apply the Envelope to the Skeleton

    Dim oEnvelope

    Set oEnvelope = oGrid.ApplyEnvelope( oChainRoot, siBranch, siBranch )

    ' Move the Effector to crumple up the grid

    Translate oEff, -8,0,0,siRelative, siLocal, siObj, siXYZ

    ' If we access the points now via the object model we get the position with the

    ' deformation taken into account

    set oPoints = oGrid.ActivePrimitive.Geometry.Points

    set oPos = oPoints.Item(12).Position

    Application.LogMessage "Point 12 is at " & Round( oPos.X, 1 ) & "," & _

    	Round( oPos.Y, 1 ) & "," & Round( oPos.Z, 1 )

    ' Disable the operator which connects the skeleton and grid

    DeactivateAbove oGrid.ActivePrimitive & ".envelopop", true

    ' Now when we retrieve the points we get the original geometry

    set oPoints = oGrid.ActivePrimitive.Geometry.Points

    set oPos = oPoints.Item(12).Position

    Application.LogMessage "Point 12 is at " & Round( oPos.X, 1 ) & "," & _

    	Round( oPos.Y, 1 ) & "," & Round( oPos.Z, 1 )

    ' Restore the affect of the envelope on the grid

    DeactivateAbove oGrid.ActivePrimitive & ".envelopop", false

### See Also

Primitive.Geometry Cluster ClusterProperty Facet Segment Point NurbsSurfaceMesh NurbsSurface PolygonMesh PolygonFace Edge Vertex