Geometry

Object Hierarchy | 関連する C++クラス:Geometry

継承

SIObject

ジオメトリ

説明

Geometry オブジェクトを使用すると、X3DObject のジオメトリにアクセスできます。ジオメトリは、Primitiveオブジェクトを使用して表示できます。サポートされているジオメトリのタイプは、PolygonMeshNurbsSurfaceMeshNurbsCurveList の 3タイプです。

ジオメトリは次のコンポーネントで構成されます。

- Facet: ポリゴン メッシュおよび NurbsSurface 上に PolygonFace をマップします。NURBS サーフェイスメッシュ上には、NURBS カーブリストへの直接マッピングはありません。

- Segment:ポリゴンメッシュ上にEdgeをマッピングします。NURBS サーフェイスメッシュおよびNURBS カーブリストへの直接マッピングはありません。

- PointVertexおよびNURBS サーフェイスメッシュと NURBS カーブリスト上のControlPointにマッピングします。

- SamplePolygonNodeおよびNURBS サーフェイスメッシュと NURBS カーブリスト上のNurbsSampleにマッピングします。

オブジェクトのConstructionHistoryには、元のジオメトリを変更する複数のOperatorオブジェクトが存在する場合があります。たとえば、Envelopeまたは Shape Combiner オペレータは、ジオメトリをデフォームします。オペレータの影響を受けずにジオメトリにアクセスするには、DeactivateAboveコマンドを使用して一時的にオペレータスタックを部分的に無効にします。

同様に、ジオメトリは少しずつ変更されます(アニメートされたデフォーメーションによる場合など)。Primitive.Geometryに対するTime 引数は、このようにアニメートされたシェイプを使用して作業する場合に便利です。

記述されたオペレータの内容でポイントを設定する場合は、PointCollection.PositionArrayプロパティを使用します。スクリプトオペレータ以外で使用する場合は、FreezeObjを呼び出してすべてのオペレータを削除するか、Translateコマンドを使用します。

ジオメトリには、PointLocatorDataに関連するいくつかのメソッドがあります。ポイントロケータはジオメトリックサーフェイス座標で、ジオメトリ上の正確な位置を示します。ポイントロケータとジオメトリに関連するメソッドの詳細については、PointLocatorDataを参照してください。

メソッド

AddCluster AddEmptyCluster AddICEAttribute CreateSubComponent
EvaluateClusterPropertyオペレータ EvaluateNormalsオペレータ EvaluatePositionsオペレータ GetBoundingBox
GetBoundingCapsule GetBoundingSphere GetClosestLocationsオペレータ GetClosestLocationsWithinRadiusオペレータ
GetICEAttributeFromName GetRaycastIntersectionsオペレータ GetSurfacePointLocatorsFromPointsオペレータ IsClassOfオペレータ
IsEqualToオペレータ RemoveICEAttribute SaveShapeKey SetupPointLocatorQueriesオペレータ

プロパティ

Application Cacheオペレータ Categories Clusters
Facetsオペレータ FullNameオペレータ Help ICEAttributes
Nameオペレータ NestedObjects Origin OriginPath
Parent Pointsオペレータ Samples Segmentsオペレータ
Triangles Typeオペレータ    
       

VBScript の例

'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

関連項目

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