Geometry.GetSurfacePointLocatorsFromPoints operator

導入

v5.0

詳細

ジオメトリの指定(指定されていない場合はすべてのPointPoint)に対応するサーフェイスを含むPointLocatorDataオブジェクトを戻します。

NurbsSurfaceMeshの場合、ポイント(コントロール頂点)とサーフェイス間の直接的なリレーションシップは存在しません。この場合、戻されるポイントの位置は、各入力コントロール頂点の影響を最も受けるサーフェイス位置と一致します。

注:同じトポロジを持つ任意の Geometry インスタンスについてポイントロケータが計算され、戻される場合があります。

スクリプト 構文

oReturn = Geometry.GetSurfacePointLocatorsFromPoints( [PointIndices] );

戻り値

PointLocatorData

パラメータ

パラメータ タイプ 詳細
PointIndices 1DArray ポイント位置を作成するポイントインデックスを含む1D 配列。

JScript の例

/* 
        This example uses point locators to place a null positioned 
        and oriented to a surface location corresponding to each
        control vertex of the NURBS sphere.
*/
NewScene( null, false );
var root = Application.ActiveSceneRoot;
var SphereGeom = root.AddGeometry("Sphere", "NurbsSurface").ActivePrimitive.Geometry;
var PointLocatorsFromSpherePoints = SphereGeom.GetSurfacePointLocatorsFromPoints();
CreateNullsAtPointLocations(SphereGeom, PointLocatorsFromSpherePoints);
function CreateNullsAtPointLocations( InGeom, InPointLocators )
{
        var SpherePositions = InGeom.EvaluatePositions(InPointLocators).toArray();
        var SphereNormals = InGeom.EvaluateNormals(InPointLocators).toArray();
        var TempVector = XSIMath.CreateVector3();
        var TempRotation = XSIMath.CreateRotation();
        for (i = 0; i < SpherePositions.length; i+=3)
        {
                var NullObj = root.AddNull();
                TempVector.Set(SpherePositions[i], SpherePositions[i+1], SpherePositions[i+2]);
                NullObj.LocalTranslation = TempVector;
                TempVector.Set(SphereNormals[i], SphereNormals[i+1], SphereNormals[i+2]);
                TempRotation.SetFromXYZAxes( TempVector, TempVector, TempVector );
                NullObj.LocalRotation = TempRotation;
        }
}

関連項目

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