v5.0
Returns a PointLocatorData
object containing surface locations corresponding to the specified
Points of the geometry (or all Points if not specified).
In the case of a NurbsSurfaceMesh, there is no direct
relationship between the points (control vertices) and the surface.
In that case, the returned point locators correspond to the surface
locations being the most influenced by each input control
vertex.
Note: The returned point locators can be evaluated on any Geometry
instance having the same topology.
oReturn = Geometry.GetSurfacePointLocatorsFromPoints( [PointIndices] ); |
Parameter | Type | Description |
---|---|---|
PointIndices | 1-dimensional Array | A 1D array containing point indices for which the point locators will be built. |
/* 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