示例#1
0
        public void GenerateModelComplexVolumentric()
        {
            const string modelFile = @".\TestAssets\algos.obj";

            var cubic = Modelling.ReadModelVolmetic(modelFile, 1, null, ModelTraceVoxel.Thin);

            var cubicCount = Modelling.CountCubic(cubic);

            var size = cubic.Length * cubic[0].Length * cubic[0][0].Length;

            Assert.AreEqual(1290600, size, "Array length size must match.");

            Assert.AreEqual(108, cubic.Length, "Array size must match.");
            Assert.AreEqual(50, cubic[0].Length, "Array size must match.");
            Assert.AreEqual(239, cubic[0][0].Length, "Array size must match.");

            Assert.AreEqual(CubeType.Cube, cubic[54][39][7]);
            Assert.AreEqual(CubeType.Cube, cubic[54][39][17]);
            Assert.AreEqual(CubeType.Cube, cubic[54][39][18]);
            Assert.AreEqual(CubeType.Cube, cubic[54][39][19]);
            Assert.AreEqual(CubeType.Cube, cubic[54][39][20]);
            Assert.AreEqual(CubeType.Cube, cubic[54][39][23]);
            Assert.AreEqual(CubeType.Cube, cubic[54][39][24]);
            Assert.AreEqual(CubeType.Cube, cubic[54][39][25]);
            Assert.AreEqual(CubeType.Cube, cubic[54][39][26]);
            Assert.AreEqual(CubeType.Cube, cubic[54][39][35]);
            Assert.AreEqual(CubeType.Cube, cubic[54][39][36]);

            Assert.AreEqual(51921, cubicCount[CubeType.Cube], "Cube count must match.");
            Assert.AreEqual(188293, cubicCount[CubeType.Interior], "Interior count must match.");
        }
示例#2
0
        public void GenerateModelSimpleThinSmoothedVolumentric()
        {
            const string modelFile = @".\TestAssets\t25.obj";

            var cubic = Modelling.ReadModelVolmetic(modelFile, 0, null, ModelTraceVoxel.ThinSmoothed);

            var cubicCount = Modelling.CountCubic(cubic);

            var size = cubic.Length * cubic[0].Length * cubic[0][0].Length;

            Assert.AreEqual(72, size, "Array length size must match.");

            Assert.AreEqual(4, cubic.Length, "Array size must match.");
            Assert.AreEqual(6, cubic[0].Length, "Array size must match.");
            Assert.AreEqual(3, cubic[0][0].Length, "Array size must match.");

            Assert.AreEqual(36, cubicCount[CubeType.Cube], "Cube count must match.");
            Assert.AreEqual(4, cubicCount[CubeType.Interior], "Interior count must match.");
        }
示例#3
0
        public void GenerateModelComplexVolumentricHalfScale()
        {
            const string modelFile = @".\TestAssets\algos.obj";

            var cubic = Modelling.ReadModelVolmetic(modelFile, 0.5, null, ModelTraceVoxel.Thin);

            var cubicCount = Modelling.CountCubic(cubic);

            var size = cubic.Length * cubic[0].Length * cubic[0][0].Length;

            Assert.AreEqual(168480, size, "Array length size must match.");

            Assert.AreEqual(54, cubic.Length, "Array size must match.");
            Assert.AreEqual(26, cubic[0].Length, "Array size must match.");
            Assert.AreEqual(120, cubic[0][0].Length, "Array size must match.");

            Assert.AreEqual(12540, cubicCount[CubeType.Cube], "Cube count must match.");
            Assert.AreEqual(20651, cubicCount[CubeType.Interior], "Interior count must match.");
        }