public void New2()
        {
            var technique = new ObjCurvatureDependentSubdivisionTechnique(2.0f, 3.0f);

            Assert.Equal(2.0f, technique.MaximumDistance);
            Assert.Equal(3.0f, technique.MaximumAngle);
        }
Ejemplo n.º 2
0
        public void RenderAttributes_ApproximationTechnique_Curvature_Valid(string value1, string value2, float distance, float angle, int 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);

            var technique = new ObjCurvatureDependentSubdivisionTechnique(distance, angle);

            switch (type)
            {
            case 0:
                curve.CurveApproximationTechnique = technique;
                break;

            case 1:
                curve.SurfaceApproximationTechnique = technique;
                break;
            }

            string text     = WriteObj(obj);
            string expected =
                @"cstype rat bmatrix
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
" + value1 + @"
" + value2 + @"
curv 5.000000 6.000000 2 3 4
";

            AssertExtensions.TextEqual(expected, text);
        }