PolygonMesh.GetPolygonIndexArray operator

導入

v5.0

詳細

ポイントロケータが定義されているポリゴンインデックスを戻します。

この情報はポリゴンメッシュポイントロケータ定義の一部であり、トポロジにのみ影響されます(ジオメトリが変形しても更新されません)。

ポリゴン内の場所は、PolygonMesh.GetTriangleVertexIndexArrayPolygonMesh.GetTriangleWeightArray、およびPolygonMesh.GetTriangleNodeIndexArrayを使用してクエリできます。

スクリプト 構文

oArray = PolygonMesh.GetPolygonIndexArray( PointLocators, [Indices] );

戻り値

1DArray

パラメータ

パラメータ タイプ 詳細
PointLocators PointLocatorData ポイントロケータは記述されます。
Indices 1DArray 記述するポイントロケータのインデックス(無指定の場合はすべてのポイントロケータが対象となります)。

JScript の例

//
//      This example topologically describes the point locators resulting 
//      from the shrink-wrapping of a cube onto a mesh sphere.
//
NewScene();
var root = Application.ActiveSceneRoot;
var CubePositionArray = root.AddGeometry("Cube", "MeshSurface").ActivePrimitive.Geometry.Points.PositionArray;
var MeshSphereGeom = root.AddGeometry("Sphere", "MeshSurface").ActivePrimitive.Geometry;
var CubeOnSpherePointLocators = MeshSphereGeom.GetClosestLocations(CubePositionArray);
var PtLocIndices = new Array(1);
for(i = 0; i < CubeOnSpherePointLocators.Count; i++)
{
        PtLocIndices[0] = i;
        var PtLocPolygon = MeshSphereGeom.GetPolygonIndexArray(
                                        CubeOnSpherePointLocators,
                                        PtLocIndices).toArray();
        var PtLocSubTriNodes = MeshSphereGeom.GetTriangleNodeIndexArray(
                                        CubeOnSpherePointLocators,
                                        PtLocIndices).toArray();
        var PtLocSubTriVertices = MeshSphereGeom.GetTriangleVertexIndexArray(
                                        CubeOnSpherePointLocators,
                                        PtLocIndices).toArray();
        var PtLocBaryCoords = MeshSphereGeom.GetTriangleWeightArray(
                                        CubeOnSpherePointLocators,
                                        PtLocIndices).toArray();
        Application.LogMessage("Point locator " + i + " is on polygon " + PtLocPolygon[0] + ",");
        Application.LogMessage("on a subtriangle described by nodes (" 
                                + PtLocSubTriNodes[0] + ", " + PtLocSubTriNodes[1] + ", " + PtLocSubTriNodes[2] + ")" +
                                " or by vertices (" 
                                + PtLocSubTriVertices[0] + ", " + PtLocSubTriVertices[1] + ", " + PtLocSubTriVertices[2] + ")");
        Application.LogMessage("and having barycentric coordinates ("
                                + PtLocBaryCoords[0] + ", " + PtLocBaryCoords[1] + ", " + PtLocBaryCoords[2] + ")");
        Application.LogMessage("");
}
// Expected results:
//INFO : Point locator 0 is on polygon 58,
//INFO : on a subtriangle described by nodes (217, 219, 220) or by vertices (52, 4, 53)
//INFO : and having barycentric coordinates (0.6173165440559387, 0, 0.3826834559440613)
//INFO : 
//INFO : Point locator 1 is on polygon 42,
//INFO : on a subtriangle described by nodes (157, 159, 160) or by vertices (38, 46, 39)
//INFO : and having barycentric coordinates (0.6173165440559387, 0, 0.3826834559440613)
//INFO : 
//INFO : Point locator 2 is on polygon 61,
//INFO : on a subtriangle described by nodes (229, 231, 232) or by vertices (55, 7, 56)
//INFO : and having barycentric coordinates (0.3826834261417389, 0, 0.6173166036605835)
//etc.

関連項目

PointLocatorData Geometry Geometry.GetClosestLocations Geometry.GetClosestLocationsWithinRadius Geometry.GetRaycastIntersections Geometry.SetupPointLocatorQueries Geometry.GetSurfacePointLocatorsFromPoints Geometry.EvaluatePositions Geometry.EvaluateNormals Geometry.EvaluateClusterProperty PolygonMesh.GetTriangleVertexIndexArray PolygonMesh.GetTriangleNodeIndexArray PolygonMesh.GetTriangleWeightArray PolygonMesh.ConstructPointLocators NurbsSurfaceMesh.GetSubSurfaceIndexArray NurbsSurfaceMesh.GetNormalizedUVArray NurbsSurfaceMesh.ConstructPointLocators