public void FreeFormAttributes_Type_Valid(string value, bool rational, ObjFreeFormType type) { var obj = new ObjFile(); var curve = new ObjCurve(); curve.StartParameter = 5.0f; curve.EndParameter = 6.0f; curve.Vertices.Add(2); curve.Vertices.Add(3); curve.Vertices.Add(4); obj.Curves.Add(curve); FillFreeFormAttributes(curve); curve.FreeFormType = type; curve.IsRationalForm = rational; string text = WriteObj(obj); string expected = @"cstype " + value + @" deg 1 1 bmat u 0.000000 0.000000 0.000000 0.000000 bmat v 0.000000 0.000000 0.000000 0.000000 step 0.500000 0.500000 ctech cparm 1.000000 stech cparma 1.000000 2.000000 curv 5.000000 6.000000 2 3 4 "; AssertExtensions.TextEqual(expected, text); }
public void FreeFormAttributes_Type_Valid(string value, bool rational, ObjFreeFormType type) { string content = @" v 0 0 0 v 0 0 0 cstype " + value + @" curv 0 1 1 2 "; var obj = ReadObj(content); Assert.Equal(rational, obj.Curves[0].IsRationalForm); Assert.Equal(type, obj.Curves[0].FreeFormType); }