Beispiel #1
0
        public void CopyAsBinary()
        {
            STLDocument stlStringFrom = null;
            STLDocument stlStringTo   = null;
            STLDocument stlBinaryFrom = null;
            STLDocument stlBinaryTo   = null;

            using (Stream inStream = GetData("ASCII.stl"), outStream = new MemoryStream())
            {
                stlStringFrom = STLDocument.Read(inStream);
                stlStringTo   = STLDocument.CopyAsBinary(inStream, outStream);
            }

            Assert.IsNotNull(stlStringFrom);
            Assert.IsNotNull(stlStringTo);
            Assert.IsTrue(stlStringFrom.Equals(stlStringTo));

            using (Stream inStream = GetData("Binary.stl"), outStream = new MemoryStream())
            {
                stlBinaryFrom = STLDocument.Read(inStream);
                stlBinaryTo   = STLDocument.CopyAsBinary(inStream, outStream);
            }

            Assert.IsNotNull(stlBinaryFrom);
            Assert.IsNotNull(stlBinaryTo);
            Assert.IsTrue(stlBinaryFrom.Equals(stlBinaryTo));
        }
        public void CopyAsBinary()
        {
            STLDocument stlStringFrom;
            STLDocument stlStringTo;
            STLDocument stlBinaryFrom;
            STLDocument stlBinaryTo;

            using (var inStream = GetData("ASCII.stl"))
                using (var outStream = new MemoryStream())
                {
                    stlStringFrom = STLDocument.Read(inStream);
                    stlStringTo   = STLDocument.CopyAsBinary(inStream, outStream);
                }

            Assert.NotNull(stlStringFrom);
            Assert.NotNull(stlStringTo);
            Assert.Equal(stlStringFrom, stlStringTo);

            using (var inStream = GetData("Binary.stl"))
                using (var outStream = new MemoryStream())
                {
                    stlBinaryFrom = STLDocument.Read(inStream);
                    stlBinaryTo   = STLDocument.CopyAsBinary(inStream, outStream);
                }

            Assert.NotNull(stlBinaryFrom);
            Assert.NotNull(stlBinaryTo);
            Assert.Equal(stlBinaryFrom, stlBinaryTo);
        }