HelixToolkit.Wpf.ObjReader.Read C# (CSharp) Method

Read() public method

Reads the model from the specified path.
public Read ( string path ) : System.Windows.Media.Media3D.Model3DGroup
path string The path.
return System.Windows.Media.Media3D.Model3DGroup
        public override Model3DGroup Read(string path)
        {
            this.TexturePath = Path.GetDirectoryName(path);
            using (var s = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read))
            {
                return this.Read(s);
            }
        }

Same methods

ObjReader::Read ( Stream s ) : System.Windows.Media.Media3D.Model3DGroup

Usage Example

 public void Read_CornellBox_ValidModel()
 {
     var r = new ObjReader();
     var model = r.Read(@"Models\obj\cornell_box.obj");
     Assert.AreEqual(9, model.Children.Count);
     var gm1 = model.Children[1] as GeometryModel3D;
     Assert.NotNull(gm1);
     var mg1 = gm1.Geometry as MeshGeometry3D;
     Assert.NotNull(mg1);
     //// Assert.AreEqual(69451, mg1.TriangleIndices.Count / 3);
 }
All Usage Examples Of HelixToolkit.Wpf.ObjReader::Read