public void BinaryRead() { var exchanger = new StlExchanger(); var path = Path.Combine(TestData.TestDataDirectory, Path.Combine(_BasePath, "BinaryRead_Source.stl")); Assert.IsTrue((exchanger as IBodyImporter).DoImport(path, out var bodies)); Assert.IsNotNull(bodies); Assert.AreEqual(1, bodies.Count()); AssertHelper.IsSameModel(bodies.First().Shape, Path.Combine(_BasePath, "BinaryRead"), ModelCompare.CompareFlags.SaveTriangulation | ModelCompare.CompareFlags.CompareText); }
public void AsciiWrite() { var bodies = TestGeomGenerator.CreateBoxCylinderSphere(); var exchanger = new StlExchanger(); var path = Path.Combine(TestData.TestDataDirectory, Path.Combine(_BasePath, "AsciiWrite_TestResult.stl")); Assert.IsTrue((exchanger as IBodyExporter).DoExport(path, bodies)); AssertHelper.IsSameTextFile(Path.Combine(_BasePath, "AsciiWrite.stl"), path, AssertHelper.TextCompareFlags.IgnoreFloatPrecision); }