Documentation
¶
Overview ¶
Package ply reads PLY files, the ASCII kind and the binary kind in both byte orders (SPEC §28.5), into a model.Model.
A file has a vertex element with the position (x, y and z) and optionally the normal (nx, ny, nz), the color (red, green, blue and alpha) and the texture coordinates (s and t, u and v, texture_u and texture_v), and a face element whose list property vertex_indices (or vertex_index) names the corners of each polygon, which is cut into triangles. A file with no faces is a point cloud: its mesh is of points, which viewport3d draws with its point material. Positions that the file stores as double are kept in float64 (model.Mesh.Positions64) when some of them are not exact in float32. Other elements and properties are skipped, with one line in the log for each kind.
Index ¶
Constants ¶
const TagPLYInvalid = "PLYInvalid"
TagPLYInvalid is the tag of the error of a file that is not a valid PLY file: a bad header, a body that is cut short, a number that is not one or that is not finite, an index that names no vertex, a file with no vertex or no triangle. The metadata has "reason" (a short fixed phrase), and "line" (the header, and the body of an ASCII file) or "offset" (the byte, in a binary body).
Flutter: no counterpart
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// Name is the name of the model, its node and its mesh. Load sets the base name of the file when it is empty.
Name string
// Logger gets the notes of the loader (the elements and properties that it skipped, the faces that it dropped); slog.Default()
// when nil.
Logger *slog.Logger
}
Options are the options of Decode and Load.
Flutter: no counterpart