#[non_exhaustive]pub enum Format {
Show 57 variants
Stl,
Ply,
Vox,
Obj,
Fbx,
ThreeDs,
ThreeMf,
Usd,
Gltf,
Vrm,
SketchUp,
Bvh,
Collada,
Off,
X3d,
Dxf,
Splat,
Spz,
Sog,
Las,
Pcd,
Xyz,
Pts,
Ptx,
Asc,
E57,
Amf,
Lwo,
Ac3d,
Pmx,
Pmd,
Vmd,
DirectX,
Md2,
Md3,
Md5Mesh,
Md5Anim,
Iqm,
Smd,
Vta,
Ms3d,
B3d,
Asf,
Amc,
C3d,
Trc,
Htr,
Ogre,
Flt,
Ogex,
IrrMesh,
Irr,
Xgl,
Vtk,
Tiles,
Gmsh,
Medit,
}Expand description
A model format Polysmelt reads, whether or not this build has its cargo feature.
open and read tell a model’s format from its extension and
then from its first bytes; Loader::format names it outright.
use polysmelt::Format;
assert_eq!(Format::from_extension("GLB"), Some(Format::Gltf));
assert_eq!(Format::detect(b"Kaydara FBX Binary \0"), Some(Format::Fbx));
assert_eq!(Format::Collada.extensions(), ["dae", "zae", "kmz"]);
assert_eq!(Format::Collada.name(), "COLLADA");Each is behind a cargo feature of its name: 3ds and 3mf for those two, dae for
COLLADA, xyz for the text point clouds, ac3d for .ac, mmd for PMX, PMD and VMD,
directx for .x, asf for ASF and AMC, irr for Irrlicht’s two, md5 for MD5’s two,
smd for SMD and VTA, gltf for glTF and VRM, las for LAS and LAZ (laz adds LAZ’s
decompression), vtk for VTK’s legacy and XML files, tiles for 3D Tiles, msh for Gmsh, medit for
Medit’s text and binary meshes.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Stl
STL, binary and ASCII (.stl).
Ply
PLY, ASCII and binary, with gaussian splats, plain or compressed (.ply).
Vox
MagicaVoxel (.vox).
Obj
Wavefront OBJ, with its MTL materials (.obj).
Fbx
FBX, binary and ASCII (.fbx).
ThreeDs
3D Studio (.3ds).
ThreeMf
3D Manufacturing Format (.3mf).
Usd
Universal Scene Description: text, binary and zipped (.usd, .usda, .usdc, .usdz).
Gltf
glTF 2.0 (and 1.0), JSON and binary (.gltf, .glb).
Vrm
VRM avatars and their animations (.vrm, .vrma).
SketchUp
SketchUp (.skp).
Bvh
BVH motion capture (.bvh).
Collada
COLLADA, and the .zae and .kmz archives that hold it (.dae, .zae, .kmz).
Off
Object File Format, ASCII and binary (.off).
X3d
X3D and VRML97, and their gzipped forms (.x3d, .x3dv, .x3dz, .wrl, .wrz).
Dxf
DXF meshes (.dxf).
Splat
Gaussian splats in the 32-byte layout (.splat).
Spz
Gaussian splats, gzipped (.spz).
Sog
SOG gaussian splats: a zip of a meta.json and its WebP images, or that meta.json
beside them (.sog).
Las
LAS and LAZ lidar point clouds (.las, .laz).
Pcd
PCD point clouds (.pcd).
Xyz
Text point clouds, a point per line (.xyz).
Pts
Text point clouds, a point per line (.pts).
Ptx
Text point clouds of scans, each placed by its pose (.ptx).
Asc
Text point clouds, a point per line, or ESRI ASCII grids (.asc).
E57
E57 3D scans (.e57).
Amf
Additive Manufacturing File Format (.amf).
Lwo
LightWave objects (.lwo).
Ac3d
AC3D (.ac).
Pmx
MikuMikuDance PMX models (.pmx).
Pmd
MikuMikuDance PMD models (.pmd).
Vmd
MikuMikuDance VMD motions (.vmd).
DirectX
DirectX .x: text, binary and compressed (.x).
Md2
Quake II models (.md2).
Md3
Quake III models (.md3).
Md5Mesh
Doom 3 skeletal meshes (.md5mesh).
Md5Anim
Doom 3 skeletal animations (.md5anim).
Iqm
Inter-Quake Model (.iqm).
Smd
Valve SMD reference and animation files (.smd).
Vta
Valve VTA vertex animation (.vta).
Ms3d
MilkShape 3D (.ms3d).
B3d
Blitz3D (.b3d).
Asf
Acclaim ASF skeletons (.asf).
Amc
Acclaim AMC motions (.amc).
C3d
C3D motion capture (.c3d).
Trc
TRC marker motion capture (.trc).
Htr
HTR motion capture (.htr).
Ogre
OGRE meshes and skeletons, binary and XML, with .material scripts (.mesh,
.skeleton; .mesh.xml and .skeleton.xml are told from their root element).
Flt
OpenFlight (.flt).
Ogex
OpenGEX (.ogex).
IrrMesh
Irrlicht meshes (.irrmesh).
Irr
Irrlicht scenes (.irr).
Xgl
XGL, and zipped ZGL (.xgl, .zgl).
Vtk
VTK: legacy files, and XML poly data and unstructured grids (.vtk, .vtp, .vtu).
Tiles
OGC 3D Tiles: batched, instanced, point cloud and composite tiles (.b3dm, .i3dm,
.pnts, .cmpt), and a tileset.json of them, which has no extension of its own and is
told by its content.
Gmsh
Gmsh meshes, ASCII and binary (.msh).
Medit
Medit (INRIA) meshes: binary .meshb, and text .mesh, an extension OGRE’s meshes have too, so those
are told by their first bytes.
Implementations§
Source§impl Format
impl Format
Sourcepub fn all() -> impl ExactSizeIterator<Item = Format> + Clone
pub fn all() -> impl ExactSizeIterator<Item = Format> + Clone
Every format, in the order they’re listed here.
Sourcepub fn from_extension(ext: &str) -> Option<Format>
pub fn from_extension(ext: &str) -> Option<Format>
The format whose extension is ext (in any case, with or without its dot); None for
one that names none, xml among them: an .xml file is told by its root element.
Sourcepub fn detect(bytes: &[u8]) -> Option<Format>
pub fn detect(bytes: &[u8]) -> Option<Format>
The format of a model whose bytes (all of them, or its start) are bytes, told from its
signature or first words; None when they don’t say. A binary STL, which has no
signature, is told only from all of its bytes.
Sourcepub fn extensions(self) -> &'static [&'static str]
pub fn extensions(self) -> &'static [&'static str]
The format’s extensions, without their dots, the usual one first.
Trait Implementations§
impl Copy for Format
impl Eq for Format
Source§impl Ord for Format
impl Ord for Format
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Format
impl PartialOrd for Format
impl StructuralPartialEq for Format
Auto Trait Implementations§
impl Forget for Format
impl Freeze for Format
impl Move for Format
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnsafeUnpin for Format
impl UnwindSafe for Format
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.