Exemple #1
0
        public async Task LoadAsyncはアスキーSTLのポリゴンを読み込むことができる()
        {
            var singleFacet = await StlFile.LoadAsync(@"..\..\TestData\StlAscii\singleFacet-ascii.stl");

            Expect(singleFacet.Geometry.TriangleIndices, Is.EquivalentTo(new[] { Tuple.Create(0, 1, 2) }));

            Expect(singleFacet.Geometry.Positions.ElementAt(0).X, Is.EqualTo(0.0));
            Expect(singleFacet.Geometry.Positions.ElementAt(0).Y, Is.EqualTo(0.0));
            Expect(singleFacet.Geometry.Positions.ElementAt(0).Z, Is.EqualTo(10.0));
            Expect(singleFacet.Geometry.Positions.ElementAt(1).X, Is.EqualTo(10.0));
            Expect(singleFacet.Geometry.Positions.ElementAt(1).Y, Is.EqualTo(0.0));
            Expect(singleFacet.Geometry.Positions.ElementAt(1).Z, Is.EqualTo(10.0));
            Expect(singleFacet.Geometry.Positions.ElementAt(2).X, Is.EqualTo(0.0));
            Expect(singleFacet.Geometry.Positions.ElementAt(2).Y, Is.EqualTo(10.0));
            Expect(singleFacet.Geometry.Positions.ElementAt(2).Z, Is.EqualTo(10.0));
        }
Exemple #2
0
        public MainViewModel()
            : base(Messenger.Default)
        {
            モデル = new 空間();

            立方体を追加する = new RelayCommand(() => モデル.モデルを追加する(new 立方体()));

            Stlファイルを読み込む = new RelayCommand(
                () => {
                MessengerInstance.Send(
                    new FileOpenMessage(
                        async path =>
                {
                    モデル.モデルを追加する(await StlFile.LoadAsync(path));
                }));
            });
        }
Exemple #3
0
 public async Task LoadAsyncはバイナリSTLの適切なファイルの読み込み時にポリゴンを返す()
 {
     Expect(await StlFile.LoadAsync(@"..\..\TestData\StlBinary\cube-binary.stl"), Is.Not.Null);
 }