
v5.0
NurbsSurfaceMesh特定のトポロジ情報からPointLocatorDataを構築します。各ポイントロケータを定義するには、サーフェイスインデックスおよび正規化されたUVサーフェイスのパラメータが必要です。UV 配列はそれぞれ指定されたサブサーフェイスのインデックスに 2 つの値を含みます。
戻されるポイントロケータは、同じトポロジを持つ任意の NurbsSurfaceMeshインスタンスについて評価できます。
PointLocatorData NurbsSurfaceMesh.ConstructPointLocators( Object in_pSubSurfaceIndices, Object in_pNormalizedUVs ); |
oReturn = NurbsSurfaceMesh.ConstructPointLocators( SubSurfaceIndices, NormalizedUVs ); |
| パラメータ | タイプ | 説明 |
|---|---|---|
| SubSurfaceIndices | 1DArray | ポイントロケータが作成されるサブサーフェイスインデックスの配列。 |
| NormalizedUVs | Array | パッキングされたUVペアの 1D 配列または同2D 配列のいずれの書式をとるDouble配列。UVは、対応するサブサーフェイスの位置を定義する正規化されたパラメータ値(0..1)です。 |
/*
This example creates point locators at random surface locations,
and positions a Null at each of these point locators.
*/
NewScene( null, false );
var root = Application.ActiveSceneRoot;
var SphereGeom = root.AddGeometry("Sphere", "NurbsSurface").ActivePrimitive.Geometry;
var NbPtLocators = 50;
var SubSurfaceArray = new Array(NbPtLocators);
var UVArray = new Array(NbPtLocators*2);
for(i = 0; i < NbPtLocators; i++)
{
SubSurfaceArray[i] = 0;
UVArray[i*2] = Math.random();
UVArray[i*2+1] = Math.random();
}
var PointLocatorsFromRandomUVs = SphereGeom.ConstructPointLocators(SubSurfaceArray, UVArray);
CreateNullsAtPointLocations(SphereGeom, PointLocatorsFromRandomUVs);
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.GetSurfacePointLocatorsFromPoints Geometry.EvaluatePositions Geometry.EvaluateNormals Geometry.EvaluateClusterProperty PolygonMesh.GetPolygonIndexArray PolygonMesh.GetTriangleVertexIndexArray PolygonMesh.GetTriangleNodeIndexArray PolygonMesh.GetTriangleWeightArray PolygonMesh.ConstructPointLocators NurbsSurfaceMesh.GetSubSurfaceIndexArray NurbsSurfaceMesh.GetNormalizedUVArray