Table of Contents

Class PlyReader

Namespace
HelixToolkit.SharpDX
Assembly
HelixToolkit.SharpDX.dll

Polygon File Format Reader.

[Obsolete("Suggest to use HelixToolkit.SharpDX.Assimp")]
public class PlyReader : ModelReader, IModelReader
Inheritance
PlyReader
Implements
Inherited Members

Remarks

This reader only reads ascii ply formats. This was initially meant to read models exported by Blender 3D Software.

Constructors

PlyReader()

Initializes a new PlyReader.

public PlyReader()

Properties

Faces

public IList<int[]>? Faces { get; }

Property Value

IList<int[]>

FacesNumber

Gets or sets the number of faces.

public int FacesNumber { get; }

Property Value

int

Normals

Gets or sets the normal vectors of this ply model.

public IList<Vector3>? Normals { get; }

Property Value

IList<Vector3>

ObjectInformation

Contains information about the Ply file received.

public Dictionary<string, double>? ObjectInformation { get; }

Property Value

Dictionary<string, double>

TextureCoordinates

Gets or sets the texture coordinates of the ply model.

public IList<Vector2>? TextureCoordinates { get; }

Property Value

IList<Vector2>

Remarks

S,T->X,Y

Vertices

Gets or sets the vertices of this ply model.

public IList<Vector3>? Vertices { get; }

Property Value

IList<Vector3>

VerticesNumber

Gets or sets the number of vertices.

public int VerticesNumber { get; }

Property Value

int

Methods

CreateMesh()

Creates a mesh from the loaded file.

public MeshGeometry3D CreateMesh()

Returns

MeshGeometry3D

A MeshGeometry3D.

CreateMeshGeometry3D()

Creates a MeshGeometry3D object from the loaded file. Polygons are triangulated using triangle fans.

public MeshGeometry3D CreateMeshGeometry3D()

Returns

MeshGeometry3D

A MeshGeometry3D.

CreateModel3D()

Creates a List<T> from the loaded file.

public List<Object3D> CreateModel3D()

Returns

List<Object3D>

A List<T>.

Load(Stream)

Loads a ply file from the Stream.

public void Load(Stream s)

Parameters

s Stream

The stream containing the ply file.

Load(string)

public void Load(string filepath)

Parameters

filepath string

Read(Stream, ModelInfo)

Reads the model from the specified stream.

public override List<Object3D>? Read(Stream s, ModelInfo info = default)

Parameters

s Stream

The stream.

info ModelInfo

Returns

List<Object3D>

A List<T>

Read(string)

Reads the model from the specified path.

public List<Object3D>? Read(string path)

Parameters

path string

The path.

Returns

List<Object3D>

The model.