Returns normals as a 2 dimensional Array of x,y,z values.
set oRoot = Application.ActiveProject.ActiveScene.Root set oCube = oRoot.AddGeometry( "Cube", "MeshSurface" ) set oGeometry = oCube.ActivePrimitive.Geometry aNormals = oGeometry.Facets.NormalArray for i = LBound(aNormals, 2) to UBound(aNormals, 2) Application.LogMessage "normal[" & i & "] =" & aNormals(0,i) & "," & aNormals(1,i) & "," & aNormals(2,i) next ' Expected result: 'INFO : normal[0] =0,0,-1 'INFO : normal[1] =0,-1,0 'INFO : normal[2] =-1,0,0 'INFO : normal[3] =1,0,0 'INFO : normal[4] =0,1,0 'INFO : normal[5] =0,0,1 |
var oCube = Application.ActiveSceneRoot.AddGeometry( "Cube", "MeshSurface" ) ; var oGeometry = oCube.ActivePrimitive.Geometry ; aNormals = new VBArray( oGeometry.Facets.NormalArray ) ; for ( i = aNormals.lbound(2) ; i <= aNormals.ubound(2) ; i++ ) { Application.LogMessage( "normal[" + i + "] =" + aNormals.getItem(0,i) + "," + aNormals.getItem(1,i) + "," + aNormals.getItem(2,i) ) ; } // Expected result: //INFO : normal[0] =0,0,-1 //INFO : normal[1] =0,-1,0 //INFO : normal[2] =-1,0,0 //INFO : normal[3] =1,0,0 //INFO : normal[4] =0,1,0 //INFO : normal[5] =0,0,1 |