public void WriteLineWithTransformationMatrixTest() { var file = new IgesFile(); var trans = new IgesTransformationMatrix() { R11 = 1.0, R12 = 2.0, R13 = 3.0, T1 = 4.0, R21 = 5.0, R22 = 6.0, R23 = 7.0, T2 = 8.0, R31 = 9.0, R32 = 10.0, R33 = 11.0, T3 = 12.0 }; var line = new IgesLine() { P1 = new IgesPoint(1, 2, 3), P2 = new IgesPoint(4, 5, 6), TransformationMatrix = trans, }; file.Entities.Add(line); VerifyFileContains(file, @" 124 1 0 0 0 00000000D 1 124 0 0 1 0 D 2 110 2 0 0 0 1 00000000D 3 110 0 0 1 0 D 4 124,1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.; 1P 1 110,1.,2.,3.,4.,5.,6.; 3P 2 "); }
private static void TestTransform(IgesPoint input, IgesTransformationMatrix matrix, IgesPoint expected) { var result = matrix.Transform(input); Assert.Equal(expected.X, result.X); Assert.Equal(expected.Y, result.Y); Assert.Equal(expected.Z, result.Z); }