需要较新的 C++17 编译器;只能读大端二进制文件,不能写大端;README 未给出具体 CMake 构建命令,需自行查看仓库
tinyply
ddiakopoulos更新放缓轻量级 C++17 单头文件库,用于读写 PLY 3D 网格格式,适合在图形和视觉项目里快速集成模型导入导出。
:earth_africa: lightweight C++17 ply 3d mesh format importer & exporter
把 tinyply.h 加入项目直接 #include;或按仓库 CMake 构建示例程序README 未说明,纯 CPU 库,无 GPU 或显存要求
单头文件零依赖的 C++17 PLY 网格读写库,适合快速集成到图形与视觉管线
轻量级 C++17 单头文件库,用于读写 PLY 3D 网格格式,适合在图形和视觉项目里快速集成模型导入导出。
核心能力
- 单头文件实现,仅依赖 C++ STL
- 支持二进制与 ASCII 两种 PLY 格式读写
- 支持大于 4GB 文件及大端二进制读取
- 3.0 为常见二进制小端导入加快速路径解析
- 支持任意网格属性与变长列表
容易踩的坑
- 3.0tinyply 3.0 - major update最新正式版2026-01-09 · 2026-01-09 17:14 UTC
tinyply is now is a little less tiny, but it's a major performance upgrade and adds support for variable length lists alongside better error handling.
- 2.3.4tinyply 2.3.4 bugfixes and cmake improvements2022-02-05 · 2022-02-05 02:17 UTC
这个版本没有写更新说明。
- 2.3.2tinyply 2.3.2 hotfix2020-01-31 · 2020-01-31 22:18 UTC
查看更新说明
version 2.3 contains minor bugfixes and performance improvements. A feature of the example application includes the ability to pre-load files into memory for improved runtime parsing performance on many files. We also introduce conformance and regression tests using the Doctest library.
- 2.2tinyply 2.22018-08-08 · 2018-08-08 03:39 UTC
查看更新说明
version 2.2 is a rewrite of the inner read/write loop. Compared to version 2.0, this version reads and writes binary about five times faster. When a list size hint is given for reading, the performance is approximately comparable to rply.
- 2.1tinyply 2.12018-06-12 · 2018-06-12 15:58 UTC
查看更新说明
now with various performance improvements
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
tinyply 3.0
A single-header, zero-dependency (except the C++ STL) public domain implementation of the PLY mesh file format. An overview and definition of the file format is available here. This format is often used in the computer vision and graphics communities for its relative simplicity, ability to support arbitrary mesh attributes, and binary modes. Since ~2023 it has been used one of the primary interchange formats between applications & pipelines for gaussian splatting. Most famously, PLY is used to distribute models in the Stanford 3D Scanning Repository, including the original bunny.
The library is written in C++17 and requires a recent compiler. Tinyply supports importing and exporting PLY files in both binary and ascii formats. Tinyply supports filesizes >= 4gb and can read big-endian binary files (but not write them). Recently in the 3.0 release, tinyply adds a fast-path parser for the most common import scheme (binary little-endian) when specific conditions are met.
Getting Started
The project comes with a simple example program demonstrating a circular write / read and all of the major API functionality.
In The Wild
Since 2015, tinyply has been used in thousands of projects including pointcloud tools, raytracers, synthetic data renderers, computational geometry libraries, and more. It's even listed by the US Library of Congress as a utility for archival preservation of digital media. A few other notable projects are highlighted below:
- libigl, a robust computational geometry library from UoT professors Alec Jacobson and Daniele Panozzo.
- Maplab from ETH Zürich, a research-oriented visual-inertial mapping framework.
- glChAoS.P from Michele Morrone, a rendering sandbox for 3D strange attractors.
- Cilantro, a robust and featureful C++ library for working with pointcloud data.
- ScanNet, an RGB+D dataset of 2.5 million views across 1500 scans.
- PlaneRCNN, 3D plane detection via single-shot images from NVIDIA Research
- KNOSSOS, a framework to visualize and annotate 3D image data (neural morphology and connectivity).
- fVDB, a Python library for building applications using NanoVDB on the GPU in PyTorch.
tinyply not what you're looking for? tinyply trades some performance for simplicity and flexibility. For domain-specific uses (e.g. where your application does not need to handle arbitrary user-fed PLY files), there may be other alternatives. For more, please check out the following benchmarks:
- Vilya Harvey's ply-parsing-perf
- Maciej Halber's ply_io_benchmark
Past Versions
version 2.0is an API re-write to support later improvements towards variable length lists. One notable change is that tinyply now produces and consumes structured byte arrays, with type information held as metadata.version 2.1contained minor bugfixes and speed improvements.version 2.2is a rewrite of the inner read/write loop. Compared toversion 2.0, this version reads and writes binary about five times faster. When a list size hint is given for reading, the performance is approximately comparable to rply.version 2.3contains minor bugfixes and performance improvements.version 3.0is a little less tiny, but it's a major performance upgrade and adds support for variable length lists alongside better error handling,
License
This software is in the public domain. Where that dedication is not recognized, you are granted a perpetual, irrevocable license to copy, distribute, and modify this file as you see fit. If these terms are not suitable to your organization, you may choose to license it under the terms of the 2-clause simplified BSD.