( self )
| 72 | self.assertEqual( pp, p ) |
| 73 | |
| 74 | def testSphere( self ) : |
| 75 | |
| 76 | s = IECore.Reader.create( os.path.join( "test", "IECore", "data", "cobFiles", "pSphereShape1.cob" ) ).read() |
| 77 | del s["N"] |
| 78 | self.assertTrue( not "N" in s ) |
| 79 | |
| 80 | ss = IECoreScene.MeshNormalsOp()( input=s ) |
| 81 | |
| 82 | self.assertTrue( "N" in ss ) |
| 83 | self.assertEqual( ss["N"].interpolation, IECoreScene.PrimitiveVariable.Interpolation.Vertex ) |
| 84 | |
| 85 | normals = ss["N"].data |
| 86 | self.assertTrue( normals.isInstanceOf( IECore.V3fVectorData.staticTypeId() ) ) |
| 87 | self.assertEqual( normals.size(), ss.variableSize( IECoreScene.PrimitiveVariable.Interpolation.Vertex ) ) |
| 88 | self.assertEqual( normals.getInterpretation(), IECore.GeometricData.Interpretation.Normal ) |
| 89 | |
| 90 | points = ss["P"].data |
| 91 | for i in range( 0, normals.size() ) : |
| 92 | |
| 93 | self.assertTrue( math.fabs( normals[i].length() - 1 ) < 0.001 ) |
| 94 | |
| 95 | p = points[i].normalize() |
| 96 | self.assertTrue( normals[i].dot( p ) > 0.99 ) |
| 97 | self.assertTrue( normals[i].dot( p ) < 1.01 ) |
| 98 | |
| 99 | def testUniformInterpolation( self ) : |
| 100 |
nothing calls this directly
no test coverage detected