Exemple #1
0
        public void TestToPovCode()
        {
            var blob = new Blob("myBlob")
            {
                Threshold = 1, Sturm = true, Hierarchy = false
            };

            blob.AddSphere(new PovVector(1, 0, 0), 1, 2);
            blob.AddCylinder(new PovVector(1, 0, 0), new PovVector(0, 1, 0), 1, 2);
            var povCode = blob.ToPovCode();

            Check.That(povCode).IsEqualTo("blob {\n threshold 1\n sphere {\n < 1, 0, 0>, 1, strength 2}\ncylinder {\n < 1, 0, 0>, < 0, 1, 0>, 1, strength 2}\n}");
        }
Exemple #2
0
        public void TestToPovCodeWithName()
        {
            var center1   = new PovVector("c1", 1, 1, 1);
            var center2   = new PovVector("c2", -1, -1, -1);
            var threshold = new PovNumber("MyThreshold", 1);
            var strength  = new PovNumber("MyStrength", 2);
            var blob      = new Blob("myBlob")
            {
                Threshold = threshold
            };

            blob.AddSphere(center1, 1, strength);
            blob.AddCylinder(center2, new PovVector(0, 1, 0), 1, 2);
            var povCode = blob.ToPovCode();

            Check.That(povCode).IsEqualTo("blob {\n threshold MyThreshold\n sphere {\n c1, 1, strength MyStrength}\ncylinder {\n c2, < 0, 1, 0>, 1, strength 2}\n}");
        }